From 98754fa9d12090f5e048fdb05cc5e9ce9111676f Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 6 Jul 2010 14:45:35 -0500 Subject: [svn-r19050] Description: Bring r18704:19049 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode --- ACKNOWLEDGMENTS | 15 + CMakeLists.txt | 728 +++++ COPYING | 6 + CTestConfig.cmake | 13 + ConfigureChecks.cmake | 790 ++++++ MANIFEST | 78 +- Makefile.in | 2 +- README.txt | 2 +- Resources/CMake/FindSZIP.cmake | 179 ++ Resources/CTestCustom.ctest | 2 + Resources/CheckTypeSize.cmake | 48 + Resources/ConversionTests.c | 422 +++ Resources/FindHDF5.cmake | 56 + Resources/GetTimeOfDayTest.cpp | 15 + Resources/H5cxx_config.h.in | 5 + Resources/H5pubconf.h.in | 745 +++++ Resources/HDF5-config.cmake.build.in | 42 + Resources/HDF5-config.cmake.install.in | 43 + Resources/HDF5Macros.cmake | 122 + Resources/HDF5Tests.c | 366 +++ Resources/cacheinit.cmake | 35 + Resources/hdf5_zlib.h.in | 1 + Resources/libhdf5.settings.cmake.in | 68 + Resources/runTest.cmake | 82 + Resources/xlatefile.c | 56 + acsite.m4 | 35 + bin/buildhdf5 | 21 +- c++/CMakeLists.txt | 46 + c++/Makefile.in | 2 +- c++/examples/CMakeLists.txt | 37 + c++/examples/Makefile.in | 2 +- c++/src/CMakeLists.txt | 115 + c++/src/H5AbstractDs.cpp | 17 +- c++/src/H5IdComponent.cpp | 18 +- c++/src/H5PropList.cpp | 44 +- c++/src/Makefile.in | 4 +- c++/test/CMakeLists.txt | 57 + c++/test/Makefile.in | 2 +- config/ibm-aix | 22 +- config/ibm-flags | 77 + config/lt_vers.am | 2 +- config/powerpc-ibm-aix5.x | 11 +- configure | 466 +++- configure.in | 188 +- examples/CMakeLists.txt | 55 + examples/Makefile.in | 2 +- fortran/CMakeLists.txt | 152 + fortran/Makefile.in | 2 +- fortran/examples/CMakeLists.txt | 68 + fortran/examples/Makefile.in | 2 +- fortran/src/CMakeLists.txt | 254 ++ fortran/src/H5Ff.c | 50 +- fortran/src/Makefile.in | 4 +- fortran/test/CMakeLists.txt | 195 ++ fortran/test/Makefile.in | 2 +- fortran/testpar/Makefile.in | 2 +- hl/CMakeLists.txt | 42 + hl/Makefile.in | 2 +- hl/c++/CMakeLists.txt | 22 + hl/c++/Makefile.in | 2 +- hl/c++/examples/CMakeLists.txt | 51 + hl/c++/examples/Makefile.in | 2 +- hl/c++/src/CMakeLists.txt | 46 + hl/c++/src/H5PacketTable.cpp | 2 +- hl/c++/src/Makefile.in | 4 +- hl/c++/test/CMakeLists.txt | 43 + hl/c++/test/Makefile.in | 2 +- hl/examples/CMakeLists.txt | 46 + hl/examples/Makefile.in | 2 +- hl/fortran/CMakeLists.txt | 41 + hl/fortran/Makefile.in | 2 +- hl/fortran/examples/CMakeLists.txt | 44 + hl/fortran/examples/Makefile.in | 2 +- hl/fortran/src/CMakeLists.txt | 100 + hl/fortran/src/H5IMcc.h | 2 +- hl/fortran/src/Makefile.in | 4 +- hl/fortran/test/CMakeLists.txt | 85 + hl/fortran/test/Makefile.in | 2 +- hl/src/CMakeLists.txt | 67 + hl/src/H5DS.c | 303 +- hl/src/H5DSprivate.h | 1 + hl/src/Makefile.in | 4 +- hl/test/CMakeLists.txt | 87 + hl/test/Makefile.am | 2 +- hl/test/Makefile.in | 5 +- hl/test/test_ds.c | 162 +- hl/tools/CMakeLists.txt | 85 + hl/tools/Makefile.in | 2 +- hl/tools/gif2h5/Makefile.in | 2 +- perform/CMakeLists.txt | 134 + perform/Makefile.in | 2 +- perform/benchpar.c | 18 +- perform/iopipe.c | 7 - perform/sio_perf.h | 1 + perform/sio_timer.h | 2 +- release_docs/CMake.txt | 111 + release_docs/INSTALL_Cygwin.txt | 37 +- release_docs/INSTALL_MinGW.txt | 263 -- release_docs/INSTALL_Windows.txt | 126 +- release_docs/INSTALL_Windows_From_Command_Line.txt | 8 +- release_docs/INSTALL_Windows_Short_VS2008.TXT | 192 ++ release_docs/RELEASE.txt | 93 +- src/CMakeLists.txt | 720 +++++ src/H5AC.c | 768 +---- src/H5ACpkg.h | 18 +- src/H5ACprivate.h | 13 +- src/H5B.c | 9 +- src/H5B2cache.c | 32 +- src/H5B2hdr.c | 13 +- src/H5B2pkg.h | 5 +- src/H5B2stat.c | 2 +- src/H5Bdbg.c | 3 +- src/H5C.c | 1188 +------- src/H5Cpkg.h | 85 +- src/H5Cprivate.h | 35 +- src/H5Dchunk.c | 934 ++++--- src/H5Dcompact.c | 2 +- src/H5Dcontig.c | 2 +- src/H5Dfill.c | 51 +- src/H5Dint.c | 8 +- src/H5Dmpio.c | 22 +- src/H5Dpkg.h | 14 +- src/H5Dproxy.c | 2 +- src/H5EAhdr.c | 2 +- src/H5Edefin.h | 4 +- src/H5Einit.h | 12 +- src/H5Epubgen.h | 6 +- src/H5Eterm.h | 4 +- src/H5F.c | 2 +- src/H5FAhdr.c | 2 +- src/H5FDstdio.c | 3 + src/H5FS.c | 19 +- src/H5FScache.c | 36 +- src/H5FSdbg.c | 2 + src/H5FSpkg.h | 6 +- src/H5FSsection.c | 2 +- src/H5Fpublic.h | 1 - src/H5Fsuper.c | 10 +- src/H5Gcache.c | 37 +- src/H5Gnode.c | 41 +- src/H5Gpkg.h | 19 +- src/H5Groot.c | 2 +- src/H5HF.c | 36 +- src/H5HFcache.c | 26 +- src/H5HFdbg.c | 52 +- src/H5HFdblock.c | 6 +- src/H5HFhdr.c | 49 +- src/H5HFiblock.c | 28 +- src/H5HFpkg.h | 16 +- src/H5HG.c | 150 +- src/H5HGcache.c | 1 - src/H5HGdbg.c | 4 +- src/H5HGpkg.h | 1 + src/H5HL.c | 48 +- src/H5HLcache.c | 2 +- src/H5HLpkg.h | 1 + src/H5MF.c | 2 +- src/H5O.c | 23 +- src/H5Oalloc.c | 135 +- src/H5Oattribute.c | 20 +- src/H5Ocache.c | 14 +- src/H5Ochunk.c | 69 +- src/H5Ofill.c | 1 + src/H5Omessage.c | 10 +- src/H5Opkg.h | 6 +- src/H5Pdcpl.c | 2 +- src/H5Pfapl.c | 8 - src/H5Ppublic.h | 2 +- src/H5SM.c | 123 +- src/H5SMcache.c | 66 +- src/H5SMpkg.h | 42 +- src/H5SMtest.c | 6 +- src/H5Tconv.c | 30 +- src/H5Tprivate.h | 1 + src/H5Tvlen.c | 41 + src/H5api_adpt.h | 281 ++ src/H5config.h.in | 6 + src/H5detect.c | 19 +- src/H5err.txt | 4 +- src/H5private.h | 6 +- src/H5public.h | 4 +- src/Makefile.in | 4 +- src/libhdf5.settings.in | 2 +- test/CMakeLists.txt | 312 +++ test/Makefile.in | 2 +- test/cache.c | 2927 ++++++++------------ test/cache_api.c | 528 +--- test/cache_common.c | 1365 ++++----- test/cache_common.h | 358 +-- test/h5test.c | 2 +- test/ohdr.c | 18 + test/set_extent.c | 145 +- test/testcheck_version.sh.in | 10 +- testpar/CMakeLists.txt | 66 + testpar/Makefile.in | 2 +- testpar/t_cache.c | 507 ++-- tools/CMakeLists.txt | 42 + tools/Makefile.in | 2 +- tools/h5copy/CMakeLists.txt | 249 ++ tools/h5copy/Makefile.in | 2 +- tools/h5copy/h5copy.c | 30 +- tools/h5copy/h5copygentest.c | 15 +- tools/h5copy/testh5copy.sh | 10 +- tools/h5diff/CMakeLists.txt | 674 +++++ tools/h5diff/Makefile.in | 2 +- tools/h5diff/h5diff_common.c | 20 +- tools/h5diff/h5diff_common.h | 18 +- tools/h5diff/h5diff_main.c | 8 +- tools/h5diff/h5diffgentest.c | 8 +- tools/h5diff/ph5diff_main.c | 9 +- tools/h5diff/testfiles/h5diff_10.txt | 10 +- tools/h5diff/testfiles/h5diff_101w.txt | 10 + tools/h5diff/testfiles/h5diff_102w.txt | 10 + tools/h5diff/testfiles/h5diff_452.txt | 2 +- tools/h5diff/testfiles/h5diff_600.txt | 10 +- tools/h5diff/testfiles/h5diff_603.txt | 10 +- tools/h5diff/testfiles/h5diff_606.txt | 10 +- tools/h5diff/testfiles/h5diff_612.txt | 10 +- tools/h5diff/testfiles/h5diff_615.txt | 10 +- tools/h5diff/testfiles/h5diff_621.txt | 10 +- tools/h5diff/testfiles/h5diff_622.txt | 10 +- tools/h5diff/testfiles/h5diff_623.txt | 10 +- tools/h5diff/testfiles/h5diff_624.txt | 10 +- tools/h5diff/testh5diff.sh | 96 +- tools/h5dump/CMakeLists.txt | 628 +++++ tools/h5dump/Makefile.in | 2 +- tools/h5dump/h5dump.c | 326 +-- tools/h5dump/h5dumpgentest.c | 280 +- tools/h5import/CMakeLists.txt | 61 + tools/h5import/Makefile.in | 2 +- tools/h5import/h5import.c | 6 + tools/h5import/h5importtestutil.sh | 2 +- tools/h5jam/CMakeLists.txt | 108 + tools/h5jam/Makefile.am | 2 +- tools/h5jam/Makefile.in | 4 +- tools/h5jam/getub.c | 26 +- tools/h5jam/h5jam.c | 48 +- tools/h5jam/h5unjam.c | 46 +- tools/h5jam/tellub.c | 26 +- tools/h5ls/CMakeLists.txt | 245 ++ tools/h5ls/Makefile.in | 2 +- tools/h5ls/h5ls.c | 349 ++- tools/h5ls/testh5ls.sh.in | 49 +- tools/h5repack/CMakeLists.txt | 563 ++++ tools/h5repack/Makefile.in | 2 +- tools/h5repack/h5repack.c | 30 +- tools/h5repack/h5repack_copy.c | 59 +- tools/h5repack/h5repack_filters.c | 1 + tools/h5repack/h5repack_main.c | 41 +- tools/h5repack/h5repack_opttable.c | 12 +- tools/h5repack/h5repack_parse.c | 52 +- tools/h5repack/h5repack_verify.c | 26 +- tools/h5repack/h5repacktst.c | 5 +- tools/h5repack/testh5repack_detect_szip.c | 7 + tools/h5stat/CMakeLists.txt | 142 + tools/h5stat/Makefile.in | 2 +- tools/h5stat/h5stat.c | 42 +- tools/lib/CMakeLists.txt | 70 + tools/lib/Makefile.in | 2 +- tools/lib/h5diff.c | 4 +- tools/lib/h5diff.h | 6 +- tools/lib/h5tools.h | 39 +- tools/lib/h5tools_error.h | 6 +- tools/lib/h5tools_ref.c | 7 +- tools/lib/h5tools_ref.h | 14 +- tools/lib/h5tools_utils.c | 38 +- tools/lib/h5tools_utils.h | 43 +- tools/lib/h5trav.h | 22 +- tools/misc/CMakeLists.txt | 150 + tools/misc/Makefile.in | 2 +- tools/misc/h5mkgrp.c | 39 +- tools/testfiles/help-1.ls | 62 +- tools/testfiles/help-2.ls | 62 +- tools/testfiles/help-3.ls | 62 +- tools/testfiles/textlinksrc-1-old.ls | 19 + tools/testfiles/textlinksrc-1.ls | 2 +- tools/testfiles/textlinksrc-2-old.ls | 8 + tools/testfiles/textlinksrc-2.ls | 2 +- tools/testfiles/textlinksrc-3-old.ls | 14 + tools/testfiles/textlinksrc-3.ls | 2 +- tools/testfiles/textlinksrc-6-old.ls | 8 + tools/testfiles/textlinksrc-6.ls | 2 +- tools/testfiles/textlinksrc-7-old.ls | 4 + tools/testfiles/textlinksrc-7.ls | 2 +- tools/testfiles/tgroup-1.ls | 62 +- tools/testfiles/tsoftlinks-1.ls | 13 + tools/testfiles/tsoftlinks-2.ls | 24 + tools/testfiles/tsoftlinks-3.ls | 8 + tools/testfiles/tsoftlinks-4.ls | 8 + tools/testfiles/tsoftlinks-5.ls | 4 + tools/testfiles/tsoftlinks.h5 | Bin 0 -> 6352 bytes vms/src/h5pubconf.h | 6 +- windows/installhdf5lib.bat | 12 +- windows/src/H5pubconf.h | 19 +- windows/test/checktests.bat | 3 +- windows/tools/h5diff/testh5diff.bat | 152 +- windows/tools/h5ls/testh5ls.bat | 28 +- 297 files changed, 17315 insertions(+), 8080 deletions(-) create mode 100644 ACKNOWLEDGMENTS create mode 100644 CMakeLists.txt create mode 100644 CTestConfig.cmake create mode 100644 ConfigureChecks.cmake create mode 100644 Resources/CMake/FindSZIP.cmake create mode 100755 Resources/CTestCustom.ctest create mode 100644 Resources/CheckTypeSize.cmake create mode 100644 Resources/ConversionTests.c create mode 100644 Resources/FindHDF5.cmake create mode 100644 Resources/GetTimeOfDayTest.cpp create mode 100644 Resources/H5cxx_config.h.in create mode 100644 Resources/H5pubconf.h.in create mode 100644 Resources/HDF5-config.cmake.build.in create mode 100644 Resources/HDF5-config.cmake.install.in create mode 100644 Resources/HDF5Macros.cmake create mode 100644 Resources/HDF5Tests.c create mode 100755 Resources/cacheinit.cmake create mode 100644 Resources/hdf5_zlib.h.in create mode 100644 Resources/libhdf5.settings.cmake.in create mode 100644 Resources/runTest.cmake create mode 100644 Resources/xlatefile.c create mode 100644 c++/CMakeLists.txt create mode 100644 c++/examples/CMakeLists.txt create mode 100644 c++/src/CMakeLists.txt create mode 100644 c++/test/CMakeLists.txt create mode 100644 config/ibm-flags create mode 100644 examples/CMakeLists.txt create mode 100644 fortran/CMakeLists.txt create mode 100644 fortran/examples/CMakeLists.txt create mode 100644 fortran/src/CMakeLists.txt create mode 100644 fortran/test/CMakeLists.txt create mode 100644 hl/CMakeLists.txt create mode 100644 hl/c++/CMakeLists.txt create mode 100644 hl/c++/examples/CMakeLists.txt create mode 100644 hl/c++/src/CMakeLists.txt create mode 100644 hl/c++/test/CMakeLists.txt create mode 100644 hl/examples/CMakeLists.txt create mode 100644 hl/fortran/CMakeLists.txt create mode 100644 hl/fortran/examples/CMakeLists.txt create mode 100644 hl/fortran/src/CMakeLists.txt create mode 100644 hl/fortran/test/CMakeLists.txt create mode 100644 hl/src/CMakeLists.txt create mode 100644 hl/test/CMakeLists.txt create mode 100644 hl/tools/CMakeLists.txt create mode 100644 perform/CMakeLists.txt create mode 100755 release_docs/CMake.txt delete mode 100644 release_docs/INSTALL_MinGW.txt create mode 100755 release_docs/INSTALL_Windows_Short_VS2008.TXT create mode 100644 src/CMakeLists.txt create mode 100644 test/CMakeLists.txt create mode 100644 testpar/CMakeLists.txt create mode 100644 tools/CMakeLists.txt create mode 100644 tools/h5copy/CMakeLists.txt create mode 100644 tools/h5diff/CMakeLists.txt create mode 100755 tools/h5diff/testfiles/h5diff_101w.txt create mode 100755 tools/h5diff/testfiles/h5diff_102w.txt create mode 100644 tools/h5dump/CMakeLists.txt create mode 100644 tools/h5import/CMakeLists.txt create mode 100644 tools/h5jam/CMakeLists.txt create mode 100644 tools/h5ls/CMakeLists.txt create mode 100644 tools/h5repack/CMakeLists.txt create mode 100644 tools/h5stat/CMakeLists.txt create mode 100644 tools/lib/CMakeLists.txt create mode 100644 tools/misc/CMakeLists.txt create mode 100644 tools/testfiles/textlinksrc-1-old.ls create mode 100644 tools/testfiles/textlinksrc-2-old.ls create mode 100644 tools/testfiles/textlinksrc-3-old.ls create mode 100644 tools/testfiles/textlinksrc-6-old.ls create mode 100644 tools/testfiles/textlinksrc-7-old.ls create mode 100644 tools/testfiles/tsoftlinks-1.ls create mode 100644 tools/testfiles/tsoftlinks-2.ls create mode 100644 tools/testfiles/tsoftlinks-3.ls create mode 100644 tools/testfiles/tsoftlinks-4.ls create mode 100644 tools/testfiles/tsoftlinks-5.ls create mode 100644 tools/testfiles/tsoftlinks.h5 diff --git a/ACKNOWLEDGMENTS b/ACKNOWLEDGMENTS new file mode 100644 index 0000000..5705727 --- /dev/null +++ b/ACKNOWLEDGMENTS @@ -0,0 +1,15 @@ +Acknowledgments - June 2010 +--------------------------- + +We would like to thank the following people who have contributed directly +or indirectly to HDF5: + +John A. Biddiscombe, Mike Jackson, and Sean McBride for contributing and +testing CMake code included in the HDF5 1.8.5 distribution. + +The HDF5 community for helping shape the development of HDF5 by contributing +bug reports and patches, joining in on forum discussions, and continually +supporting our software. + +Finally, we'd like to thank all organizations whose funding has made HDF5 +possible. diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5430cc7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,728 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5 C CXX) + +#----------------------------------------------------------------------------- +# Instructions for use : Normal Build +# +# For standard build of HDF5 libraries,tests and tools. +# Run cmake using the HDF5 source tree to generate a build tree. +# Enable/Disable options according to requirements and +# set CMAKE_INSTALL_PREFIX to the required install path. +# Make install can be used to install all components for system-wide use. +# +#----------------------------------------------------------------------------- +# Instructions for use : Sub-Project Build +# +# To include HDF5 as a sub-project within another project. +# Set HDF5_EXTERNALLY_CONFIGURED to 1 in the parent project and +# supply values for the following variables... +# +# HDF5_EXPORTED_TARGETS : +# Set this to the name of the targets variable which controls exports +# If unset (because parent project does not support/use the +# INSTALL (EXPORT target...) syntax), then targets are not configured +# for export during install. +# +# HDF5_LIB_DEPENDENCIES : +# If the build of HDF5 libs is being customized, then rules for the +# dependencies of the HDF5 libs may be 'incomplete', add additional +# dependencies to this variable so that external projects pick them up +# +# HDF5_EXTERNAL_LIB_PREFIX : +# If the parent project needs to install hdf libraries, but avoid +# name conflicts with system versions, then a prefix may be added +# to ensure that the correct versions configured are used. +# +# Consider this example from the ParaView project, it builds its own zlib +# library and tells HDF5 to add it as a dependency - this ensures that +# any project making use of this build of HDF5 will use the correct zlib +# +# # Tell hdf5 that we are manually overriding certain settings +# SET(HDF5_EXTERNALLY_CONFIGURED 1) +# # Avoid duplicating names of installed libraries +# SET(HDF5_EXTERNAL_LIB_PREFIX "vtk") +# # Targets linking to the HDF5 libs need to know their names +# # if they are changed in the sub project, they should be here too +# SET(HDF5_LIB_NAME "vtkhdf5") +# SET(HDF5_HL_LIB_NAME "vtkhdf5_hl") +# SET(HDF5_LIBRARY "${HDF5_LIB_NAME};${HDF5_HL_LIB_NAME}") +# # Export configuration to this export variable +# SET(HDF5_EXPORTED_TARGETS "paraview-targets") +# +# # Setup all necessary overrides for zlib so that HDF5 uses our +# # internally compiled zlib rather than any other version +# IF(HDF5_ENABLE_Z_LIB_SUPPORT) +# # We must tell the main HDF5 library that it depends on our zlib +# SET(HDF5_LIB_DEPENDENCIES vtkzlib) +# # Override the zlib header file +# IF(VTK_USE_SYSTEM_ZLIB) +# SET(H5_ZLIB_HEADER "zlib.h") +# ELSE(VTK_USE_SYSTEM_ZLIB) +# SET(H5_ZLIB_HEADER "vtk_zlib.h") +# # Set vars that FindZlib would have set if used in sub project +# SET(ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") +# SET(ZLIB_LIBRARIES vtkzlib) +# ENDIF(VTK_USE_SYSTEM_ZLIB) +# ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT) +# +# # Add the sub project +# ADD_SUBDIRECTORY(Utilities/hdf5-1.8) +# # Add the HDf5 dirs to our include path +# SET(HDF5_INCLUDE_DIR +# ${ParaView_SOURCE_DIR}/Utilities/hdf5-1.8/src +# ${ParaView_BINARY_DIR}/Utilities/hdf5-1.8 +# ${ParaView_SOURCE_DIR}/Utilities/hdf5-1.8/hl/src) +# +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Basic HDF5 stuff here +#----------------------------------------------------------------------------- +SET (H5_VERS_MAJOR 1) +SET (H5_VERS_MINOR 9) +SET (H5_VERS_RELEASE 72) +#----------------------------------------------------------------------------- +SET (HDF5_PACKAGE "hdf5") +SET (HDF5_PACKAGE_NAME "HDF5") +SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") +SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") +SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") +SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION}") +SET (HDF5_PACKAGE_TARNAME "hdf5") +SET (HDF5_PACKAGE_URL "htt://www.hdfgroup.org") +SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") + +#----------------------------------------------------------------------------- +# Set the core names of all the libraries +#----------------------------------------------------------------------------- +SET (HDF5_LIB_CORENAME "hdf5") +SET (HDF5_TEST_LIB_CORENAME "hdf5_test") +SET (HDF5_CPP_LIB_CORENAME "hdf5_cpp") +SET (HDF5_HL_LIB_CORENAME "hdf5_hl") +SET (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") +SET (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") +SET (HDF5_F90_LIB_CORENAME "hdf5_fortran") +SET (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") +SET (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") +SET (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") +SET (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") +SET (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") + +#----------------------------------------------------------------------------- +# Set the true names of all the libraries if customized by external project +#----------------------------------------------------------------------------- +SET (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}") +SET (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}") +SET (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}") +SET (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}") +SET (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}") +SET (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}") +SET (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}") +SET (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}") +SET (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}") +SET (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}") +SET (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}") +SET (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}") + +#----------------------------------------------------------------------------- +# Define some CMake variables for use later in the project +#----------------------------------------------------------------------------- +SET (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/Resources) +SET (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) +SET (HDF5_TEST_SOURCE_DIR ${HDF5_SOURCE_DIR}/test) +SET (HDF5_CPP_SOURCE_DIR ${HDF5_SOURCE_DIR}/c++) +SET (HDF5_CPP_TEST_DIR ${HDF5_CPP_SOURCE_DIR}/test) +SET (HDF5_HL_SOURCE_DIR ${HDF5_SOURCE_DIR}/hl) +SET (HDF5_TOOLS_SOURCE_DIR ${HDF5_SOURCE_DIR}/tools) +SET (HDF5_PERFORM_SOURCE_DIR ${HDF5_SOURCE_DIR}/perform) +SET (HDF5_F90_SOURCE_DIR ${HDF5_SOURCE_DIR}/fortran) + +#----------------------------------------------------------------------------- +# Include some macros for reusable code +#----------------------------------------------------------------------------- +INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) + +#----------------------------------------------------------------------------- +# Setup output Directories +#----------------------------------------------------------------------------- +IF (NOT HDF5_EXTERNALLY_CONFIGURED) + SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." + ) + SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" + ) + SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." + ) + SET (CMAKE_Fortran_MODULE_DIRECTORY + ${PROJECT_BINARY_DIR}/bin/fortran CACHE PATH "Single Directory for all fortran modules." + ) +ELSE (NOT HDF5_EXTERNALLY_CONFIGURED) + # if we are externally configured, but the project uses old cmake scripts + # this may not be set and utilities like H5detect will fail + IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) + ENDIF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) +ENDIF(NOT HDF5_EXTERNALLY_CONFIGURED) + +#----------------------------------------------------------------------------- +# Targets built within this project are exported at Install time for use +# by other projects using FindHDF5. +#----------------------------------------------------------------------------- +IF (NOT HDF5_EXPORTED_TARGETS) + SET (HDF5_EXPORTED_TARGETS "hdf5-targets") +ENDIF (NOT HDF5_EXPORTED_TARGETS) + +#----------------------------------------------------------------------------- +# To include a library in the list exported by the project AT BUILD TIME, +# add it to this variable. This is NOT used by Make Install, but for projects +# which include hdf5 as a sub-project within their build tree +#----------------------------------------------------------------------------- +SET_GLOBAL_VARIABLE(HDF5_LIBRARIES_TO_EXPORT "") + +#----------------------------------------------------------------------------- +# Run all the CMake configuration tests for our build environment +#----------------------------------------------------------------------------- +INCLUDE (${HDF5_SOURCE_DIR}/ConfigureChecks.cmake) + +#----------------------------------------------------------------------------- +# Option to use legacy naming for windows libs/programs, default is legacy +#----------------------------------------------------------------------------- +IF (WIN32) + OPTION (H5_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" ON) +ENDIF (WIN32) + +#----------------------------------------------------------------------------- +# Option to Build Shared/Static libs, default is static +#----------------------------------------------------------------------------- +OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +SET (LIB_TYPE STATIC) +IF (BUILD_SHARED_LIBS) + SET (LIB_TYPE SHARED) + SET (H5_BUILT_AS_DYNAMIC_LIB 1) + IF (MSVC) + SET (CMAKE_MFC_FLAG 0) + FOREACH (flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/MT") + STRING (REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/MT") + ENDFOREACH (flag_var) + ENDIF (MSVC) +ELSE (BUILD_SHARED_LIBS) + IF (NOT WIN32) + # should this be a user setting : Everyone uses it anyway ? + ADD_DEFINITIONS(-DPIC) + ENDIF (NOT WIN32) + IF (MSVC) + SET (CMAKE_MFC_FLAG 0) + FOREACH (flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/MD") + STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/MD") + ENDFOREACH (flag_var) + ENDIF (MSVC) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Option to use code coverage +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) +IF (HDF5_ENABLE_COVERAGE) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + SET (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") +ENDIF (HDF5_ENABLE_COVERAGE) + +#----------------------------------------------------------------------------- +# Set the target names of all the libraries +#----------------------------------------------------------------------------- +SET (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME}) +SET (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME}) +SET (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME}) +SET (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME}) +SET (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME}) +SET (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME}) +SET (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME}) +SET (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME}) +SET (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME}) +SET (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME}) +SET (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME}) +SET (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME}) + +#----------------------------------------------------------------------------- +# When building utility executables that generate other (source) files : +# we make use of the following variables defined in the root CMakeLists. +# Certain systems may add /Debug or /Release to output paths +# and we need to call the executable from inside the CMake configuration +#----------------------------------------------------------------------------- +SET (EXE_EXT "") +IF (WIN32) + SET (EXE_EXT ".exe") + ADD_DEFINITIONS (-DBIND_TO_CURRENT_VCLIBS_VERSION=1) + ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) +ENDIF (WIN32) + +SET (MAKE_SYSTEM) +IF (CMAKE_BUILD_TOOL MATCHES "make") + SET (MAKE_SYSTEM 1) +ENDIF (CMAKE_BUILD_TOOL MATCHES "make") + +SET (CFG_INIT "/${CMAKE_CFG_INTDIR}") +IF (MAKE_SYSTEM) + SET (CFG_INIT "") +ENDIF (MAKE_SYSTEM) + +#----------------------------------------------------------------------------- +# Add some definitions for Debug Builds +#----------------------------------------------------------------------------- +IF (CMAKE_BUILD_TYPE MATCHES Debug) + ADD_DEFINITIONS (-DDEBUG) + ADD_DEFINITIONS ( + -DH5_DEBUG_API -DH5Z_DEBUG -DH5V_DEBUG -DH5T_DEBUG + -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG + -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG + -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG + ) + #-- NMake Makefiles will overwhelm the console with warnings if -Wall is used. + IF (NOT WIN32) + ADD_DEFINITIONS (-Wall) + ENDIF (NOT WIN32) +ELSE (CMAKE_BUILD_TYPE MATCHES Debug) + ADD_DEFINITIONS (-UH5_DEBUG_API -DNDEBUG) +ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) + +#----------------------------------------------------------------------------- +# Compiler specific flags : Shouldn't there be compiler tests for these +#----------------------------------------------------------------------------- +IF (CMAKE_COMPILER_IS_GNUCC) + SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") +ENDIF (CMAKE_COMPILER_IS_GNUCC) + +#----------------------------------------------------------------------------- +# Option to allow the user to disable compiler warnings +#----------------------------------------------------------------------------- +OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) +IF (HDF5_DISABLE_COMPILER_WARNINGS) + # MSVC uses /w to suppress warnings. It also complains if another + # warning level is given, so remove it. + IF (MSVC) + SET (HDF5_WARNINGS_BLOCKED 1) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " + CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + ENDIF (MSVC) + IF(WIN32) + ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) + ENDIF(WIN32) + # Borland uses -w- to suppress warnings. + IF (BORLAND) + SET (HDF5_WARNINGS_BLOCKED 1) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") + ENDIF (BORLAND) + + # Most compilers use -w to suppress warnings. + IF (NOT HDF5_WARNINGS_BLOCKED) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + ENDIF (NOT HDF5_WARNINGS_BLOCKED) +ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) + +#----------------------------------------------------------------------------- +# This is in here to help some of the GCC based IDES like Eclipse +# and code blocks parse the compiler errors and warnings better. +#----------------------------------------------------------------------------- +IF (CMAKE_COMPILER_IS_GNUCC) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") +ENDIF (CMAKE_COMPILER_IS_GNUCC) +IF (CMAKE_COMPILER_IS_GNUCXX) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") +ENDIF (CMAKE_COMPILER_IS_GNUCXX) + +#----------------------------------------------------------------------------- +# All libs/tests/examples need the main include directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR}) + +#----------------------------------------------------------------------------- +# Option to Enable MPI Parallel +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) +IF (HDF5_ENABLE_PARALLEL) + INCLUDE (FindMPI) + INCLUDE_DIRECTORIES (${MPI_INCLUDE_PATH}) + IF (MPI_FOUND) + SET (H5_HAVE_PARALLEL 1) + # MPI checks, only do these if MPI_FOUND is true, otherwise they always fail + # and once set, they are cached as false and not regenerated + SET (CMAKE_REQUIRED_INCLUDES "${MPI_INCLUDE_PATH}/mpi.h" ) + SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY}" ) + CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) + # Used by Fortran + MPI + CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) + CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + ENDIF (MPI_FOUND) +ENDIF (HDF5_ENABLE_PARALLEL) + +# Parallel IO usage requires MPI to be Linked and Included +IF (H5_HAVE_PARALLEL) + SET (LINK_LIBS ${LINK_LIBS} ${MPI_LIBRARY}) + IF (MPI_LINK_FLAGS) + SET (CMAKE_EXE_LINKER_FLAGS ${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) + ENDIF (MPI_LINK_FLAGS) + IF (MPI_EXTRA_LIBRARY) + SET (LINK_LIBS ${LINK_LIBS} ${MPI_EXTRA_LIBRARY}) + ENDIF (MPI_EXTRA_LIBRARY) +ENDIF (H5_HAVE_PARALLEL) + +#----------------------------------------------------------------------------- +# Option to use 1.6.x API +#----------------------------------------------------------------------------- +OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) +SET (USE_16_API_DEFAULT 0) +IF (HDF5_USE_16_API_DEFAULT) + SET (H5_USE_16_API_DEFAULT 1) +ENDIF (HDF5_USE_16_API_DEFAULT) + +#----------------------------------------------------------------------------- +# Options for HDF5 Filters +#----------------------------------------------------------------------------- +MACRO (HDF5_SETUP_FILTERS FILTER) + OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) + IF (HDF5_USE_FILTER_${FILTER}) + SET (H5_HAVE_FILTER_${FILTER} 1) + ENDIF (HDF5_USE_FILTER_${FILTER}) + # MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") +ENDMACRO (HDF5_SETUP_FILTERS) + +HDF5_SETUP_FILTERS (SHUFFLE) +HDF5_SETUP_FILTERS (FLETCHER32) +HDF5_SETUP_FILTERS (NBIT) +HDF5_SETUP_FILTERS (SCALEOFFSET) + +#----------------------------------------------------------------------------- +# Option for ZLib support +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF) +IF (HDF5_ENABLE_Z_LIB_SUPPORT) + IF (NOT H5_ZLIB_HEADER) + FIND_PACKAGE (ZLIB REQUIRED) + IF (ZLIB_FOUND) + SET (H5_HAVE_FILTER_DEFLATE 1) + SET (H5_HAVE_ZLIB_H 1) + SET (H5_HAVE_LIBZ 1) + SET (H5_ZLIB_HEADER "zlib.h") + ELSE (ZLIB_FOUND) + MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5") + ENDIF (ZLIB_FOUND) + ELSE (NOT H5_ZLIB_HEADER) + # This project is being called from within another and ZLib is already configured + SET (H5_HAVE_FILTER_DEFLATE 1) + SET (H5_HAVE_ZLIB_H 1) + SET (H5_HAVE_LIBZ 1) + ENDIF (NOT H5_ZLIB_HEADER) + CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/hdf5_zlib.h.in ${HDF5_BINARY_DIR}/hdf5_zlib.h @ONLY) + SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) + INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) + MESSAGE (STATUS "Filter ZLIB is ON") +ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT) + +#----------------------------------------------------------------------------- +# Option for SzLib support +#----------------------------------------------------------------------------- +SET (CMAKE_MODULE_PATH ${HDF5_SOURCE_DIR}/Resources/CMake ${CMAKE_MODULE_PATH}) +OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) +IF (HDF5_ENABLE_SZIP_SUPPORT) + FIND_PACKAGE (SZIP REQUIRED) + IF (SZIP_FOUND) + SET (H5_HAVE_FILTER_SZIP 1) + SET (H5_HAVE_SZLIB_H 1) + SET (H5_HAVE_LIBSZ 1) + SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) + INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) +# MESSAGE (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") +# MESSAGE (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") + MESSAGE (STATUS "Filter SZIP is ON") + OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) + IF (HDF5_ENABLE_SZIP_ENCODING) + SET (H5_HAVE_SZIP_ENCODER 1) + ENDIF (HDF5_ENABLE_SZIP_ENCODING) + ELSE (SZIP_FOUND) + MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") + ENDIF (SZIP_FOUND) +ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + +#----------------------------------------------------------------------------- +# Option to use PACKED BITS SUPPORT +#----------------------------------------------------------------------------- +OPTION (HDF5_USE_H5DUMP_PACKED_BITS "Use the PACKED BITS feature in h5dump" OFF) +SET (H5_HAVE_H5DUMP_PACKED_BITS 0) +IF (HDF5_USE_H5DUMP_PACKED_BITS) + SET (H5_HAVE_H5DUMP_PACKED_BITS 1) +ENDIF (HDF5_USE_H5DUMP_PACKED_BITS) + +#----------------------------------------------------------------------------- +# Add the HDF5 Library Target to the build +#----------------------------------------------------------------------------- +ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# Build utility to copy and strip X lines of file +#----------------------------------------------------------------------------- +IF (HDF5_BUILD_TOOLS AND BUILD_TESTING) + SET (XLATE_UTILITY "xlatefile") + ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_SOURCE_DIR}/Resources/xlatefile.c) +ENDIF (HDF5_BUILD_TOOLS AND BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Dashboard and Testing Settings +#----------------------------------------------------------------------------- +OPTION (BUILD_TESTING "Build HDF5 Unit Testing" OFF) +IF (BUILD_TESTING) + SET (DART_TESTING_TIMEOUT 1200 CACHE INTEGER + "Timeout in seconds for each test (default 1200=20minutes)") + ENABLE_TESTING () + INCLUDE (CTest) + IF (NOT HDF5_EXTERNALLY_CONFIGURED) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) + ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Option to build Fortran bindings/tests/examples +# Make sure this appears before the CONFIGURE_FILE step +# so that fortran name mangling is detected before writing H5pubconf.h +#----------------------------------------------------------------------------- +OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) +IF (HDF5_BUILD_FORTRAN) + # Set default name mangling : overridden by Fortran detection in fortran dir + SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") + SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) +ELSE (HDF5_BUILD_FORTRAN) + SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") + SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") +ENDIF (HDF5_BUILD_FORTRAN) + +#----------------------------------------------------------------------------- +# Option to build examples +#----------------------------------------------------------------------------- +OPTION (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +#----------------------------------------------------------------------------- +# Option to build HDF5 C++ Library +#----------------------------------------------------------------------------- +OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) +IF (HDF5_BUILD_CPP_LIB) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) +ENDIF (HDF5_BUILD_CPP_LIB) + +#----------------------------------------------------------------------------- +# Option to build HDF5 Tools +#----------------------------------------------------------------------------- +OPTION (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) +IF (HDF5_BUILD_TOOLS) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) +ENDIF (HDF5_BUILD_TOOLS) + +#----------------------------------------------------------------------------- +# Option to build High Level API's +#----------------------------------------------------------------------------- +OPTION (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) +IF (HDF5_BUILD_HL_LIB) + SET (H5_INCLUDE_HL 1) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) +ENDIF (HDF5_BUILD_HL_LIB) + +#----------------------------------------------------------------------------- +# Generate the H5pubconf.h file containing user settings needed by compilation +#----------------------------------------------------------------------------- +CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${PROJECT_BINARY_DIR}/H5pubconf.h + DESTINATION + include + COMPONENT + headers +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +INSTALL ( + EXPORT + ${HDF5_EXPORTED_TARGETS} + DESTINATION + lib + FILE + HDF5-targets.cmake +) + +#----------------------------------------------------------------------------- +# Export all exported targets to the build tree for use by parent project +#----------------------------------------------------------------------------- +EXPORT ( + TARGETS + ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} + FILE + HDF5-targets.cmake +) + +#----------------------------------------------------------------------------- +# Configure the HDF5-config.cmake file for the build directory +#----------------------------------------------------------------------------- +SET (HDF5_INCLUDES_BUILD_TIME + ${HDF5_SRC_DIR} ${HDF5_CPP_SOURCE_DIR} ${HDF5_HL_SOURCE_DIR} + ${HDF5_TOOLS_SOURCE_DIR} ${HDF5_BINARY_DIR} +) +SET (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) +SET (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) +SET (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) + +CONFIGURE_FILE ( + ${HDF5_SOURCE_DIR}/Resources/HDF5-config.cmake.build.in + ${HDF5_BINARY_DIR}/HDF5-config.cmake @ONLY +) + +#----------------------------------------------------------------------------- +# Configure the HDF5-config.cmake file for the install directory +#----------------------------------------------------------------------------- +INSTALL (CODE + "SET (HDF5_INSTALL_SKIP_TARGETS 1) + INCLUDE (${HDF5_BINARY_DIR}/HDF5-config.cmake) + CONFIGURE_FILE ( + \"${HDF5_SOURCE_DIR}/Resources/HDF5-config.cmake.install.in\" + \"${CMAKE_INSTALL_PREFIX}/lib/HDF5-config.cmake\" @ONLY + ) + " +) + +#----------------------------------------------------------------------------- +# Set the cpack variables +#----------------------------------------------------------------------------- +SET (CPACK_PACKAGE_VENDOR "The HDF Group") +SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") +SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") +SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") +SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") +SET (CPACK_PACKAGE_VERSION_PATCH "") +SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") + +IF (WIN32) + SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}") +ENDIF (WIN32) + +INCLUDE (CPack) + +#----------------------------------------------------------------------------- +# Now list the cpack commands +#----------------------------------------------------------------------------- +CPACK_ADD_COMPONENT (applications + DISPLAY_NAME "HDF5 Applications" + DEPENDS libraries + GROUP Applications +) +CPACK_ADD_COMPONENT (libraries + DISPLAY_NAME "HDF5 Libraries" + GROUP Runtime +) +CPACK_ADD_COMPONENT (headers + DISPLAY_NAME "HDF5 Headers" + DEPENDS libraries + GROUP Development +) + +IF (HDF5_BUILD_FORTRAN) + CPACK_ADD_COMPONENT (fortlibraries + DISPLAY_NAME "HDF5 Fortran Libraries" + DEPENDS libraries + GROUP Runtime + ) + CPACK_ADD_COMPONENT (fortheaders + DISPLAY_NAME "HDF5 Fortran Headers" + DEPENDS fortlibraries + GROUP Development + ) +ENDIF (HDF5_BUILD_FORTRAN) + +IF (HDF5_BUILD_CPP_LIB) + CPACK_ADD_COMPONENT (cpplibraries + DISPLAY_NAME "HDF5 C++ Libraries" + DEPENDS libraries + GROUP Runtime + ) + CPACK_ADD_COMPONENT (cppheaders + DISPLAY_NAME "HDF5 C++ Headers" + DEPENDS cpplibraries + GROUP Development + ) +ENDIF (HDF5_BUILD_CPP_LIB) + +IF (HDF5_BUILD_TOOLS) + CPACK_ADD_COMPONENT (toolsapplications + DISPLAY_NAME "HDF5 Tools Applications" + DEPENDS toolslibraries + GROUP Applications + ) + CPACK_ADD_COMPONENT (toolslibraries + DISPLAY_NAME "HDF5 Tools Libraries" + DEPENDS libraries + GROUP Runtime + ) + CPACK_ADD_COMPONENT (toolsheaders + DISPLAY_NAME "HDF5 Tools Headers" + DEPENDS toolslibraries + GROUP Development + ) +ENDIF (HDF5_BUILD_TOOLS) + +IF (HDF5_BUILD_HL_LIB) + CPACK_ADD_COMPONENT (hllibraries + DISPLAY_NAME "HDF5 HL Libraries" + DEPENDS libraries + GROUP Runtime + ) + CPACK_ADD_COMPONENT (hlheaders + DISPLAY_NAME "HDF5 HL Headers" + DEPENDS hllibraries + GROUP Development + ) + CPACK_ADD_COMPONENT (hltoolsapplications + DISPLAY_NAME "HDF5 HL Tools Applications" + DEPENDS hllibraries + GROUP Applications + ) + CPACK_ADD_COMPONENT (hlcpplibraries + DISPLAY_NAME "HDF5 HL C++ Libraries" + DEPENDS hllibraries + GROUP Runtime + ) + CPACK_ADD_COMPONENT (hlcppheaders + DISPLAY_NAME "HDF5 HL C++ Headers" + DEPENDS hlcpplibraries + GROUP Development + ) + CPACK_ADD_COMPONENT (hlfortlibraries + DISPLAY_NAME "HDF5 HL Fortran Libraries" + DEPENDS fortlibraries + GROUP Runtime + ) +ENDIF (HDF5_BUILD_HL_LIB) diff --git a/COPYING b/COPYING index db75e16..3b7a8e2 100644 --- a/COPYING +++ b/COPYING @@ -54,6 +54,12 @@ and Digital Equipment Corporation (DEC). ----------------------------------------------------------------------------- +Portions of HDF5 were developed with support from the Lawrence Berkeley +National Laboratory (LBNL) and the United States Department of Energy +under Prime Contract No. DE-AC02-05CH11231. + +----------------------------------------------------------------------------- + Portions of HDF5 were developed with support from the University of California, Lawrence Livermore National Laboratory (UC LLNL). The following statement applies to those portions of the product and must diff --git a/CTestConfig.cmake b/CTestConfig.cmake new file mode 100644 index 0000000..f2f45e1 --- /dev/null +++ b/CTestConfig.cmake @@ -0,0 +1,13 @@ +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## # The following are required to uses Dart and the Cdash dashboard +## ENABLE_TESTING() +## INCLUDE(CTest) +set(CTEST_PROJECT_NAME "HDF5 Trunk") +set(CTEST_NIGHTLY_START_TIME "20:00:00 CST") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "nei.hdfgroup.uiuc.edu") +set(CTEST_DROP_LOCATION "/cdash/submit.php?project=HDF5+Trunk") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..27fb1a8 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,790 @@ +#----------------------------------------------------------------------------- +# Include all the necessary files for macros +#----------------------------------------------------------------------------- +INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) + +MESSAGE (STATUS "Configure Checks that still need to be implemented") +MESSAGE (STATUS " GetConsoleScreenBufferInfo function for Windows") + +#----------------------------------------------------------------------------- +# Always SET this for now IF we are on an OS X box +#----------------------------------------------------------------------------- +IF (APPLE) + SET (H5_AC_APPLE_UNIVERSAL_BUILD 1) +ENDIF (APPLE) + +#----------------------------------------------------------------------------- +# Option to Clear File Buffers before write --enable-clear-file-buffers +#----------------------------------------------------------------------------- +OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) +IF (HDF5_Enable_Clear_File_Buffers) + SET (H5_CLEAR_MEMORY 1) +ENDIF (HDF5_Enable_Clear_File_Buffers) + +#----------------------------------------------------------------------------- +# Option for --enable-instrument +#----------------------------------------------------------------------------- +IF (CMAKE_BUILD_TYPE MATCHES Debug) + SET (HDF5_Enable_Instrument ON) +ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) +OPTION (HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument) +IF (HDF5_Enable_Instrument) + SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) +ENDIF (HDF5_Enable_Instrument) + +#----------------------------------------------------------------------------- +# Option for --enable-strict-format-checks +#----------------------------------------------------------------------------- +OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) +IF (HDF5_STRICT_FORMAT_CHECKS) + SET (H5_STRICT_FORMAT_CHECKS 1) +ENDIF (HDF5_STRICT_FORMAT_CHECKS) + +#----------------------------------------------------------------------------- +# Option for --enable-metadata-trace-file +#----------------------------------------------------------------------------- +OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) +IF (HDF5_METADATA_TRACE_FILE) + SET (H5_METADATA_TRACE_FILE 1) +ENDIF (HDF5_METADATA_TRACE_FILE) + +# ---------------------------------------------------------------------- +# Decide whether the data accuracy has higher priority during data +# conversions. If not, some hard conversions will still be prefered even +# though the data may be wrong (for example, some compilers don't +# support denormalized floating values) to maximize speed. +# +OPTION (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) +IF (HDF5_WANT_DATA_ACCURACY) + SET (H5_WANT_DATA_ACCURACY 1) +ENDIF(HDF5_WANT_DATA_ACCURACY) + +# ---------------------------------------------------------------------- +# Decide whether the presence of user's exception handling functions is +# checked and data conversion exceptions are returned. This is mainly +# for the speed optimization of hard conversions. Soft conversions can +# actually benefit little. +# +OPTION (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) +IF (HDF5_WANT_DCONV_EXCEPTION) + SET (H5_WANT_DCONV_EXCEPTION 1) +ENDIF (HDF5_WANT_DCONV_EXCEPTION) + +SET (LINUX_LFS 0) +SET (HDF5_EXTRA_FLAGS) +IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") + # Linux Specific flags + ADD_DEFINITIONS (-D_POSIX_SOURCE -D_BSD_SOURCE) + OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + IF (HDF5_ENABLE_LARGE_FILE) + SET (LARGEFILE 1) + SET (HDF5_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + SET (CMAKE_REQUIRED_DEFINITIONS ${HDF5_EXTRA_FLAGS}) + ENDIF (HDF5_ENABLE_LARGE_FILE) +ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") +IF (LINUX_LFS) + SET (HDF5_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + SET (CMAKE_REQUIRED_DEFINITIONS ${HDF5_EXTRA_FLAGS}) +ENDIF (LINUX_LFS) +ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) + +#IF (WIN32) +# SET (DEFAULT_STREAM_VFD OFF) +#ELSE (WIN32) +# SET (DEFAULT_STREAM_VFD ON) +#ENDIF (WIN32) +#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) +OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) + +SET (WINDOWS) +IF (WIN32) + IF (NOT UNIX) + SET (WINDOWS 1) + ENDIF (NOT UNIX) +ENDIF (WIN32) + +# TODO -------------------------------------------------------------------------- +# Should the Default Virtual File Driver be compiled? +# This is hard-coded now but option should added to match configure +# +IF (WINDOWS) + SET (H5_HAVE_WINDOWS 1) +# SET (H5_WINDOWS_USE_STDIO 0) + # ---------------------------------------------------------------------- + # Set the flag to indicate that the machine has window style pathname, + # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). + # (This flag should be _unset_ for all machines, except for Windows) + # + SET (H5_HAVE_WINDOW_PATH 1) + SET (WINDOWS_MAX_BUF (1024 * 1024 * 1024)) + SET (H5_DEFAULT_VFD H5FD_WINDOWS) +ELSE (WINDOWS) + SET (H5_DEFAULT_VFD H5FD_SEC2) +ENDIF (WINDOWS) + +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can handle converting +# floating-point to long long values. +# (This flag should be _unset_ for all machines) +# +# SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0) + +# so far we have no check for this +SET(H5_HAVE_TMPFILE 1) + +#----------------------------------------------------------------------------- +# This MACRO checks IF the symbol exists in the library and IF it +# does, it appends library to the list. +#----------------------------------------------------------------------------- +SET (LINK_LIBS "") +MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) + CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) + IF (${VARIABLE}) + SET (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) + ENDIF (${VARIABLE}) +ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) + +#----------------------------------------------------------------------------- +# Check for the math library "m" +#----------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_HAVE_LIBM 1) +ELSE (WINDOWS) + CHECK_LIBRARY_EXISTS_CONCAT ("m" printf H5_HAVE_LIBM) +ENDIF (WINDOWS) +CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" printf H5_HAVE_LIBWS2_32) +CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" printf H5_HAVE_LIBWSOCK32) +#CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) +CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB) +CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET) +CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) + + +IF (NOT NOT_NEED_LIBNSL) + CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) +ENDIF (NOT NOT_NEED_LIBNSL) + + +SET (USE_INCLUDES "") +#----------------------------------------------------------------------------- +# Check IF header file exists and add it to the list. +#----------------------------------------------------------------------------- +MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) + CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) + IF (${VARIABLE}) + SET (USE_INCLUDES ${USE_INCLUDES} ${FILE}) + ENDIF (${VARIABLE}) +ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) + +#----------------------------------------------------------------------------- +# If we are on Windows we know some of the answers to these tests already +#----------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_HAVE_IO_H 1) + SET (H5_HAVE_SETJMP_H 1) + SET (H5_HAVE_STDDEF_H 1) + SET (H5_HAVE_SYS_STAT_H 1) + SET (H5_HAVE_SYS_TIMEB_H 1) + SET (H5_HAVE_SYS_TYPES_H 1) + SET (H5_HAVE_WINSOCK_H 1) +ENDIF (WINDOWS) + +#----------------------------------------------------------------------------- +# Check for the existence of certain header files +#----------------------------------------------------------------------------- +CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) +CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) +CHECK_INCLUDE_FILE_CONCAT ("mfhdf.h" H5_HAVE_MFHDF_H) +CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) +CHECK_INCLUDE_FILE_CONCAT ("pthread.h" H5_HAVE_PTHREAD_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) +CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" H5_HAVE_SRBCLIENT_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) +CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) +CHECK_INCLUDE_FILE_CONCAT ("string.h" H5_HAVE_STRING_H) +CHECK_INCLUDE_FILE_CONCAT ("strings.h" H5_HAVE_STRINGS_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" H5_HAVE_SYS_IOCTL_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" H5_HAVE_SYS_RESOURCE_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" H5_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" H5_HAVE_SYS_STAT_H) +IF (CMAKE_SYSTEM_NAME MATCHES "OSF") + CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) +ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") + SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) +ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") +CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" H5_HAVE_SYS_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("unistd.h" H5_HAVE_UNISTD_H) +CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) +CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) +CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) +CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) +CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) + + +# IF the c compiler found stdint, check the C++ as well. On some systems this +# file will be found by C but not C++, only do this test IF the C++ compiler +# has been initialized (e.g. the project also includes some c++) +IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + CHECK_INCLUDE_FILE_CXX ("stdint.h" H5_HAVE_STDINT_H_CXX) + IF (NOT H5_HAVE_STDINT_H_CXX) + SET (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + ENDIF (NOT H5_HAVE_STDINT_H_CXX) +ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + +#----------------------------------------------------------------------------- +# Check the size in bytes of all the int and float types +#----------------------------------------------------------------------------- +MACRO (H5_CHECK_TYPE_SIZE type var) + SET (aType ${type}) + SET (aVar ${var}) +# MESSAGE (STATUS "Checking size of ${aType} and storing into ${aVar}") + CHECK_TYPE_SIZE (${aType} ${aVar}) + IF (NOT ${aVar}) + SET (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") +# MESSAGE (STATUS "Size of ${aType} was NOT Found") + ENDIF (NOT ${aVar}) +ENDMACRO (H5_CHECK_TYPE_SIZE) + + + +H5_CHECK_TYPE_SIZE (char H5_SIZEOF_CHAR) +H5_CHECK_TYPE_SIZE (short H5_SIZEOF_SHORT) +H5_CHECK_TYPE_SIZE (int H5_SIZEOF_INT) +H5_CHECK_TYPE_SIZE (unsigned H5_SIZEOF_UNSIGNED) +IF (NOT APPLE) + H5_CHECK_TYPE_SIZE (long H5_SIZEOF_LONG) +ENDIF (NOT APPLE) +H5_CHECK_TYPE_SIZE ("long long" H5_SIZEOF_LONG_LONG) +H5_CHECK_TYPE_SIZE (__int64 H5_SIZEOF___INT64) +IF (NOT H5_SIZEOF___INT64) + SET (H5_SIZEOF___INT64 0) +ENDIF (NOT H5_SIZEOF___INT64) + +H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) +H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) +H5_CHECK_TYPE_SIZE ("long double" H5_SIZEOF_LONG_DOUBLE) +H5_CHECK_TYPE_SIZE (int8_t H5_SIZEOF_INT8_T) +H5_CHECK_TYPE_SIZE (uint8_t H5_SIZEOF_UINT8_T) +H5_CHECK_TYPE_SIZE (int_least8_t H5_SIZEOF_INT_LEAST8_T) +H5_CHECK_TYPE_SIZE (uint_least8_t H5_SIZEOF_UINT_LEAST8_T) +H5_CHECK_TYPE_SIZE (int_fast8_t H5_SIZEOF_INT_FAST8_T) +H5_CHECK_TYPE_SIZE (uint_fast8_t H5_SIZEOF_UINT_FAST8_T) +H5_CHECK_TYPE_SIZE (int16_t H5_SIZEOF_INT16_T) +H5_CHECK_TYPE_SIZE (uint16_t H5_SIZEOF_UINT16_T) +H5_CHECK_TYPE_SIZE (int_least16_t H5_SIZEOF_INT_LEAST16_T) +H5_CHECK_TYPE_SIZE (uint_least16_t H5_SIZEOF_UINT_LEAST16_T) +H5_CHECK_TYPE_SIZE (int_fast16_t H5_SIZEOF_INT_FAST16_T) +H5_CHECK_TYPE_SIZE (uint_fast16_t H5_SIZEOF_UINT_FAST16_T) +H5_CHECK_TYPE_SIZE (int32_t H5_SIZEOF_INT32_T) +H5_CHECK_TYPE_SIZE (uint32_t H5_SIZEOF_UINT32_T) +H5_CHECK_TYPE_SIZE (int_least32_t H5_SIZEOF_INT_LEAST32_T) +H5_CHECK_TYPE_SIZE (uint_least32_t H5_SIZEOF_UINT_LEAST32_T) +H5_CHECK_TYPE_SIZE (int_fast32_t H5_SIZEOF_INT_FAST32_T) +H5_CHECK_TYPE_SIZE (uint_fast32_t H5_SIZEOF_UINT_FAST32_T) +H5_CHECK_TYPE_SIZE (int64_t H5_SIZEOF_INT64_T) +H5_CHECK_TYPE_SIZE (uint64_t H5_SIZEOF_UINT64_T) +H5_CHECK_TYPE_SIZE (int_least64_t H5_SIZEOF_INT_LEAST64_T) +H5_CHECK_TYPE_SIZE (uint_least64_t H5_SIZEOF_UINT_LEAST64_T) +H5_CHECK_TYPE_SIZE (int_fast64_t H5_SIZEOF_INT_FAST64_T) +H5_CHECK_TYPE_SIZE (uint_fast64_t H5_SIZEOF_UINT_FAST64_T) +IF (NOT APPLE) + H5_CHECK_TYPE_SIZE (size_t H5_SIZEOF_SIZE_T) + H5_CHECK_TYPE_SIZE (ssize_t H5_SIZEOF_SSIZE_T) + IF (NOT H5_SIZEOF_SSIZE_T) + SET (H5_SIZEOF_SSIZE_T 0) + ENDIF (NOT H5_SIZEOF_SSIZE_T) +ENDIF (NOT APPLE) +H5_CHECK_TYPE_SIZE (off_t H5_SIZEOF_OFF_T) +H5_CHECK_TYPE_SIZE (off64_t H5_SIZEOF_OFF64_T) +IF (NOT H5_SIZEOF_OFF64_T) + SET (H5_SIZEOF_OFF64_T 0) +ENDIF (NOT H5_SIZEOF_OFF64_T) + + +# For other tests to use the same libraries +SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) + +#----------------------------------------------------------------------------- +# Check for some functions that are used +IF (WINDOWS) + SET (H5_HAVE_STRDUP 1) + SET (H5_HAVE_SYSTEM 1) + SET (H5_HAVE_DIFFTIME 1) + SET (H5_HAVE_LONGJMP 1) + SET (H5_STDC_HEADERS 1) + SET (H5_HAVE_GETHOSTNAME 1) +ENDIF (WINDOWS) + +CHECK_FUNCTION_EXISTS (alarm H5_HAVE_ALARM) +CHECK_FUNCTION_EXISTS (fork H5_HAVE_FORK) +CHECK_FUNCTION_EXISTS (frexpf H5_HAVE_FREXPF) +CHECK_FUNCTION_EXISTS (frexpl H5_HAVE_FREXPL) + +CHECK_FUNCTION_EXISTS (gethostname H5_HAVE_GETHOSTNAME) +CHECK_FUNCTION_EXISTS (getpwuid H5_HAVE_GETPWUID) +CHECK_FUNCTION_EXISTS (getrusage H5_HAVE_GETRUSAGE) +CHECK_FUNCTION_EXISTS (lstat H5_HAVE_LSTAT) + +CHECK_FUNCTION_EXISTS (rand_r H5_HAVE_RAND_R) +CHECK_FUNCTION_EXISTS (random H5_HAVE_RANDOM) +CHECK_FUNCTION_EXISTS (setsysinfo H5_HAVE_SETSYSINFO) + +CHECK_FUNCTION_EXISTS (signal H5_HAVE_SIGNAL) +CHECK_FUNCTION_EXISTS (longjmp H5_HAVE_LONGJMP) +CHECK_FUNCTION_EXISTS (setjmp H5_HAVE_SETJMP) +CHECK_FUNCTION_EXISTS (siglongjmp H5_HAVE_SIGLONGJMP) +CHECK_FUNCTION_EXISTS (sigsetjmp H5_HAVE_SIGSETJMP) +CHECK_FUNCTION_EXISTS (sigaction H5_HAVE_SIGACTION) +CHECK_FUNCTION_EXISTS (sigprocmask H5_HAVE_SIGPROCMASK) + +CHECK_FUNCTION_EXISTS (snprintf H5_HAVE_SNPRINTF) +CHECK_FUNCTION_EXISTS (srandom H5_HAVE_SRANDOM) +CHECK_FUNCTION_EXISTS (strdup H5_HAVE_STRDUP) +CHECK_FUNCTION_EXISTS (symlink H5_HAVE_SYMLINK) +CHECK_FUNCTION_EXISTS (system H5_HAVE_SYSTEM) + +CHECK_FUNCTION_EXISTS (tmpfile H5_HAVE_TMPFILE) +CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) +CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) + +CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) +CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) +#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) +CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) +CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) +CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) +CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) +CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) + +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Since gettimeofday is not defined any where standard, lets look in all the +# usual places. On MSVC we are just going to use ::clock() +#----------------------------------------------------------------------------- +IF (NOT MSVC) + IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_SOURCE_DIR}/Resources/GetTimeOfDayTest.cpp + COMPILE_DEFINITIONS -DTRY_TIME_H + OUTPUT_VARIABLE OUTPUT + ) + IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") + ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + + IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_SOURCE_DIR}/Resources/GetTimeOfDayTest.cpp + COMPILE_DEFINITIONS -DTRY_SYS_TIME_H + OUTPUT_VARIABLE OUTPUT + ) + IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") + ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") +ENDIF (NOT MSVC) + +IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY AND NOT MSVC) + MESSAGE (STATUS "---------------------------------------------------------------") + MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") + MESSAGE (STATUS " own implementation.. This can happen on older versions of") + MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") + MESSAGE (STATUS " to a newer version such as MinGW 3.12") + MESSAGE (STATUS "---------------------------------------------------------------") +ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY AND NOT MSVC) + + +# Check for Symbols +CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) + +#----------------------------------------------------------------------------- +# +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) + CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) +ENDIF (NOT WINDOWS) + +#----------------------------------------------------------------------------- +# Check for the Stream VFD driver +#----------------------------------------------------------------------------- +IF (HDF5_STREAM_VFD) + CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) + CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) + SET (H5_HAVE_STREAM 1) +ENDIF (HDF5_STREAM_VFD) + + +# For other other specific tests, use this MACRO. +MACRO (HDF5_FUNCTION_TEST OTHER_TEST) + IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + SET (OTHER_TEST_ADD_LIBRARIES) + IF (CMAKE_REQUIRED_LIBRARIES) + SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + ENDIF (CMAKE_REQUIRED_LIBRARIES) + + FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + ENDFOREACH (def) + + FOREACH (def + H5_HAVE_SYS_TIME_H + H5_HAVE_UNISTD_H + H5_HAVE_SYS_TYPES_H + H5_HAVE_SYS_SOCKET_H + ) + IF ("${def}") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + ENDIF ("${def}") + ENDFOREACH (def) + + IF (LINUX_LFS) + SET (MACRO_CHECK_FUNCTION_DEFINITIONS + "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + ENDIF (LINUX_LFS) + + # (STATUS "Performing ${OTHER_TEST}") + TRY_COMPILE (${OTHER_TEST} + ${CMAKE_BINARY_DIR} + ${HDF5_SOURCE_DIR}/Resources/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${OTHER_TEST_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + IF (${OTHER_TEST}) + SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") + ELSE (${OTHER_TEST}) + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Performing Other Test ${OTHER_TEST} failed with the following output:\n" + "${OUTPUT}\n" + ) + ENDIF (${OTHER_TEST}) + ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") +ENDMACRO (HDF5_FUNCTION_TEST) + +#----------------------------------------------------------------------------- +# Check a bunch of other functions +#----------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_HAVE_TIMEZONE 1) + SET (H5_HAVE_FUNCTION 1) +ELSE (WINDOWS) + FOREACH (test + TIME_WITH_SYS_TIME + STDC_HEADERS + HAVE_TM_ZONE + HAVE_STRUCT_TM_TM_ZONE + HAVE_ATTRIBUTE + HAVE_FUNCTION + HAVE_TM_GMTOFF + HAVE_TIMEZONE + HAVE_STRUCT_TIMEZONE + HAVE_STAT_ST_BLOCKS + HAVE_FUNCTION + SYSTEM_SCOPE_THREADS + HAVE_SOCKLEN_T + DEV_T_IS_SCALAR + HAVE_OFF64_T + GETTIMEOFDAY_GIVES_TZ + VSNPRINTF_WORKS + HAVE_C99_FUNC + HAVE_C99_DESIGNATED_INITIALIZER + CXX_HAVE_OFFSETOF + ) + HDF5_FUNCTION_TEST (${test}) + ENDFOREACH (test) +ENDIF (WINDOWS) + +#----------------------------------------------------------------------------- +# Look for 64 bit file stream capability +#----------------------------------------------------------------------------- +IF (HAVE_OFF64_T) + CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) + CHECK_FUNCTION_EXISTS (fseek64 H5_HAVE_FSEEK64) +ENDIF (HAVE_OFF64_T) + +#----------------------------------------------------------------------------- +# Determine how 'inline' is used +#----------------------------------------------------------------------------- +SET (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) +FOREACH (inline_test inline __inline__ __inline) + SET (INLINE_TEST_INLINE ${inline_test}) + HDF5_FUNCTION_TEST (INLINE_TEST_${inline_test}) +ENDFOREACH (inline_test) + +SET (HDF5_EXTRA_TEST_DEFINITIONS) +IF (INLINE_TEST___inline__) + SET (H5_inline __inline__) +ELSE (INLINE_TEST___inline__) + IF (INLINE_TEST___inline) + SET (H5_inline __inline) + ELSE (INLINE_TEST___inline) + IF (INLINE_TEST_inline) + SET (H5_inline inline) + ENDIF (INLINE_TEST_inline) + ENDIF (INLINE_TEST___inline) +ENDIF (INLINE_TEST___inline__) + +#----------------------------------------------------------------------------- +# Check how to print a Long Long integer +#----------------------------------------------------------------------------- +SET (H5_H5_PRINTF_LL_WIDTH "H5_PRINTF_LL_WIDTH") +IF (H5_PRINTF_LL_WIDTH MATCHES "^H5_PRINTF_LL_WIDTH$") + SET (PRINT_LL_FOUND 0) + MESSAGE (STATUS "Checking for appropriate format for 64 bit long:") + FOREACH (HDF5_PRINTF_LL l64 l L q I64 ll) + SET (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") + IF (H5_SIZEOF_LONG_LONG) + SET (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") + ENDIF (H5_SIZEOF_LONG_LONG) + TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE + ${HDF5_BINARY_DIR}/CMake + ${HDF5_SOURCE_DIR}/Resources/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} + OUTPUT_VARIABLE OUTPUT + ) + IF (HDF5_PRINTF_LL_TEST_COMPILE) + IF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + SET (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") + SET (PRINT_LL_FOUND 1) + ELSE (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + MESSAGE ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") + ENDIF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + ELSE (HDF5_PRINTF_LL_TEST_COMPILE) + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test H5_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" + ) + ENDIF (HDF5_PRINTF_LL_TEST_COMPILE) + ENDFOREACH (HDF5_PRINTF_LL) + + IF (PRINT_LL_FOUND) + MESSAGE (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") + ELSE (PRINT_LL_FOUND) + MESSAGE (STATUS "Checking for apropriate format for 64 bit long: not found") + SET (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL + "Width for printf for type `long long' or `__int64', us. `ll" + ) + ENDIF (PRINT_LL_FOUND) +ENDIF (H5_PRINTF_LL_WIDTH MATCHES "^H5_PRINTF_LL_WIDTH$") + +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can handle converting +# denormalized floating-point values. +# (This flag should be set for all machines, except for the Crays, where +# the cache value is set in it's config file) +# +SET (H5_CONVERT_DENORMAL_FLOAT 1) + +#----------------------------------------------------------------------------- +# Are we going to use HSIZE_T +#----------------------------------------------------------------------------- +IF (HDF5_ENABLE_HSIZET) + SET (H5_HAVE_LARGE_HSIZET 1) +ENDIF (HDF5_ENABLE_HSIZET) +IF (CYGWIN) + SET (H5_HAVE_LSEEK64 0) +ENDIF (CYGWIN) + +#----------------------------------------------------------------------------- +# Macro to determine the various conversion capabilities +#----------------------------------------------------------------------------- +MACRO (H5ConversionTests TEST msg) + IF ("${TEST}" MATCHES "^${TEST}$") + # MESSAGE (STATUS "===> ${TEST}") + TRY_RUN (${TEST}_RUN ${TEST}_COMPILE + ${HDF5_BINARY_DIR}/CMake + ${HDF5_SOURCE_DIR}/Resources/ConversionTests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-D${TEST}_TEST + OUTPUT_VARIABLE OUTPUT + ) + IF (${TEST}_COMPILE) + IF (${TEST}_RUN MATCHES 0) + SET (${TEST} 1 CACHE INTERNAL ${msg}) + MESSAGE(STATUS "${msg}... yes") + ELSE (${TEST}_RUN MATCHES 0) + SET (${TEST} "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" + ) + ENDIF (${TEST}_RUN MATCHES 0) + ELSE (${TEST}_COMPILE ) + SET (${TEST} "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" + ) + ENDIF (${TEST}_COMPILE) + + ENDIF("${TEST}" MATCHES "^${TEST}$") +ENDMACRO (H5ConversionTests) + +#----------------------------------------------------------------------------- +# Macro to make some of the conversion tests easier to write/read +#----------------------------------------------------------------------------- +MACRO (H5MiscConversionTest VAR TEST msg) + IF ("${TEST}" MATCHES "^${TEST}$") + IF (${VAR}) + SET (${TEST} 1 CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... yes") + ELSE (${VAR}) + SET (${TEST} "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + ENDIF (${VAR}) + ENDIF ("${TEST}" MATCHES "^${TEST}$") +ENDMACRO (H5MiscConversionTest) + +#----------------------------------------------------------------------------- +# Check various conversion capabilities +#----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------- +# Set flag to indicate that the machine can handle conversion from +# long double to integers accurately. This flag should be set "yes" for +# all machines except all SGIs. For SGIs, some conversions are +# incorrect and its cache value is set "no" in its config/irix6.x and +# irix5.x. +# +H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "checking IF converting from long double to integers is accurate") +# ----------------------------------------------------------------------- +# Set flag to indicate that the machine can do conversion from +# long double to integers regardless of accuracy. This flag should be +# set "yes" for all machines except HP-UX 11.00. For HP-UX 11.00, the +# compiler has 'floating exception' when converting 'long double' to all +# integers except 'unsigned long long'. Other HP-UX systems are unknown +# yet. (1/8/05 - SLU) +# +H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") +# ----------------------------------------------------------------------- +# Set flag to indicate that the machine can handle conversion from +# integers to long double. (This flag should be set "yes" for all +# machines except all SGIs, where some conversions are +# incorrect and its cache value is set "no" in its config/irix6.x and +# irix5.x) +# +H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_INTEGER_TO_LDOUBLE_ACCURATE "checking IF accurately converting from integers to long double") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'unsigned long' to 'float' values. +# (This flag should be set for all machines, except for Pathscale compiler +# on Sandia's Linux machine where the compiler interprets 'unsigned long' +# values as negative when the first bit of 'unsigned long' is on during +# the conversion to float.) +# +H5ConversionTests (H5_ULONG_TO_FLOAT_ACCURATE "Checking IF accurately converting unsigned long to float values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'unsigned (long) long' values to 'float' and 'double' values. +# (This flag should be set for all machines, except for the SGIs, where +# the cache value is set in the config/irix6.x config file) and Solaris +# 64-bit machines, where the short program below tests if round-up is +# correctly handled. +# +H5ConversionTests (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE "Checking IF accurately converting unsigned long long to floating-point values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'float' or 'double' to 'unsigned long long' values. +# (This flag should be set for all machines, except for PGI compiler +# where round-up happens when the fraction of float-point value is greater +# than 0.5. +# +H5ConversionTests (H5_FP_TO_ULLONG_ACCURATE "Checking IF accurately roundup converting floating-point to unsigned long long values" ) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'float', 'double' or 'long double' to 'unsigned long long' values. +# (This flag should be set for all machines, except for HP-UX machines +# where the maximal number for unsigned long long is 0x7fffffffffffffff +# during conversion. +# +H5ConversionTests (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "Checking IF right maximum converting floating-point to unsigned long long values" ) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'long double' to 'unsigned int' values. (This flag should be set for +# all machines, except for some Intel compilers on some Linux.) +# +H5ConversionTests (H5_LDOUBLE_TO_UINT_ACCURATE "Checking IF correctly converting long double to unsigned int values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can _compile_ +# 'unsigned long long' to 'float' and 'double' typecasts. +# (This flag should be set for all machines.) +# +IF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) + SET (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") + MESSAGE (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") +ENDIF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can _compile_ +# 'long long' to 'float' and 'double' typecasts. +# (This flag should be set for all machines.) +# +IF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) + SET (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") + MESSAGE (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") +ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can convert from +# 'unsigned long long' to 'long double' without precision loss. +# (This flag should be set for all machines, except for FreeBSD(sleipnir) +# where the last 2 bytes of mantissa are lost when compiler tries to do +# the conversion, and Cygwin where compiler doesn't do rounding correctly.) +# +H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can handle overflow converting +# all floating-point to all integer types. +# (This flag should be set for all machines, except for Cray X1 where +# floating exception is generated when the floating-point value is greater +# than the maximal integer value). +# +H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows normally converting floating-point to integer values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'long double' to '(unsigned) long long' values. (This flag should be set for +# all machines, except for Mac OS 10.4 and SGI IRIX64 6.5. When the bit sequence +# of long double is 0x4351ccf385ebc8a0bfcc2a3c..., the values of (unsigned)long long +# start to go wrong on these two machines. Adjusting it higher to +# 0x4351ccf385ebc8a0dfcc... or 0x4351ccf385ebc8a0ffcc... will make the converted +# values wildly wrong. This test detects this wrong behavior and disable the test. +# +H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly converting long double to (unsigned) long long values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# '(unsigned) long long' to 'long double' values. (This flag should be set for +# all machines, except for Mac OS 10.4, when the bit sequences are 003fff..., +# 007fff..., 00ffff..., 01ffff..., ..., 7fffff..., the converted values are twice +# as big as they should be. +# +H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") +H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") + +#----------------------------------------------------------------------------- +# These tests need to be manually SET for windows since there is currently +# something not quite correct with the actual test implementation. This affects +# the 'dt_arith' test and most likely lots of other code +# ---------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +ENDIF (WINDOWS) diff --git a/MANIFEST b/MANIFEST index a61a0eb..7b8952e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -22,6 +22,7 @@ ./.autom4te.cfg _DO_NOT_DISTRIBUTE_ ./.h5chkright.ini _DO_NOT_DISTRIBUTE_ +./ACKNOWLEDGMENTS ./COPYING ./MANIFEST ./Makefile.dist @@ -90,6 +91,7 @@ ./config/i686-pc-cygwin ./config/ia64-linux-gnu ./config/ibm-aix +./config/ibm-flags ./config/intel-fflags ./config/intel-flags ./config/irix6.x @@ -398,12 +400,13 @@ ./release_docs/HISTORY-1_9.txt ./release_docs/INSTALL ./release_docs/INSTALL_Cygwin.txt -./release_docs/INSTALL_MinGW.txt ./release_docs/INSTALL_VMS.txt ./release_docs/INSTALL_Windows.txt +./release_docs/CMake.txt ./release_docs/INSTALL_Windows_From_Command_Line.txt ./release_docs/INSTALL_Windows_Short_NET.TXT ./release_docs/INSTALL_Windows_Short_VS2005.TXT +./release_docs/INSTALL_Windows_Short_VS2008.TXT ./release_docs/INSTALL_parallel ./release_docs/RELEASE.txt @@ -1228,7 +1231,18 @@ ./tools/testfiles/textlinksrc-5.ls ./tools/testfiles/textlinksrc-6.ls ./tools/testfiles/textlinksrc-7.ls +./tools/testfiles/textlinksrc-1-old.ls +./tools/testfiles/textlinksrc-2-old.ls +./tools/testfiles/textlinksrc-3-old.ls +./tools/testfiles/textlinksrc-6-old.ls +./tools/testfiles/textlinksrc-7-old.ls ./tools/testfiles/textlinktar.h5 +./tools/testfiles/tsoftlinks.h5 +./tools/testfiles/tsoftlinks-1.ls +./tools/testfiles/tsoftlinks-2.ls +./tools/testfiles/tsoftlinks-3.ls +./tools/testfiles/tsoftlinks-4.ls +./tools/testfiles/tsoftlinks-5.ls ./tools/testfiles/tfamily.ddl ./tools/testfiles/tfamily00000.h5 ./tools/testfiles/tfamily00001.h5 @@ -1538,7 +1552,9 @@ ./tools/h5diff/testfiles/h5diff_90.txt ./tools/h5diff/testfiles/h5diff_100.txt ./tools/h5diff/testfiles/h5diff_101.txt +./tools/h5diff/testfiles/h5diff_101w.txt ./tools/h5diff/testfiles/h5diff_102.txt +./tools/h5diff/testfiles/h5diff_102w.txt ./tools/h5diff/testfiles/h5diff_200.txt ./tools/h5diff/testfiles/h5diff_201.txt ./tools/h5diff/testfiles/h5diff_202.txt @@ -1872,6 +1888,66 @@ ./vms/tools/testfiles/tgroup-2.ddl ./vms/tools/testfiles/tperror.ddl +# CMake-specific Files +./Resources/CMake/FindSZIP.cmake +./Resources/ConversionTests.c +./Resources/GetTimeOfDayTest.cpp +./Resources/HDF5Tests.c +./Resources/xlatefile.c +./Resources/CheckTypeSize.cmake +./Resources/H5cxx_config.h.in +./Resources/H5pubconf.h.in +./Resources/hdf5_zlib.h.in +./Resources/FindHDF5.cmake +./Resources/HDF5-config.cmake.build.in +./Resources/HDF5-config.cmake.install.in +./Resources/HDF5Macros.cmake +./Resources/libhdf5.settings.cmake.in +./Resources/cacheinit.cmake +./Resources/runTest.cmake +./Resources/CTestCustom.ctest +./CMakeLists.txt +./ConfigureChecks.cmake +./CTestConfig.cmake +./c++/CMakeLists.txt +./c++/examples/CMakeLists.txt +./c++/src/CMakeLists.txt +./c++/test/CMakeLists.txt +./examples/CMakeLists.txt +./fortran/CMakeLists.txt +./fortran/examples/CMakeLists.txt +./fortran/src/CMakeLists.txt +./fortran/test/CMakeLists.txt +./hl/CMakeLists.txt +./hl/c++/CMakeLists.txt +./hl/c++/examples/CMakeLists.txt +./hl/c++/src/CMakeLists.txt +./hl/c++/test/CMakeLists.txt +./hl/examples/CMakeLists.txt +./hl/fortran/CMakeLists.txt +./hl/fortran/examples/CMakeLists.txt +./hl/fortran/src/CMakeLists.txt +./hl/fortran/test/CMakeLists.txt +./hl/src/CMakeLists.txt +./hl/test/CMakeLists.txt +./hl/tools/CMakeLists.txt +./perform/CMakeLists.txt +./src/CMakeLists.txt +./test/CMakeLists.txt +./testpar/CMakeLists.txt +./tools/CMakeLists.txt +./tools/h5copy/CMakeLists.txt +./tools/h5diff/CMakeLists.txt +./tools/h5dump/CMakeLists.txt +./tools/h5import/CMakeLists.txt +./tools/h5jam/CMakeLists.txt +./tools/h5ls/CMakeLists.txt +./tools/h5repack/CMakeLists.txt +./tools/h5stat/CMakeLists.txt +./tools/lib/CMakeLists.txt +./tools/misc/CMakeLists.txt + + # Windows-specific Files. # Batch scripts ./windows/copy_hdf.bat diff --git a/Makefile.in b/Makefile.in index 2f426f6..8553153 100644 --- a/Makefile.in +++ b/Makefile.in @@ -226,12 +226,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/README.txt b/README.txt index a57c42f..40a3cb7 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.69-FA_a4 currently under development +HDF5 version 1.9.73-FA_a4 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/Resources/CMake/FindSZIP.cmake b/Resources/CMake/FindSZIP.cmake new file mode 100644 index 0000000..190b0b5 --- /dev/null +++ b/Resources/CMake/FindSZIP.cmake @@ -0,0 +1,179 @@ + +# - Find SZIP library +# - Derived from the FindTiff.cmake that is included with cmake +# Find the native SZIP includes and library +# This module defines +# SZIP_INCLUDE_DIRS, where to find tiff.h, etc. +# SZIP_LIBRARIES, libraries to link against to use SZIP. +# SZIP_FOUND, If false, do not try to use SZIP. +# also defined, but not for general use are +# SZIP_LIBRARY, where to find the SZIP library. +# SZIP_LIBRARY_DEBUG - Debug version of tiff library +# SZIP_LIBRARY_RELEASE - Release Version of tiff library + +# MESSAGE (STATUS "Finding Szip library and headers..." ) + +############################################ +# +# Check the existence of the libraries. +# +############################################ +# This macro was taken directly from the FindQt4.cmake file that is included +# with the CMake distribution. This is NOT my work. All work was done by the +# original authors of the FindQt4.cmake file. Only minor modifications were +# made to remove references to Qt and make this file more generally applicable +######################################################################### + +MACRO (SZIP_ADJUST_LIB_VARS basename) + IF (${basename}_INCLUDE_DIR) + + # if only the release version was found, set the debug variable also to the release version + IF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + SET (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) + SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) + SET (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) + ENDIF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + + # if only the debug version was found, set the release variable also to the debug version + IF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + SET (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) + SET (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) + SET (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) + ENDIF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + IF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + # if the generator supports configuration types then set + # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value + IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + # if there are no configuration types and CMAKE_BUILD_TYPE has no value + # then just use the release libraries + SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + SET (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + ENDIF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + + SET (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") + + IF (${basename}_LIBRARY) + SET (${basename}_FOUND 1) + ENDIF (${basename}_LIBRARY) + + ENDIF (${basename}_INCLUDE_DIR ) + + # Make variables changeble to the advanced user + MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) +ENDMACRO (SZIP_ADJUST_LIB_VARS) + + +# Look for the header file. +SET (SZIP_INCLUDE_SEARCH_DIRS + $ENV{SZIP_INSTALL}/include + $ENV{SZIP_INSTALL}/include/szip + /usr/include + /usr/include/szip +) + +SET (SZIP_LIB_SEARCH_DIRS + $ENV{SZIP_INSTALL}/lib + /usr/lib +) + +SET (SZIP_BIN_SEARCH_DIRS + $ENV{SZIP_INSTALL}/bin + /usr/bin +) + +FIND_PATH (SZIP_INCLUDE_DIR + NAMES szlib.h + PATHS ${SZIP_INCLUDE_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +IF (WIN32 AND NOT MINGW) + SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") + SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz") +ELSE (WIN32 AND NOT MINGW) + SET (SZIP_SEARCH_DEBUG_NAMES "sz_d") + SET (SZIP_SEARCH_RELEASE_NAMES "sz") +ENDIF (WIN32 AND NOT MINGW) + +# Look for the library. +FIND_LIBRARY (SZIP_LIBRARY_DEBUG + NAMES ${SZIP_SEARCH_DEBUG_NAMES} + PATHS ${SZIP_LIB_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +FIND_LIBRARY (SZIP_LIBRARY_RELEASE + NAMES ${SZIP_SEARCH_RELEASE_NAMES} + PATHS ${SZIP_LIB_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +SZIP_ADJUST_LIB_VARS (SZIP) + +IF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + SET (SZIP_FOUND 1) + SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) + SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + IF (SZIP_LIBRARY_DEBUG) + GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) + SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + ELSEIF (SZIP_LIBRARY_RELEASE) + GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) + SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + ENDIF (SZIP_LIBRARY_DEBUG) + +ELSE (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + SET (SZIP_FOUND 0) + SET (SZIP_LIBRARIES) + SET (SZIP_INCLUDE_DIRS) +ENDIF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + +# Report the results. +IF (NOT SZIP_FOUND) + SET (SZIP_DIR_MESSAGE + "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." + ) + IF (NOT SZIP_FIND_QUIETLY) + MESSAGE (STATUS "${SZIP_DIR_MESSAGE}") + ELSE (NOT SZIP_FIND_QUIETLY) + IF (SZIP_FIND_REQUIRED) + MESSAGE (FATAL_ERROR "SZip was NOT found and is Required by this project") + ENDIF (SZIP_FIND_REQUIRED) + ENDIF (NOT SZIP_FIND_QUIETLY) +ENDIF (NOT SZIP_FOUND) + +IF (SZIP_FOUND) + INCLUDE (CheckSymbolExists) + ############################################# + # Find out if SZIP was build using dll's + ############################################# + # Save required variable + SET (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + SET (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) + # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES + SET (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") + + CHECK_SYMBOL_EXISTS (SZIP_BUILT_AS_DYNAMIC_LIB "SZconfig.h" HAVE_SZIP_DLL) + + IF (HAVE_SZIP_DLL STREQUAL "TRUE") + SET (HAVE_SZIP_DLL "1") + ENDIF (HAVE_SZIP_DLL STREQUAL "TRUE") + + # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables + SET (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + SET (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + # + ############################################# +ENDIF (SZIP_FOUND) + +IF (FIND_SZIP_DEBUG) + MESSAGE (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") + MESSAGE (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") + MESSAGE (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") + MESSAGE (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") + MESSAGE (STATUS "HAVE_SZIP_DLL: ${HAVE_SZIP_DLL}") + MESSAGE (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +ENDIF (FIND_SZIP_DEBUG) diff --git a/Resources/CTestCustom.ctest b/Resources/CTestCustom.ctest new file mode 100755 index 0000000..23b4163 --- /dev/null +++ b/Resources/CTestCustom.ctest @@ -0,0 +1,2 @@ +SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) + diff --git a/Resources/CheckTypeSize.cmake b/Resources/CheckTypeSize.cmake new file mode 100644 index 0000000..2e83080 --- /dev/null +++ b/Resources/CheckTypeSize.cmake @@ -0,0 +1,48 @@ +# +# Check if the type exists and determine size of type. if the type +# exists, the size will be stored to the variable. +# +# CHECK_TYPE_SIZE - macro which checks the size of type +# VARIABLE - variable to store size if the type exists. +# HAVE_${VARIABLE} - does the variable exists or not +# + +MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) + SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + IF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + SET (MACRO_CHECK_TYPE_SIZE_FLAGS + "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" + ) + FOREACH (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) + IF ("${def}") + SET (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") + ENDIF("${def}") + ENDFOREACH (def) + + MESSAGE (STATUS "Check size of ${TYPE}") + IF (CMAKE_REQUIRED_LIBRARIES) + SET (CHECK_TYPE_SIZE_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" + ) + ENDIF (CMAKE_REQUIRED_LIBRARIES) + TRY_RUN (${VARIABLE} HAVE_${VARIABLE} + ${CMAKE_BINARY_DIR} + ${HDF5_PROJECT_DIR}/Resources/CheckTypeSize.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS} + "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + IF (HAVE_${VARIABLE}) + MESSAGE (STATUS "Check size of ${TYPE} - done") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" + ) + ELSE (HAVE_${VARIABLE}) + MESSAGE (STATUS "Check size of ${TYPE} - failed") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" + ) + ENDIF (HAVE_${VARIABLE}) + ENDIF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) +ENDMACRO (HDF_CHECK_TYPE_SIZE) diff --git a/Resources/ConversionTests.c b/Resources/ConversionTests.c new file mode 100644 index 0000000..0e24954 --- /dev/null +++ b/Resources/ConversionTests.c @@ -0,0 +1,422 @@ +#ifdef H5_FP_TO_INTEGER_OVERFLOW_WORKS_TEST + +int main(void) +{ + float f = 2147483648.0f; + int i; + + i = (int)f; + + done: + exit(0); +} + +#endif + +#ifdef H5_FP_TO_ULLONG_ACCURATE_TEST + +int main(void) +{ + float f = 111.60f; + double d = 222.55L; + unsigned long long l1 = (unsigned long long)f; + unsigned long long l2 = (unsigned long long)d; + int ret = 0; + + if(l1 == 112) + ret = 1; + if(l2 == 223) + ret = 1; + + done: + exit(ret); +} + +#endif + +#ifdef H5_FP_TO_ULLONG_RIGHT_MAXIMUM_TEST +int main(void) +{ + float f = 9701917572145405952.00f; + double d1 = 9701917572145405952.00L; + long double d2 = 9701917572145405952.00L; + double d3 = 2e40L; + unsigned long long l1 = (unsigned long long)f; + unsigned long long l2 = (unsigned long long)d1; + unsigned long long l3 = (unsigned long long)d2; + unsigned long long l4; + unsigned long long l5 = 0x7fffffffffffffffULL; + int ret = 0; + + if(l1 <= l5 || l2 <= l5 || l3 <= l5) + ret = 1; + + l4 = (unsigned long long)d3; + if(l4 <= l5) + ret = 1; + + done: + exit(ret); +} + +#endif + +#ifdef H5_LDOUBLE_TO_INTEGER_WORKS_TEST +int main(void) +{ + void *align; + long double ld = 9701917572145405952.00L; + unsigned char v1; + short v2; + unsigned int v3; + int ret = 0; + + align = (void*) malloc(sizeof(long double)); + memcpy(align, &ld, sizeof(long double)); + + /*For HU-UX11.00, there's floating exception(core dump) when doing some of casting + *from 'long double' to integers*/ + v1 = (unsigned char) (*((long double*) align)); + v2 = (short) (*((long double*) align)); + v3 = (unsigned int) (*((long double*) align)); + + done: exit(ret); +} + +#endif + +#ifdef H5_LDOUBLE_TO_LLONG_ACCURATE_TEST +int main(void) +{ + long double ld = 20041683600089727.779961L; + long long ll; + unsigned long long ull; + unsigned char s[16]; + int ret = 0; + + if(sizeof(long double) == 16) + { + /*make sure the long double type is the same as the failing type + *which has 16 bytes in size and 11 bits of exponent. If it is, + *the bit sequence should be like below. It's not + *a decent way to check but this info isn't available. */ + memcpy(s, &ld, 16); + if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && + s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && + s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) + { + + /*slightly adjust the bit sequence (s[8]=0xdf). The converted + *values will go wild on Mac OS 10.4 and IRIX64 6.5.*/ + s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; + s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; + s[8]=0xdf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; + s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; + + memcpy(&ld, s, 16); + ll = (long long)ld; + ull = (unsigned long long)ld; + + if(ll != 20041683600089728 || ull != 20041683600089728) + ret = 1; + } + } + done: + exit(ret); +} +#endif + +#ifdef H5_LDOUBLE_TO_UINT_ACCURATE_TEST +int main(void) +{ + long double ld = 2733248032.9183987530L; + unsigned int i; + int ret = 0; + + i = (unsigned int)ld; + if(i!=2733248032 && i!=2733248031 && i!=2733248033) + ret = 1; + + done: + exit(ret); +} +#endif + +#ifdef H5_LLONG_TO_LDOUBLE_CORRECT_TEST +int main(void) +{ + long double ld; + long long ll; + unsigned long long ull; + unsigned char s[16]; + int flag=0, ret=0; + + /*Determine if long double has 16 byte in size, 11 bit exponent, and + *the bias is 0x3ff */ + if(sizeof(long double) == 16) + { + ld = 1.0L; + memcpy(s, &ld, 16); + if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) + flag = 1; + } + + if(flag==1 && sizeof(long long)==8) + { + ll = 0x01ffffffffffffffLL; + ld = (long double)ll; + memcpy(s, &ld, 16); + /*Check if the bit sequence is as supposed to be*/ + if(s[0]!=0x43 || s[1]!=0x7f || s[2]!=0xff || s[3]!=0xff || + s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || + s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) + ret = 1; + } + if(flag==1 && sizeof(unsigned long long)==8) + { + ull = 0x01ffffffffffffffULL; + ld = (long double)ull; + memcpy(s, &ld, 16); + if(s[0]!=0x43 || s[1]!=0x7f || s[2]!=0xff || s[3]!=0xff || + s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || + s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) + ret = 1; + } + done: + exit(ret); +} +#endif + +#ifdef H5_NO_ALIGNMENT_RESTRICTIONS_TEST + +#include +#include + +typedef struct +{ + size_t len; + void *p; +}hvl_t; + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + char *chp = "beefs"; + char **chpp = malloc (2 * sizeof (char *)); + char **chpp2; + hvl_t vl = + { 12345, (void *) chp}; + hvl_t *vlp; + hvl_t *vlp2; + + memcpy ((void *) ((char *) chpp + 1), &chp, sizeof (char *)); + chpp2 = (char **) ((char *) chpp + 1); + if (strcmp (*chpp2, chp)) + { + free (chpp); + return 1; + } + free (chpp); + + vlp = malloc (2 * sizeof (hvl_t)); + memcpy ((void *) ((char *) vlp + 1), &vl, sizeof (hvl_t)); + vlp2 = (hvl_t *) ((char *) vlp + 1); + if (vlp2->len != vl.len || vlp2->p != vl.p) + { + free (vlp); + return 1; + } + free (vlp); + + ; + return 0; +} + +#endif + +#ifdef H5_ULLONG_TO_LDOUBLE_PRECISION_TEST + +#include + + +int main(void) +{ + /* General variables */ + int endian; + int tst_value = 1; + int ret = 0; + + /* For FreeBSD */ + unsigned long long l = 0xa601e80bda85fcefULL; + long double ld; + unsigned char *c1, *c2; + size_t size; + + /* For Cygwin */ + unsigned long long l_cyg = 0xfffffffffffffff0ULL; + long double ld_cyg; + unsigned char *c2_cyg; + size_t size_cyg; + + /* Determine this system's endianess */ + c1 = (unsigned char*)calloc(1, sizeof(int)); + memcpy((void*)c1, &tst_value, sizeof(int)); + if(c1[0]==1) + endian = 0; /* little endian */ + else + endian = 1; /* big endian */ + + /* For FreeBSD */ + size = sizeof(long double); + memset(&ld, 0, size); + ld = (long double)l; + + c2 = (unsigned char*)calloc(1, size); + memcpy((void*)c2, &ld, size); + + /* Test if the last 2 bytes of mantissa are lost. Mainly for FreeBSD on Intel + * architecture(sleipnir) where it happens. */ + /*if(endian==0 && c2[0]==0 && c2[1]==0)*//*little endian*/ + if(endian==0 && c2[0]==0) + { /*little endian*/ + ret = 1; + goto done; + } + + /* For Cygwin */ + size_cyg = sizeof(long double); + memset(&ld_cyg, 0, size); + ld_cyg = (long double)l_cyg; + + c2_cyg = (unsigned char*)calloc(1, size_cyg); + memcpy((void*)c2_cyg, &ld_cyg, size_cyg); + + /* Test if the last 4 bytes(roughly) of mantissa are rounded up. Mainly for Cygwin + * where the values like 0xffffffffffffffff, 0xfffffffffffffffe, ..., + * 0xfffffffffffff000 ... are rounded up as 0x0000403f8000000000000000 + * instead of 0x0000403effffffffffffffff, 0x0000403efffffffffffffffe, ..., + * 0x0000403efffffffffffff000 ... + */ + if(endian==0 && c2_cyg[0]==0 && c2_cyg[1]==0 && c2_cyg[2]==0 && c2_cyg[3]==0) + ret = 1; + + done: + if(c1) + free(c1); + if(c2) + free(c2); + if(c2_cyg) + free(c2_cyg); + exit(ret); +} + +#endif + + +#ifdef H5_ULONG_TO_FLOAT_ACCURATE_TEST + +int main(void) +{ + int ret = 0; + unsigned long l1; + unsigned long l2; + unsigned long l3; + float f1; + float f2; + float f3; + + + if(sizeof(unsigned long)==8) { + l1 = 0xffffffffffffffffUL; + l2 = 0xffffffffffff0000UL; + l3 = 0xf000000000000000UL; + + f1 = (float)l1; + f2 = (float)l2; + f3 = (float)l3; + + if((f1 < 0) || (f2 < 0) || (f3 < 0)) + ret = 1; + } + +done: + exit(ret); +} + +#endif + +#ifdef H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE_TEST + +#include + + +int main(void) +{ + unsigned long l1; + unsigned long l2; + unsigned long l3; + unsigned long l4; + unsigned long long ld1; + unsigned long long ld2; + unsigned long long ld3; + unsigned long long ld4; + double d1, d2, d3, d4; + unsigned char s[8]; + int ret = 0; + + if(sizeof(unsigned long)==8) { + l1 = 0xf000000000000b00UL; /*Round-down case*/ + l2 = 0xf000000000000401UL; /*Round-up case*/ + l3 = 0xf000000000000400UL; /*Round-down case*/ + l4 = 0xf000000000000c00UL; /*Round-up case*/ + + d1 = (double)l1; + d2 = (double)l2; + d3 = (double)l3; + d4 = (double)l4; + } else if(sizeof(unsigned long long)==8) { + ld1 = 0xf000000000000b00ULL; /*Round-down case*/ + ld2 = 0xf000000000000401ULL; /*Round-up case*/ + ld3 = 0xf000000000000400ULL; /*Round-down case*/ + ld4 = 0xf000000000000c00ULL; /*Round-up case*/ + + d1 = (double)ld1; + d2 = (double)ld2; + d3 = (double)ld3; + d4 = (double)ld4; + } else { + ret = 1; + goto done; + } + + memcpy(s, &d1, 8); + if(s[7]!=1) + ret = 1; + + memcpy(s, &d2, 8); + if(s[7]!=1) + ret = 1; + + memcpy(s, &d3, 8); + if(s[7]!=0) + ret = 1; + + memcpy(s, &d4, 8); + if(s[7]!=2) + ret = 1; + +done: + exit(ret); +} +#endif diff --git a/Resources/FindHDF5.cmake b/Resources/FindHDF5.cmake new file mode 100644 index 0000000..4e448ca --- /dev/null +++ b/Resources/FindHDF5.cmake @@ -0,0 +1,56 @@ +# +# To be used by projects that make use of Cmakeified hdf5-1.8 +# + +# +# Find the HDF5 includes and get all installed hdf5 library settings from +# HDF5-config.cmake file : Requires a CMake compatible hdf5-1.8.5 or later +# for this feature to work. The following vars are set if hdf5 is found. +# +# HDF5_FOUND - True if found, otherwise all other vars are undefined +# HDF5_INCLUDE_DIR - The include dir for main *.h files +# HDF5_FORTRAN_INCLUDE_DIR - The include dir for fortran modules and headers +# HDF5_VERSION_STRING - full version (e.g. 1.8.5) +# HDF5_VERSION_MAJOR - major part of version (e.g. 1.8) +# HDF5_VERSION_MINOR - minor part (e.g. 5) +# +# The following boolean vars will be defined +# HDF5_ENABLE_PARALLEL - 1 if HDF5 parallel supported +# HDF5_BUILD_FORTRAN - 1 if HDF5 was compiled with fortran on +# HDF5_BUILD_CPP_LIB - 1 if HDF5 was compiled with cpp on +# HDF5_BUILD_TOOLS - 1 if HDF5 was compiled with tools on +# HDF5_BUILD_HL_LIB - 1 if HDF5 was compiled with parallel on +# +# Target names that are valid (depending on enabled options) +# will be the following +# +# hdf5 : HDF5 C library +# hdf5_tools : the tools library +# hdf5_f90cstub : used by Fortran to C interface +# hdf5_fortran : Fortran HDF5 library +# hdf5_cpp : HDF5 cpp interface library +# hdf5_hl : High Level library +# hdf5_hl_f90cstub : used by Fortran to C interface to High Level library +# hdf5_hl_fortran : Fortran High Level library +# hdf5_hl_cpp : High Level cpp interface library +# +# To aid in finding HDF5 as part of a subproject set +# HDF5_ROOT_DIR_HINT to the location where HDF5-config.cmake lies + +FIND_PATH (HDF5_ROOT_DIR "HDF5-config.cmake" + ${HDF5_ROOT_DIR_HINT} + /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + "C:/Program Files/HDF5/lib" +) + +FIND_PATH (HDF5_INCLUDE_DIR "H5public.h" + ${HDF5_ROOT_DIR}/../include +) + +IF (HDF5_INCLUDE_DIR) + SET (HDF5_FOUND "YES") + INCLUDE (${HDF5_ROOT_DIR}/HDF5-config.cmake) +ENDIF (HDF5_INCLUDE_DIR) diff --git a/Resources/GetTimeOfDayTest.cpp b/Resources/GetTimeOfDayTest.cpp new file mode 100644 index 0000000..3b5bf60 --- /dev/null +++ b/Resources/GetTimeOfDayTest.cpp @@ -0,0 +1,15 @@ +#if defined (TRY_SYS_TIME_H) +#include +/* #include */ +#endif + + +#if defined (TRY_TIME_H) +#include +#endif + +int main(int argc, char **argv) { + struct timeval t1; + gettimeofday(&t1, 0x00); + return 0; +} diff --git a/Resources/H5cxx_config.h.in b/Resources/H5cxx_config.h.in new file mode 100644 index 0000000..c4e1c03 --- /dev/null +++ b/Resources/H5cxx_config.h.in @@ -0,0 +1,5 @@ +/* src/H5cxx_config.h.in Created manually. */ + +/* Define if offsetof extension is present */ +#cmakedefine HAVE_OFFSETOF ${HAVE_OFFSETOF} + diff --git a/Resources/H5pubconf.h.in b/Resources/H5pubconf.h.in new file mode 100644 index 0000000..3f4bdc5 --- /dev/null +++ b/Resources/H5pubconf.h.in @@ -0,0 +1,745 @@ +/* H5pubconf.h Generated By CMake during the configuration */ + +#ifndef H5_CONFIG_H_ +#define H5_CONFIG_H_ + +/* Define if the Windows virtual file driver should be compiled */ +#cmakedefine H5_HAVE_WINDOWS @H5_HAVE_WINDOWS@ + +/* Define if the Windows virtual file driver should use buffered IO functions */ +/* #undef WINDOWS_USE_STDIO */ + +/* Define the maximum write size for the Windows file driver. Larger writes + will be split into many writes. Safe values are 1 <= WINDOWS_MAX_BUF <= 2GB-1. */ +#cmakedefine WINDOWS_MAX_BUF (1024 * 1024 * 1024) + +/* Defined if HDF5 was built with CMake AND build as a shared library */ +#cmakedefine H5_BUILT_AS_DYNAMIC_LIB @H5_BUILT_AS_DYNAMIC_LIB@ + +/* Defined if HDF5 CPP was built with CMake AND build as a shared library */ +#cmakedefine H5_CPP_BUILT_AS_DYNAMIC_LIB @H5_CPP_BUILT_AS_DYNAMIC_LIB@ + +/* Defined if HDF5 HL was built with CMake AND build as a shared library */ +#cmakedefine H5_HL_BUILT_AS_DYNAMIC_LIB @H5_HL_BUILT_AS_DYNAMIC_LIB@ + +/* Define if building universal (internal helper macro) */ +#cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@ + +/* Define if your system generates wrong code for log2 routine. */ +#cmakedefine H5_BAD_LOG2_CODE_GENERATED @H5_BAD_LOG2_CODE_GENERATED@ + +/* Define if the memory buffers being written to disk should be cleared before + writing. */ +#cmakedefine H5_CLEAR_MEMORY @H5_CLEAR_MEMORY@ + +/* Define if your system can handle converting denormalized floating-point + values. */ +#cmakedefine H5_CONVERT_DENORMAL_FLOAT @H5_CONVERT_DENORMAL_FLOAT@ + +/* Define if C++ compiler recognizes offsetof */ +#cmakedefine H5_CXX_HAVE_OFFSETOF @H5_CXX_HAVE_OFFSETOF@ + +/* Define the default virtual file driver to compile */ +#cmakedefine H5_DEFAULT_VFD @H5_DEFAULT_VFD@ + +/* Define if `dev_t' is a scalar */ +#cmakedefine H5_DEV_T_IS_SCALAR @H5_DEV_T_IS_SCALAR@ + +/* Define to dummy `main' function (if any) required to link to the Fortran + libraries. */ +#cmakedefine H5_FC_DUMMY_MAIN @H5_FC_DUMMY_MAIN@ + +/* Define if F77 and FC dummy `main' functions are identical. */ +#cmakedefine H5_FC_DUMMY_MAIN_EQ_F77 @H5_FC_DUMMY_MAIN_EQ_F77@ + +/* Define to a macro mangling the given C identifier (in lower and upper + case), which must not contain underscores, for linking with Fortran. */ +#define @H5_FC_FUNC@ + +/* As FC_FUNC, but for C identifiers containing underscores. */ +#define @H5_FC_FUNC_@ + +/* Define if your system can handle overflow converting floating-point to + integer values. */ +#cmakedefine H5_FP_TO_INTEGER_OVERFLOW_WORKS @H5_FP_TO_INTEGER_OVERFLOW_WORKS@ + +/* Define if your system roundup accurately converting floating-point to + unsigned long long values. */ +#cmakedefine H5_FP_TO_ULLONG_ACCURATE @H5_FP_TO_ULLONG_ACCURATE@ + +/* Define if your system has right maximum convert floating-point to unsigned + long long values. */ +#cmakedefine H5_FP_TO_ULLONG_RIGHT_MAXIMUM @H5_FP_TO_ULLONG_RIGHT_MAXIMUM@ + +/* Define if gettimeofday() populates the tz pointer passed in */ +#cmakedefine H5_GETTIMEOFDAY_GIVES_TZ @H5_GETTIMEOFDAY_GIVES_TZ@ + +/* Define to 1 if you have the `alarm' function. */ +#cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ + +/* Define if the __attribute__(()) extension is present */ +#cmakedefine H5_HAVE_ATTRIBUTE @H5_HAVE_ATTRIBUTE@ + +/* Define to 1 if you have the `BSDgettimeofday' function. */ +#cmakedefine H5_HAVE_BSDGETTIMEOFDAY @H5_HAVE_BSDGETTIMEOFDAY@ + +/* Define if the compiler understands C99 designated initialization of structs + and unions */ +#cmakedefine H5_HAVE_C99_DESIGNATED_INITIALIZER @H5_HAVE_C99_DESIGNATED_INITIALIZER@ + +/* Define if the compiler understands the __func__ keyword */ +#cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@ + +/* Define if the function stack tracing code is to be compiled in */ +#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@ + +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#cmakedefine H5_HAVE_DECL_TZNAME @H5_HAVE_DECL_TZNAME@ + +/* Define to 1 if you have the `difftime' function. */ +#cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@ + +/* Define if the direct I/O virtual file driver should be compiled */ +#cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_DLFCN_H @H5_HAVE_DLFCN_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_DMALLOC_H @H5_HAVE_DMALLOC_H@ + +/* Define if library information should be embedded in the executables */ +#cmakedefine H5_HAVE_EMBEDDED_LIBINFO @H5_HAVE_EMBEDDED_LIBINFO@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_FEATURES_H @H5_HAVE_FEATURES_H@ + +/* Define if support for deflate (zlib) filter is enabled */ +#cmakedefine H5_HAVE_FILTER_DEFLATE @H5_HAVE_FILTER_DEFLATE@ + +/* Define if support for Fletcher32 checksum is enabled */ +#cmakedefine H5_HAVE_FILTER_FLETCHER32 @H5_HAVE_FILTER_FLETCHER32@ + +/* Define if support for nbit filter is enabled */ +#cmakedefine H5_HAVE_FILTER_NBIT @H5_HAVE_FILTER_NBIT@ + +/* Define if support for scaleoffset filter is enabled */ +#cmakedefine H5_HAVE_FILTER_SCALEOFFSET @H5_HAVE_FILTER_SCALEOFFSET@ + +/* Define if support for shuffle filter is enabled */ +#cmakedefine H5_HAVE_FILTER_SHUFFLE @H5_HAVE_FILTER_SHUFFLE@ + +/* Define if support for szip filter is enabled */ +#cmakedefine H5_HAVE_FILTER_SZIP @H5_HAVE_FILTER_SZIP@ + +/* Define to 1 if you have the `fork' function. */ +#cmakedefine H5_HAVE_FORK @H5_HAVE_FORK@ + +/* Define to 1 if you have the `frexpf' function. */ +#cmakedefine H5_HAVE_FREXPF @H5_HAVE_FREXPF@ + +/* Define to 1 if you have the `frexpl' function. */ +#cmakedefine H5_HAVE_FREXPL @H5_HAVE_FREXPL@ + +/* Define to 1 if you have the `fseek64' function. */ +#cmakedefine H5_HAVE_FSEEK64 @H5_HAVE_FSEEK64@ + +/* Define to 1 if you have the `fseeko' function. */ +#cmakedefine H5_HAVE_FSEEKO @H5_HAVE_FSEEKO@ + +/* Define to 1 if you have the `fstat64' function. */ +#cmakedefine H5_HAVE_FSTAT64 @H5_HAVE_FSTAT64@ + +/* Define to 1 if you have the `ftello' function. */ +#cmakedefine H5_HAVE_FTELLO @H5_HAVE_FTELLO@ + +/* Define to 1 if you have the `ftruncate64' function. */ +#cmakedefine H5_HAVE_FTRUNCATE64 @H5_HAVE_FTRUNCATE64@ + +/* Define if the compiler understands the __FUNCTION__ keyword */ +#cmakedefine H5_HAVE_FUNCTION @H5_HAVE_FUNCTION@ + +/* Define to 1 if you have the `GetConsoleScreenBufferInfo' function. */ +#cmakedefine H5_HAVE_GETCONSOLESCREENBUFFERINFO @H5_HAVE_GETCONSOLESCREENBUFFERINFO@ + +/* Define to 1 if you have the `gethostname' function. */ +#cmakedefine H5_HAVE_GETHOSTNAME @H5_HAVE_GETHOSTNAME@ + +/* Define to 1 if you have the `getpwuid' function. */ +#cmakedefine H5_HAVE_GETPWUID @H5_HAVE_GETPWUID@ + +/* Define to 1 if you have the `getrusage' function. */ +#cmakedefine H5_HAVE_GETRUSAGE @H5_HAVE_GETRUSAGE@ + +/* Define to 1 if you have the `gettextinfo' function. */ +#cmakedefine H5_HAVE_GETTEXTINFO @H5_HAVE_GETTEXTINFO@ + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine H5_HAVE_GETTIMEOFDAY @H5_HAVE_GETTIMEOFDAY@ + +/* Define to 1 if you have the `gettimeofday' function declared in time.h . */ +#cmakedefine H5_HAVE_TIME_GETTIMEOFDAY @H5_HAVE_TIME_GETTIMEOFDAY@ + +/* Define to 1 if you have the `gettimeofday' function declared in time.h . */ +#cmakedefine H5_HAVE_SYS_TIME_GETTIMEOFDAY @H5_HAVE_SYS_TIME_GETTIMEOFDAY@ + +/* Define to 1 if you have the `get_fpc_csr' function. */ +#cmakedefine H5_HAVE_GET_FPC_CSR @H5_HAVE_GET_FPC_CSR@ + +/* Define if we have GPFS support */ +#cmakedefine H5_HAVE_GPFS @H5_HAVE_GPFS@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_GPFS_H @H5_HAVE_GPFS_H@ + +/* Define if h5dump packed bits feature is enabled */ +#cmakedefine H5_HAVE_H5DUMP_PACKED_BITS @H5_HAVE_H5DUMP_PACKED_BITS@ + +/* Define if library will contain instrumentation to detect correct + optimization operation */ +#cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_INTTYPES_H @H5_HAVE_INTTYPES_H@ + +/* Define to 1 if you have the `ioctl' function. */ +#cmakedefine H5_HAVE_IOCTL @H5_HAVE_IOCTL@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@ + +/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ +#cmakedefine H5_HAVE_LIBDMALLOC @H5_HAVE_LIBDMALLOC@ + +/* Define to 1 if you have the `lmpe' library (-llmpe). */ +#cmakedefine H5_HAVE_LIBLMPE @H5_HAVE_LIBLMPE@ + +/* Define to 1 if you have the `m' library (-lm). */ +#cmakedefine H5_HAVE_LIBM @H5_HAVE_LIBM@ + +/* Define to 1 if you have the `mpe' library (-lmpe). */ +#cmakedefine H5_HAVE_LIBMPE @H5_HAVE_LIBMPE@ + +/* Define to 1 if you have the `mpi' library (-lmpi). */ +#cmakedefine H5_HAVE_LIBMPI @H5_HAVE_LIBMPI@ + +/* Define to 1 if you have the `mpich' library (-lmpich). */ +#cmakedefine H5_HAVE_LIBMPICH @H5_HAVE_LIBMPICH@ + +/* Define to 1 if you have the `mpio' library (-lmpio). */ +#cmakedefine H5_HAVE_LIBMPIO @H5_HAVE_LIBMPIO@ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#cmakedefine H5_HAVE_LIBNSL @H5_HAVE_LIBNSL@ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#cmakedefine H5_HAVE_LIBPTHREAD @H5_HAVE_LIBPTHREAD@ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +#cmakedefine H5_HAVE_LIBSOCKET @H5_HAVE_LIBSOCKET@ + +/* Define to 1 if you have the `sz' library (-lsz). */ +#cmakedefine H5_HAVE_LIBSZ @H5_HAVE_LIBSZ@ + +/* Define to 1 if you have the `z' library (-lz). */ +#cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ + +/* Define to 1 if you have the `longjmp' function. */ +#cmakedefine H5_HAVE_LONGJMP @H5_HAVE_LONGJMP@ + +/* Define to 1 if you have the `lseek64' function. */ +#cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@ + +/* Define to 1 if you have the `lstat' function. */ +#cmakedefine H5_HAVE_LSTAT @H5_HAVE_LSTAT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_MEMORY_H @H5_HAVE_MEMORY_H@ + +/* Define if we have MPE support */ +#cmakedefine H5_HAVE_MPE @H5_HAVE_MPE@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_MPE_H @H5_HAVE_MPE_H@ + +/* Define if MPI_File_get_size works correctly */ +#cmakedefine H5_HAVE_MPI_GET_SIZE @H5_HAVE_MPI_GET_SIZE@ + +/* Define if `MPI_Comm_c2f' and `MPI_Comm_f2c' exists */ +#cmakedefine H5_HAVE_MPI_MULTI_LANG_Comm @H5_HAVE_MPI_MULTI_LANG_Comm@ + +/* Define if `MPI_Info_c2f' and `MPI_Info_f2c' exists */ +#cmakedefine H5_HAVE_MPI_MULTI_LANG_Info @H5_HAVE_MPI_MULTI_LANG_Info@ + +/* Define if we have parallel support */ +#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@ + +/* Define to 1 if you have the `random' function. */ +#cmakedefine H5_HAVE_RANDOM @H5_HAVE_RANDOM@ + +/* Define to 1 if you have the `rand_r' function. */ +#cmakedefine H5_HAVE_RAND_R @H5_HAVE_RAND_R@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SETJMP_H @H5_HAVE_SETJMP_H@ + +/* Define to 1 if you have the `setsysinfo' function. */ +#cmakedefine H5_HAVE_SETSYSINFO @H5_HAVE_SETSYSINFO@ + +/* Define to 1 if you have the `sigaction' function. */ +#cmakedefine H5_HAVE_SIGACTION @H5_HAVE_SIGACTION@ + +/* Define to 1 if you have the `siglongjmp' function. */ +#cmakedefine H5_HAVE_SIGLONGJMP @H5_HAVE_SIGLONGJMP@ + +/* Define to 1 if you have the `signal' function. */ +#cmakedefine H5_HAVE_SIGNAL @H5_HAVE_SIGNAL@ + +/* Define to 1 if you have the `snprintf' function. */ +#cmakedefine H5_HAVE_SNPRINTF @H5_HAVE_SNPRINTF@ + +/* Define to 1 if you have the `srandom' function. */ +#cmakedefine H5_HAVE_SRANDOM @H5_HAVE_SRANDOM@ + +/* Define to 1 if you have the `stat64' function. */ +#cmakedefine H5_HAVE_STAT64 @H5_HAVE_STAT64@ + +/* Define if `struct stat' has the `st_blocks' field */ +#cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDINT_H @H5_HAVE_STDINT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@ + +/* Define to 1 if you have the `strdup' function. */ +#cmakedefine H5_HAVE_STRDUP @H5_HAVE_STRDUP@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STRINGS_H @H5_HAVE_STRINGS_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STRING_H @H5_HAVE_STRING_H@ + +/* Define if `struct text_info' is defined */ +#cmakedefine H5_HAVE_STRUCT_TEXT_INFO @H5_HAVE_STRUCT_TEXT_INFO@ + +/* Define if `struct timezone' is defined */ +#cmakedefine H5_HAVE_STRUCT_TIMEZONE @H5_HAVE_STRUCT_TIMEZONE@ + +/* Define to 1 if `struct tm' is a member of `tm_zone'. */ +#cmakedefine H5_HAVE_STRUCT_TM_TM_ZONE @H5_HAVE_STRUCT_TM_TM_ZONE@ + +/* Define if `struct videoconfig' is defined */ +#cmakedefine H5_HAVE_STRUCT_VIDEOCONFIG @H5_HAVE_STRUCT_VIDEOCONFIG@ + +/* Define to 1 if you have the `symlink' function. */ +#cmakedefine H5_HAVE_SYMLINK @H5_HAVE_SYMLINK@ + +/* Define to 1 if you have the `system' function. */ +#cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_FPU_H @H5_HAVE_SYS_FPU_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_IOCTL_H @H5_HAVE_SYS_IOCTL_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_PROC_H @H5_HAVE_SYS_PROC_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_RESOURCE_H @H5_HAVE_SYS_RESOURCE_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_SOCKET_H @H5_HAVE_SYS_SOCKET_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_STAT_H @H5_HAVE_SYS_STAT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_SYSINFO_H @H5_HAVE_SYS_SYSINFO_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_TIMEB_H @H5_HAVE_SYS_TIMEB_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_TIME_H @H5_HAVE_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_TIME_H @H5_HAVE_SYS_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_TYPES_H @H5_HAVE_SYS_TYPES_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SZLIB_H @H5_HAVE_SZLIB_H@ + +/* Define if we have thread safe support */ +#cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@ + +/* Define if `timezone' is a global variable */ +#cmakedefine H5_HAVE_TIMEZONE @H5_HAVE_TIMEZONE@ + +/* Define if the ioctl TIOCGETD is defined */ +#cmakedefine H5_HAVE_TIOCGETD @H5_HAVE_TIOCGETD@ + +/* Define if the ioctl TIOGWINSZ is defined */ +#cmakedefine H5_HAVE_TIOCGWINSZ @H5_HAVE_TIOCGWINSZ@ + +/* Define to 1 if you have the `tmpfile' function. */ +#cmakedefine H5_HAVE_TMPFILE @H5_HAVE_TMPFILE@ + +/* Define if `tm_gmtoff' is a member of `struct tm' */ +#cmakedefine H5_HAVE_TM_GMTOFF @H5_HAVE_TM_GMTOFF@ + +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#cmakedefine H5_HAVE_TM_ZONE @H5_HAVE_TM_ZONE@ + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +#cmakedefine H5_HAVE_TZNAME @H5_HAVE_TZNAME@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_UNISTD_H @H5_HAVE_UNISTD_H@ + +/* Define to 1 if you have the `vasprintf' function. */ +#cmakedefine H5_HAVE_VASPRINTF @H5_HAVE_VASPRINTF@ + +/* Define to 1 if you have the `vsnprintf' function. */ +#cmakedefine H5_HAVE_VSNPRINTF @H5_HAVE_VSNPRINTF@ + +/* Define to 1 if you have the `waitpid' function. */ +#cmakedefine H5_HAVE_WAITPID @H5_HAVE_WAITPID@ + +/* Define if your system has window style path name. */ +#cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_WINSOCK_H @H5_HAVE_WINSOCK_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@ + +/* Define to 1 if you have the `_getvideoconfig' function. */ +#cmakedefine H5_HAVE__GETVIDEOCONFIG @H5_HAVE__GETVIDEOCONFIG@ + +/* Define to 1 if you have the `_scrsize' function. */ +#cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@ + +/* Define if `__tm_gmtoff' is a member of `struct tm' */ +#cmakedefine H5_HAVE___TM_GMTOFF @H5_HAVE___TM_GMTOFF@ + +/* Define if your system can't handle converting floating-point values to long + long. */ +#cmakedefine H5_HW_FP_TO_LLONG_NOT_WORKS @H5_HW_FP_TO_LLONG_NOT_WORKS@ + +/* Define if HDF5's high-level library headers should be included in hdf5.h */ +#cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ + +/* Define if your system can accurately convert from integers to long double + values. */ +#cmakedefine H5_INTEGER_TO_LDOUBLE_ACCURATE @H5_INTEGER_TO_LDOUBLE_ACCURATE@ + +/* Define if your system can convert long double to integers accurately. */ +#cmakedefine H5_LDOUBLE_TO_INTEGER_ACCURATE @H5_LDOUBLE_TO_INTEGER_ACCURATE@ + +/* Define if your system can convert from long double to integer values. */ +#cmakedefine H5_LDOUBLE_TO_INTEGER_WORKS @H5_LDOUBLE_TO_INTEGER_WORKS@ + +/* Define if your system can convert long double to (unsigned) long long + values correctly. */ +#cmakedefine H5_LDOUBLE_TO_LLONG_ACCURATE @H5_LDOUBLE_TO_LLONG_ACCURATE@ + +/* Define if your system can convert long double to unsigned int values + correctly. */ +#cmakedefine H5_LDOUBLE_TO_UINT_ACCURATE @H5_LDOUBLE_TO_UINT_ACCURATE@ + +/* Define if your system can compile long long to floating-point casts. */ +#cmakedefine H5_LLONG_TO_FP_CAST_WORKS @H5_LLONG_TO_FP_CAST_WORKS@ + +/* Define if your system can convert (unsigned) long long to long double + values correctly. */ +#cmakedefine H5_LLONG_TO_LDOUBLE_CORRECT @H5_LLONG_TO_LDOUBLE_CORRECT@ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ + +/* Define if the metadata trace file code is to be compiled in */ +#cmakedefine H5_METADATA_TRACE_FILE @H5_METADATA_TRACE_FILE@ + +/* Define if your system can handle complicated MPI derived datatype + correctly. */ +#cmakedefine H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS @H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS@ + +/* Define if your system's `MPI_File_set_size' function works for files over + 2GB. */ +#cmakedefine H5_MPI_FILE_SET_SIZE_BIG @H5_MPI_FILE_SET_SIZE_BIG@ + +/* Define if your system can handle special collective IO properly. */ +#cmakedefine H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS @H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS@ + +/* Define if we can violate pointer alignment restrictions */ +#cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ + +/* Define if deprecated public API symbols are disabled */ +#cmakedefine H5_NO_DEPRECATED_SYMBOLS @H5_NO_DEPRECATED_SYMBOLS@ + +/* Define if shared writing must be disabled (CodeWarrior only) */ +#cmakedefine H5_NO_SHARED_WRITING @H5_NO_SHARED_WRITING@ + +/* Name of package */ +#define H5_PACKAGE "@HDF5_PACKAGE@" + +/* Define to the address where bug reports for this package should be sent. */ +#define H5_PACKAGE_BUGREPORT "@HDF5_PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define H5_PACKAGE_NAME "@HDF5_PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define H5_PACKAGE_STRING "@HDF5_PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#define H5_PACKAGE_TARNAME "@HDF5_PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#define H5_PACKAGE_URL "@HDF5_PACKAGE_URL@" + +/* Define to the version of this package. */ +#define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION@" + +/* Width for printf() for type `long long' or `__int64', use `ll' */ +#cmakedefine H5_PRINTF_LL_WIDTH @H5_PRINTF_LL_WIDTH@ + +/* The size of `char', as computed by sizeof. */ +#define H5_SIZEOF_CHAR @H5_SIZEOF_CHAR@ + +/* The size of `double', as computed by sizeof. */ +#define H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@ + +/* The size of `float', as computed by sizeof. */ +#define H5_SIZEOF_FLOAT @H5_SIZEOF_FLOAT@ + +/* The size of `int', as computed by sizeof. */ +#define H5_SIZEOF_INT @H5_SIZEOF_INT@ + +/* The size of `int16_t', as computed by sizeof. */ +#define H5_SIZEOF_INT16_T @H5_SIZEOF_INT16_T@ + +/* The size of `int32_t', as computed by sizeof. */ +#define H5_SIZEOF_INT32_T @H5_SIZEOF_INT32_T@ + +/* The size of `int64_t', as computed by sizeof. */ +#define H5_SIZEOF_INT64_T @H5_SIZEOF_INT64_T@ + +/* The size of `int8_t', as computed by sizeof. */ +#define H5_SIZEOF_INT8_T @H5_SIZEOF_INT8_T@ + +/* The size of `int_fast16_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST16_T @H5_SIZEOF_INT_FAST16_T@ + +/* The size of `int_fast32_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST32_T @H5_SIZEOF_INT_FAST32_T@ + +/* The size of `int_fast64_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST64_T @H5_SIZEOF_INT_FAST64_T@ + +/* The size of `int_fast8_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST8_T @H5_SIZEOF_INT_FAST8_T@ + +/* The size of `int_least16_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST16_T @H5_SIZEOF_INT_LEAST16_T@ + +/* The size of `int_least32_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST32_T @H5_SIZEOF_INT_LEAST32_T@ + +/* The size of `int_least64_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST64_T @H5_SIZEOF_INT_LEAST64_T@ + +/* The size of `int_least8_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST8_T @H5_SIZEOF_INT_LEAST8_T@ + +#if !defined(__APPLE__) +/* The size of `size_t', as computed by sizeof. */ +#define H5_SIZEOF_SIZE_T @H5_SIZEOF_SIZE_T@ + +/* The size of `ssize_t', as computed by sizeof. */ +#define H5_SIZEOF_SSIZE_T @H5_SIZEOF_SSIZE_T@ + +/* The size of `long', as computed by sizeof. */ +#define H5_SIZEOF_LONG @H5_SIZEOF_LONG@ + +#else + # if defined(__LP64__) && __LP64__ + #define H5_SIZEOF_LONG 8 + #define H5_SIZEOF_SIZE_T 8 + #define H5_SIZEOF_SSIZE_T 8 + # else + #define H5_SIZEOF_LONG 4 + #define H5_SIZEOF_SIZE_T 4 + #define H5_SIZEOF_SSIZE_T 4 + # endif + +#endif + +/* The size of `long double', as computed by sizeof. */ +#define H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + +/* Define size of long long and/or __int64 bit integer type only if the type + exists. */ +#if !defined(__APPLE__) + #define H5_SIZEOF_LONG_LONG @H5_SIZEOF_LONG_LONG@ +#else + #define H5_SIZEOF_LONG_LONG 8 +#endif + +/* The size of `off64_t', as computed by sizeof. */ +#define H5_SIZEOF_OFF64_T @H5_SIZEOF_OFF64_T@ + +/* The size of `off_t', as computed by sizeof. */ +#define H5_SIZEOF_OFF_T @H5_SIZEOF_OFF_T@ + +/* The size of `short', as computed by sizeof. */ +#define H5_SIZEOF_SHORT @H5_SIZEOF_SHORT@ + +/* The size of `uint16_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT16_T @H5_SIZEOF_UINT16_T@ + +/* The size of `uint32_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT32_T @H5_SIZEOF_UINT32_T@ + +/* The size of `uint64_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT64_T @H5_SIZEOF_UINT64_T@ + +/* The size of `uint8_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT8_T @H5_SIZEOF_UINT8_T@ + +/* The size of `uint_fast16_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST16_T @H5_SIZEOF_UINT_FAST16_T@ + +/* The size of `uint_fast32_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST32_T @H5_SIZEOF_UINT_FAST32_T@ + +/* The size of `uint_fast64_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST64_T @H5_SIZEOF_UINT_FAST64_T@ + +/* The size of `uint_fast8_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST8_T @H5_SIZEOF_UINT_FAST8_T@ + +/* The size of `uint_least16_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST16_T @H5_SIZEOF_UINT_LEAST16_T@ + +/* The size of `uint_least32_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST32_T @H5_SIZEOF_UINT_LEAST32_T@ + +/* The size of `uint_least64_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST64_T @H5_SIZEOF_UINT_LEAST64_T@ + +/* The size of `uint_least8_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST8_T @H5_SIZEOF_UINT_LEAST8_T@ + +/* The size of `unsigned', as computed by sizeof. */ +#define H5_SIZEOF_UNSIGNED @H5_SIZEOF_UNSIGNED@ + +/* The size of `__int64', as computed by sizeof. */ +#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ + +/* Define if strict file format checks are enabled */ +#cmakedefine H5_STRICT_FORMAT_CHECKS @H5_STRICT_FORMAT_CHECKS@ + +/* Define if your system supports pthread_attr_setscope(&attribute, + PTHREAD_SCOPE_SYSTEM) call. */ +#cmakedefine H5_SYSTEM_SCOPE_THREADS @H5_SYSTEM_SCOPE_THREADS@ + +/* Define to 1 if you can safely include both and . */ +#cmakedefine H5_TIME_WITH_SYS_TIME @H5_TIME_WITH_SYS_TIME@ + +/* Define to 1 if your declares `struct tm'. */ +#cmakedefine H5_TM_IN_SYS_TIME @H5_TM_IN_SYS_TIME@ + +/* Define if your system can compile unsigned long long to floating-point + casts. */ +#cmakedefine H5_ULLONG_TO_FP_CAST_WORKS @H5_ULLONG_TO_FP_CAST_WORKS@ + +/* Define if your system can convert unsigned long long to long double with + correct precision. */ +#cmakedefine H5_ULLONG_TO_LDOUBLE_PRECISION @H5_ULLONG_TO_LDOUBLE_PRECISION@ + +/* Define if your system accurately converting unsigned long to float values. + */ +#cmakedefine H5_ULONG_TO_FLOAT_ACCURATE @H5_ULONG_TO_FLOAT_ACCURATE@ + +/* Define if your system can accurately convert unsigned (long) long values to + floating-point values. */ +#cmakedefine H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE @H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE@ + +/* Define using v1.6 public API symbols by default */ +#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@ + +/* Define if a memory checking tool will be used on the library, to cause + library to be very picky about memory operations and also disable the + internal free list manager code. */ +#cmakedefine H5_USING_MEMCHECKER @H5_USING_MEMCHECKER@ + +/* Version number of package */ +#define VERSION "@HDF5_PACKAGE_VERSION@" + +/* Define if vsnprintf() returns the correct value for formatted strings that + don't fit into size allowed */ +#cmakedefine H5_VSNPRINTF_WORKS @H5_VSNPRINTF_WORKS@ + +/* Data accuracy is prefered to speed during data conversions */ +#cmakedefine H5_WANT_DATA_ACCURACY @H5_WANT_DATA_ACCURACY@ + +/* Check exception handling functions during data conversions */ +#cmakedefine H5_WANT_DCONV_EXCEPTION @H5_WANT_DCONV_EXCEPTION@ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if !defined(__APPLE__) +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#else +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Define to empty if `const' does not conform to ANSI C. */ +#cmakedefine H5_const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#cmakedefine H5_inline @H5_inline@ +#endif + +/* Define to `long int' if does not define. */ +#cmakedefine H5_off_t + +/* Define to `unsigned long' if does not define. */ +#cmakedefine H5_size_t + +/* Define to `long' if does not define. */ +#cmakedefine H5_ssize_t + +#if defined(__cplusplus) && defined(inline) +#undef inline +#endif + +#endif \ No newline at end of file diff --git a/Resources/HDF5-config.cmake.build.in b/Resources/HDF5-config.cmake.build.in new file mode 100644 index 0000000..132e8be --- /dev/null +++ b/Resources/HDF5-config.cmake.build.in @@ -0,0 +1,42 @@ +#----------------------------------------------------------------------------- +# HDF5 Config file for compiling against hdf5 build directory +#----------------------------------------------------------------------------- + +SET (HDF5_INCLUDE_DIRS "@HDF5_INCLUDES_BUILD_TIME@") + +#----------------------------------------------------------------------------- +# Don't include targets if this file is being picked up by another +# project which has already build hdf5 as a subproject +#----------------------------------------------------------------------------- +IF (NOT TARGET "hdf5" AND NOT HDF5_INSTALL_SKIP_TARGETS) + GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + INCLUDE (${SELF_DIR}/HDF5-targets.cmake) +ENDIF (NOT TARGET "hdf5" AND NOT HDF5_INSTALL_SKIP_TARGETS) + +SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) +SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) +SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) + +SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) +SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) +SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) +SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) + +# +# To be continued ... +# +# XXX_INCLUDE_DIRS The final set of include directories listed in one variable for use by client code. This should not be a cache entry. +# XXX_LIBRARIES The libraries to link against to use XXX. These should include full paths. This should not be a cache entry. +# XXX_DEFINITIONS Definitions to use when compiling code that uses XXX. This really shouldn't include options such as (-DHAS_JPEG)that a client source-code file uses to decide whether to #include +# XXX_EXECUTABLE Where to find the XXX tool. +# XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX. +# XXX_LIBRARY_DIRS Optionally, the final set of library directories listed in one variable for use by client code. This should not be a cache entry. +# XXX_ROOT_DIR Where to find the base directory of XXX. +# XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is ever true. +# XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command. +# XXX_YY_FOUND If False, optional YY part of XXX sytem is not available. +# XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX. +# XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries. +# The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix. +# This should not be a cache entry. diff --git a/Resources/HDF5-config.cmake.install.in b/Resources/HDF5-config.cmake.install.in new file mode 100644 index 0000000..2c33edf --- /dev/null +++ b/Resources/HDF5-config.cmake.install.in @@ -0,0 +1,43 @@ +#----------------------------------------------------------------------------- +# HDF5 Config file for compiling against hdf5 install directory +#----------------------------------------------------------------------------- + +GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +GET_FILENAME_COMPONENT (HDF5_INCLUDE_DIRS "${SELF_DIR}/../include" ABSOLUTE) +SET (HDF5_FORTRAN_DIR ${HDF5_INCLUDE_DIRS}/fortran) + +#----------------------------------------------------------------------------- +# Don't include targets if this file is being picked up by another +# project which has already build hdf5 as a subproject +#----------------------------------------------------------------------------- +IF (NOT TARGET "hdf5") + INCLUDE (${SELF_DIR}/HDF5-targets.cmake) +ENDIF (NOT TARGET "hdf5") + +SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) +SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) +SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) + +SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) +SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) +SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) +SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) + +# +# To be continued ... +# +# XXX_INCLUDE_DIRS The final set of include directories listed in one variable for use by client code. This should not be a cache entry. +# XXX_LIBRARIES The libraries to link against to use XXX. These should include full paths. This should not be a cache entry. +# XXX_DEFINITIONS Definitions to use when compiling code that uses XXX. This really shouldn't include options such as (-DHAS_JPEG)that a client source-code file uses to decide whether to #include +# XXX_EXECUTABLE Where to find the XXX tool. +# XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX. +# XXX_LIBRARY_DIRS Optionally, the final set of library directories listed in one variable for use by client code. This should not be a cache entry. +# XXX_ROOT_DIR Where to find the base directory of XXX. +# XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is ever true. +# XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command. +# XXX_YY_FOUND If False, optional YY part of XXX sytem is not available. +# XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX. +# XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries. +# The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix. +# This should not be a cache entry. diff --git a/Resources/HDF5Macros.cmake b/Resources/HDF5Macros.cmake new file mode 100644 index 0000000..cb1b300 --- /dev/null +++ b/Resources/HDF5Macros.cmake @@ -0,0 +1,122 @@ +#------------------------------------------------------------------------------- +MACRO (SET_GLOBAL_VARIABLE name value) + SET (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) +ENDMACRO (SET_GLOBAL_VARIABLE) + +#------------------------------------------------------------------------------- +MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) + #set(source_group_path "Source/AIM/${NAME}") + STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) + source_group(${source_group_path} FILES ${HEADERS} ${SOURCES}) + + #-- The following is needed if we ever start to use OS X Frameworks but only + #-- works on CMake 2.6 and greater + #SET_PROPERTY (SOURCE ${HEADERS} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +ENDMACRO (IDE_GENERATED_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) + # INSTALL (FILES ${HEADERS} + # DESTINATION include/R3D/${NAME} + # COMPONENT Headers + # ) + + STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) + source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) + + #-- The following is needed if we ever start to use OS X Frameworks but only + #-- works on CMake 2.6 and greater + #SET_PROPERTY (SOURCE ${HEADERS} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +ENDMACRO (IDE_SOURCE_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (H5_NAMING target) + IF (WIN32 AND NOT MINGW) + IF (BUILD_SHARED_LIBS) + IF (H5_LEGACY_NAMING) + SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "dll") + SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "${target}") + ELSE (H5_LEGACY_NAMING) + SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "${target}dll") + ENDIF (H5_LEGACY_NAMING) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (WIN32 AND NOT MINGW) +ENDMACRO (H5_NAMING) + +#------------------------------------------------------------------------------- +MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) + # message (STATUS "${libname} libtype: ${libtype}") + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + IF (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}dll") + SET (LIB_DEBUG_NAME "${libname}ddll") + ELSE (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_D") + ENDIF (H5_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + IF (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}d") + ELSE (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "lib${libname}") + SET (LIB_DEBUG_NAME "lib${libname}_D") + ENDIF (H5_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (LIB_RELEASE_NAME "lib${libname}") + SET (LIB_DEBUG_NAME "lib${libname}_debug") + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${libtype} MATCHES "SHARED") + + SET_TARGET_PROPERTIES (${libtarget} + PROPERTIES + DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} + RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} + MINSIZEREL_OUTPUT_NAME ${LIB_RELEASE_NAME} + RELWITHDEBINFO_OUTPUT_NAME ${LIB_RELEASE_NAME} + ) + + #----- Use MSVC Naming conventions for Shared Libraries + IF (MINGW AND BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${libtarget} + PROPERTIES + IMPORT_SUFFIX ".lib" + IMPORT_PREFIX "" + PREFIX "" + ) + ENDIF (MINGW AND BUILD_SHARED_LIBS) + + IF (BUILD_SHARED_LIBS) + IF (WIN32) + SET (LIBHDF_VERSION HDF5_PACKAGE_VERSION_MAJOR) + ELSE (WIN32) + SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) + ENDIF (WIN32) + SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) + SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION}) + ENDIF (BUILD_SHARED_LIBS) + + #-- Apple Specific install_name for libraries + IF (APPLE) + OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + IF (HDF5_BUILD_WITH_INSTALL_NAME) + SET_TARGET_PROPERTIES(${libtarget} PROPERTIES + LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" + INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" + BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} + ) + ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) + ENDIF (APPLE) + +ENDMACRO (H5_SET_LIB_OPTIONS) + diff --git a/Resources/HDF5Tests.c b/Resources/HDF5Tests.c new file mode 100644 index 0000000..35e7258 --- /dev/null +++ b/Resources/HDF5Tests.c @@ -0,0 +1,366 @@ +#define SIMPLE_TEST(x) int main(){ x; return 0; } + +#ifdef CXX_HAVE_OFFSETOF + #include +#include + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + + ; + return 0; +} +#endif + +#ifdef HAVE_C99_DESIGNATED_INITIALIZER + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + typedef struct + { + int x; + union + { + int i; + double d; + }u; + }di_struct_t; + di_struct_t x = + { 0, + { .d = 0.0}}; + ; + return 0; +} + +#endif + +#ifdef HAVE_C99_FUNC + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + const char *fname = __func__; + ; + return 0; +} + +#endif + +#ifdef VSNPRINTF_WORKS +#include +#include +#include + +int test_vsnprintf(const char *fmt,...) +{ + va_list ap; + char *s = malloc(16); + int ret; + + va_start(ap, fmt); + ret=vsnprintf(s,16,"%s",ap); + va_end(ap); + + return(ret!=42 ? 1 : 0); +} + +int main(void) +{ + exit(test_vsnprintf("%s","A string that is longer than 16 characters")); +} +#endif + + +#ifdef TIME_WITH_SYS_TIME +/* Time with sys/time test */ + +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} + +#endif + +#ifdef STDC_HEADERS +#include +#include +#include +#include +int main() { return 0; } +#endif /* STDC_HEADERS */ + +#ifdef HAVE_TM_ZONE + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.tm_zone); + +#endif /* HAVE_TM_ZONE */ + +#ifdef HAVE_STRUCT_TM_TM_ZONE + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.tm_zone); + +#endif /* HAVE_STRUCT_TM_TM_ZONE */ + +#ifdef HAVE_ATTRIBUTE + +#if 0 +static void test int __attribute((unused)) var) +{ + int __attribute__((unused)) x = var; +} + +int main(void) +{ + test(19); +} + +#else +int +main () +{ +int __attribute__((unused)) x + ; + return 0; +} +#endif + + +#endif /* HAVE_ATTRIBUTE */ + +#ifdef HAVE_FUNCTION + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +(void)__FUNCTION__ + ; + return 0; +} + +#endif /* HAVE_FUNCTION */ + +#ifdef HAVE_TM_GMTOFF + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); + +#endif /* HAVE_TM_GMTOFF */ + +#ifdef HAVE_TIMEZONE + +#include +#include +SIMPLE_TEST(timezone=0); + +#endif /* HAVE_TIMEZONE */ + +#ifdef HAVE_STRUCT_TIMEZONE + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct timezone tz; tz.tz_minuteswest=0); + +#endif /* HAVE_STRUCT_TIMEZONE */ + +#ifdef HAVE_STAT_ST_BLOCKS + +#include +SIMPLE_TEST(struct stat sb; sb.st_blocks=0); + +#endif /* HAVE_STAT_ST_BLOCKS */ + +#ifdef PRINTF_LL_WIDTH + +#ifdef HAVE_LONG_LONG +# define LL_TYPE long long +#else /* HAVE_LONG_LONG */ +# define LL_TYPE __int64 +#endif /* HAVE_LONG_LONG */ + +#include +#include +#include + +int main(void) +{ + char *llwidthArgs[] = { "l64", "l", "L", "q", "ll", NULL }; + char *s = malloc(128); + char **currentArg = NULL; + LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; + for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++) + { + char formatString[64]; + sprintf(formatString, "%%%sd", *currentArg); + sprintf(s, formatString, x); + if (strcmp(s, "1099511627776") == 0) + { + printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg); + exit(0); + } + } + exit(1); +} + +#endif /* PRINTF_LL_WIDTH */ + +#ifdef SYSTEM_SCOPE_THREADS +#include +#include + +int main(void) +{ + pthread_attr_t attribute; + int ret; + + pthread_attr_init(&attribute); + ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); + exit(ret==0 ? 0 : 1); +} + +#endif /* SYSTEM_SCOPE_THREADS */ + +#ifdef HAVE_SOCKLEN_T + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +SIMPLE_TEST(socklen_t foo); + +#endif /* HAVE_SOCKLEN_T */ + +#ifdef DEV_T_IS_SCALAR + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +int main () +{ + dev_t d1, d2; + if(d1==d2) + return 0; + return 1; +} + +#endif /* DEV_T_IS_SCALAR */ + +#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) +#ifndef __cplusplus +typedef int foo_t; +static INLINE_TEST_INLINE foo_t static_foo () { return 0; } +INLINE_TEST_INLINE foo_t foo () {return 0; } +int main() { return 0; } +#endif + +#endif /* INLINE_TEST */ + +#ifdef HAVE_OFF64_T +#include +int main() +{ + off64_t n = 0; + return (int)n; +} +#endif + + +#ifdef GETTIMEOFDAY_GIVES_TZ +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +int main(void) +{ + struct timeval tv; + struct timezone tz; + tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ + tz.tz_dsttime = 7; + gettimeofday(&tv, &tz); + /* Check whether the function returned any value at all */ + if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) + exit(1); + else exit (0); +} +#endif + diff --git a/Resources/cacheinit.cmake b/Resources/cacheinit.cmake new file mode 100755 index 0000000..7ca38e1 --- /dev/null +++ b/Resources/cacheinit.cmake @@ -0,0 +1,35 @@ +# This is the CMakeCache file. + +######################## +# EXTERNAL cache entries +######################## + +SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + +SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + +SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + +SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) + +SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) + +SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) + +SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) + +SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + +SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + +SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + +SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + +SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + +SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + +SET (HDF5_USE_H5DUMP_PACKED_BITS OFF CACHE BOOL "Use the PACKED BITS feature in h5dump" FORCE) + +SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) diff --git a/Resources/hdf5_zlib.h.in b/Resources/hdf5_zlib.h.in new file mode 100644 index 0000000..104db27 --- /dev/null +++ b/Resources/hdf5_zlib.h.in @@ -0,0 +1 @@ +#include <@H5_ZLIB_HEADER@> diff --git a/Resources/libhdf5.settings.cmake.in b/Resources/libhdf5.settings.cmake.in new file mode 100644 index 0000000..a3032e5 --- /dev/null +++ b/Resources/libhdf5.settings.cmake.in @@ -0,0 +1,68 @@ + SUMMARY OF THE HDF5 CONFIGURATION + ================================= + +General Information: +------------------- + HDF5 Version: @H5_VERSION@ + Configured on: @CONFIG_DATE@ + Configured by: @CONFIG_USER@ + Configure mode: @CONFIG_MODE@ + Host system: @host_cpu@-@host_vendor@-@host_os@ + Uname information: @UNAME_INFO@ + Byte sex: @BYTESEX@ + Libraries: @STATIC_SHARED@ + Installation point: @prefix@ + +Compiling Options: +------------------ + Compilation Mode: @CONFIG_MODE@ + C Compiler: @CC_VERSION@ + CFLAGS: @CFLAGS@ + H5_CFLAGS: @H5_CFLAGS@ + AM_CFLAGS: @AM_CFLAGS@ + CPPFLAGS: @CPPFLAGS@ + H5_CPPFLAGS: @H5_CPPFLAGS@ + AM_CPPFLAGS: @AM_CPPFLAGS@ + Shared Libraries: @enable_shared@ + Static Libraries: @enable_static@ + Statically Linked Executables: @STATIC_EXEC@ + LDFLAGS: @LDFLAGS@ + AM_LDFLAGS: @AM_LDFLAGS@ + Extra libraries: @LIBS@ + Archiver: @AR@ + Ranlib: @RANLIB@ + Debugged Packages: @DEBUG_PKG@ + API Tracing: @TRACE_API@ + +Languages: +---------- + Fortran: @HDF_FORTRAN@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @FC@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @FCFLAGS@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ + C++: @HDF_CXX@ +@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CXX@ +@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CXXFLAGS@ +@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ +@BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@ + +Features: +--------- + Parallel HDF5: @PARALLEL@ + High Level library: @HDF5_HL@ + Threadsafety: @THREADSAFE@ + Default API Mapping: @DEFAULT_API_VERSION@ + With Deprecated Public Symbols: @DEPRECATED_SYMBOLS@ + I/O filters (external): @EXTERNAL_FILTERS@ + I/O filters (internal): @FILTERS@ + MPE: @MPE@ + Direct VFD: @DIRECT_VFD@ + dmalloc: @HAVE_DMALLOC@ +Clear file buffers before write: @CLEARFILEBUF@ + Using memory checker: @USINGMEMCHECKER@ + Function Stack Tracing: @CODESTACK@ + GPFS: @GPFS@ + Strict File Format Checks: @STRICT_FORMAT_CHECKS@ + Optimization Instrumentation: @INSTRUMENT@ + Linux Large File Support (LFS): @LINUX_LFS@ diff --git a/Resources/runTest.cmake b/Resources/runTest.cmake new file mode 100644 index 0000000..4218671 --- /dev/null +++ b/Resources/runTest.cmake @@ -0,0 +1,82 @@ +# runTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. + +# arguments checking +IF (NOT TEST_PROGRAM) + MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") +ENDIF (NOT TEST_PROGRAM) +#IF (NOT TEST_ARGS) +# MESSAGE (STATUS "Require TEST_ARGS to be defined") +#ENDIF (NOT TEST_ARGS) +IF (NOT TEST_FOLDER) + MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") +ENDIF (NOT TEST_FOLDER) +IF (NOT TEST_OUTPUT) + MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") +ENDIF (NOT TEST_OUTPUT) +#IF (NOT TEST_EXPECT) +# MESSAGE (STATUS "Require TEST_EXPECT to be defined") +#ENDIF (NOT TEST_EXPECT) +IF (NOT TEST_REFERENCE) + MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") +ENDIF (NOT TEST_REFERENCE) + +SET (ERROR_APPEND 1) + +MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +# run the test program, capture the stdout/stderr and the result var +EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR +) + +MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") + +IF (ERROR_APPEND) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (ERROR_APPEND) + +IF (TEST_APPEND) + FILE (APPEND ${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") +ENDIF (TEST_APPEND) + +# if the return value is !=0 bail out +IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") +ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + +MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") + +IF (TEST_MASK) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + #STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_MASK) + +IF (WIN32 AND NOT MINGW) + FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + FILE (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") +ENDIF (WIN32 AND NOT MINGW) + +# now compare the output with the reference +EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_OUTPUT} ${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT +) + +# again, if return value is !=0 scream and shout +IF (TEST_RESULT) + MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not match ${TEST_REFERENCE}") +ENDIF (TEST_RESULT) + +# everything went fine... +MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") + diff --git a/Resources/xlatefile.c b/Resources/xlatefile.c new file mode 100644 index 0000000..c16f573 --- /dev/null +++ b/Resources/xlatefile.c @@ -0,0 +1,56 @@ +#include +#include +#include + +#define BUFFERSIZE 1024 + +int main(int argc, char *argv[]) { + FILE *infile = NULL; + FILE *outfile = NULL; + char *buffer = NULL; + char argbuf[8]; + unsigned int bytes = 0; + unsigned int idx = 0; + unsigned int lineidx = 0; + unsigned int stripXlines = 3; + + if(argc < 3) + exit(1); + if(NULL == (infile = fopen(argv[1], "rb"))) + exit(2); + if(NULL == (outfile = fopen(argv[2], "wb+"))) + exit(3); + if(argc > 3) + if(argv[3][0] == '-') + if(argv[3][1] == 'l') { + strcpy(argbuf, &argv[3][2]); + stripXlines = atoi(argbuf); + } + buffer = (char*)malloc(BUFFERSIZE); + if(buffer) { + while(!feof(infile)) { + /* read the file into the buffer. */ + bytes = fread(buffer, 1, BUFFERSIZE, infile); + if(lineidx < stripXlines) { + for(idx = 0; idx < bytes; idx++) { + if(buffer[idx] == '\n') { + lineidx++; + if(buffer[idx+1] == '\r') + idx++; + } + if(lineidx >= stripXlines) { + fwrite(&buffer[idx+1], 1, bytes-idx-1, outfile); + idx = bytes; + } + } + } + else + fwrite(buffer, 1, bytes, outfile); + } + free(buffer); + } + fclose(outfile); + fclose(infile); + + return 0; +} diff --git a/acsite.m4 b/acsite.m4 index 0ed8781..eaab535 100644 --- a/acsite.m4 +++ b/acsite.m4 @@ -19,6 +19,41 @@ dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- dnl ------------------------------------------------------------------------- +dnl _AC_SYS_LARGEFILE_MACRO_VALUE +dnl +dnl The following macro overrides the autoconf macro of the same name +dnl with this custom definition. This macro performs the same checks as +dnl autoconf's native _AC_SYS_LARGEFILE_MACRO_VALUE, but will also set +dnl AM_CPPFLAGS with the appropriate -D defines so additional configure +dnl sizeof checks do not fail. +dnl +# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, +# CACHE-VAR, +# DESCRIPTION, +# PROLOGUE, [FUNCTION-BODY]) +# ---------------------------------------------------------- +m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], +[AC_CACHE_CHECK([for $1 value needed for large files], [$3], +[while :; do + m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( + [AC_LANG_PROGRAM([$5], [$6])], + [$3=no; break]) + m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( + [AC_LANG_PROGRAM([@%:@define $1 $2 +$5], [$6])], + [$3=$2; break]) + $3=unknown + break +done]) +case $$3 in #( + no | unknown) ;; + *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]) + AM_CPPFLAGS="-D$1=$$3 $AM_CPPFLAGS";; +esac +rm -rf conftest*[]dnl +])# _AC_SYS_LARGEFILE_MACRO_VALUE + +dnl ------------------------------------------------------------------------- dnl AC_F9X_MODS() dnl dnl Check how F9X handles modules. This macro also checks which diff --git a/bin/buildhdf5 b/bin/buildhdf5 index ac73df0..8ed4696 100755 --- a/bin/buildhdf5 +++ b/bin/buildhdf5 @@ -67,6 +67,7 @@ TIMESTAMP() QUIT() { + # print the closing time TIMESTAMP } @@ -234,7 +235,7 @@ trap QUIT 0 # MAKE=${MAKE:-'gmake'} export MAKE -CONFIGURE="CONFIG" +CONFIG_CMD="CONFIG" CONFIG_OP= # configure options CONFIG_ONLY=no # default is configure and build NOEXEC= # default to execute commands @@ -250,6 +251,7 @@ while [ $# -gt 0 ]; do ;; -szlib) LOCATE_SZLIB + CONFIG_OP="$CONFIG_OP $WITH_SZLIB" ;; -help) USAGE @@ -263,16 +265,16 @@ while [ $# -gt 0 ]; do SRCDIRLIST="$1" ;; -cxx) - CONFIG_CXX="--enable-cxx" + CONFIG_OP="$CONFIG_OP --enable-cxx" ;; -fortran) - CONFIG_FORTRAN="--enable-fortran" + CONFIG_OP="$CONFIG_OP --enable-fortran" ;; -pp) - CONFIG_PARALLEL="--enable-parallel" + CONFIG_OP="$CONFIG_OP --enable-parallel" ;; - *) # Quit parsing - break + *) # pass it as a configure option + CONFIG_OP="$CONFIG_OP $1" ;; esac shift @@ -296,14 +298,10 @@ if [ x-$SRCDIR = x-dummy ]; then exit 1 fi -# Setup Configure options -CONFIG_OP="$WITH_SZLIB $CONFIG_FORTRAN $CONFIG_CXX $CONFIG_PARALLEL" - # Configure # no configure if already done. if [ ! -f config.status ]; then - CONFIGURE="$CONFIGURE $CONFIG_OP $*" - STEP "Configure HDF5..." "$CONFIGURE" "#config" + STEP "Configure HDF5..." "$CONFIG_CMD $CONFIG_OP" "#config" else STEP "Configure Skipped" "echo Configure Skipped" "#config" fi @@ -324,4 +322,3 @@ STEP "Testing HDF5 parallel parts..." "$MAKE check-p" "#test-p" # all done echo "No Errors encountered" -TIMESTAMP diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt new file mode 100644 index 0000000..b1edc06 --- /dev/null +++ b/c++/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_CPP) + +#----------------------------------------------------------------------------- +# Shared/Static Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (CPP_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Generate configure file +#----------------------------------------------------------------------------- +CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5cxx_config.h.in + ${HDF5_BINARY_DIR}/H5cxx_pubconf.h +) + +#----------------------------------------------------------------------------- +# Setup Include directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) + +#----------------------------------------------------------------------------- +# Parallel/MPI, prevent spurious cpp/cxx warnings +#----------------------------------------------------------------------------- +IF (H5_HAVE_PARALLEL) + ADD_DEFINITIONS ("-DMPICH_SKIP_MPICXX") + ADD_DEFINITIONS ("-DMPICH_IGNORE_CXX_SEEK") +ENDIF (H5_HAVE_PARALLEL) + +ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# Build the CPP Examples +#----------------------------------------------------------------------------- +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +#----------------------------------------------------------------------------- +# Build the CPP unit tests +#----------------------------------------------------------------------------- +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/c++/Makefile.in b/c++/Makefile.in index 2dfb03a..e82d4a1 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -199,12 +199,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt new file mode 100644 index 0000000..75644a8 --- /dev/null +++ b/c++/examples/CMakeLists.txt @@ -0,0 +1,37 @@ +cmake_minimum_required (VERSION 2.8) +# -------------------------------------------------------------------- +# Notes: When creating examples they should be prefixed +# with "cpp_ex_". This allows for easier filtering of the examples. +# -------------------------------------------------------------------- + +PROJECT (HDF5_CPP_EXAMPLES) + +#----------------------------------------------------------------------------- +# Define examples +#----------------------------------------------------------------------------- + +SET (examples + create + readdata + writedata + compound + extend_ds + chunks + h5group +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) + H5_NAMING (cpp_ex_${example}) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (cpp_ex_${example} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +ENDFOREACH (example ${examples}) diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 46a50c5..63ed0e9 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -165,12 +165,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt new file mode 100644 index 0000000..2cf3d7b --- /dev/null +++ b/c++/src/CMakeLists.txt @@ -0,0 +1,115 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_CPP_SRC) + +#----------------------------------------------------------------------------- +# Shared/Static Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (CPP_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Generate configure file +#----------------------------------------------------------------------------- +CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5cxx_config.h.in + ${HDF5_BINARY_DIR}/H5cxx_pubconf.h +) + +#----------------------------------------------------------------------------- +# Define cpp Library +#----------------------------------------------------------------------------- +SET (CPP_SRCS + ${HDF5_CPP_SOURCE_DIR}/src/H5AbstractDs.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5ArrayType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5AtomType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Attribute.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5CommonFG.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5CompType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSet.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSpace.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DataType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DcreatProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DxferProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5EnumType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Exception.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5FaccProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5FcreatProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5File.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5FloatType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Group.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5IdComponent.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5IntType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Library.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Object.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5PredType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5PropList.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5StrType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5VarLenType.cpp +) + +SET (CPP_HDRS + ${HDF5_CPP_SOURCE_DIR}/src/H5AbstractDs.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Alltypes.h + ${HDF5_CPP_SOURCE_DIR}/src/H5ArrayType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5AtomType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Attribute.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Classes.h + ${HDF5_CPP_SOURCE_DIR}/src/H5CommonFG.h + ${HDF5_CPP_SOURCE_DIR}/src/H5CompType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Cpp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5CppDoc.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSet.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSpace.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DataType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DcreatProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DxferProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5EnumType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Exception.h + ${HDF5_CPP_SOURCE_DIR}/src/H5FaccProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5FcreatProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5File.h + ${HDF5_CPP_SOURCE_DIR}/src/H5FloatType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Group.h + ${HDF5_CPP_SOURCE_DIR}/src/H5IdComponent.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Include.h + ${HDF5_CPP_SOURCE_DIR}/src/H5IntType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Library.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Object.h + ${HDF5_CPP_SOURCE_DIR}/src/H5PredType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5PropList.h + ${HDF5_CPP_SOURCE_DIR}/src/H5StrType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5VarLenType.h +) + +ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) +TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${CPP_HDRS} + DESTINATION + include/cpp + COMPONENT + cppheaders +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_CPP_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib COMPONENT cpplibraries + ARCHIVE DESTINATION lib COMPONENT cpplibraries + RUNTIME DESTINATION bin COMPONENT cpplibraries + ) +ENDIF (HDF5_EXPORTED_TARGETS) + diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 19eeb33..9cf1ee8 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -81,15 +81,26 @@ H5T_class_t AbstractDs::getTypeClass() const // Gets the class of the datatype and validate it before returning H5T_class_t type_class = H5Tget_class(datatype_id); - if( type_class != H5T_NO_CLASS ) - return( type_class ); - else + + // Close temporary datatype_id + herr_t ret_value = H5Tclose(datatype_id); + if (ret_value < 0) + { + if (fromClass() == "DataSet") + throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed"); + else if (fromClass() == "Attribute") + throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed"); + } + + // Check on the returned type_class + if (type_class == H5T_NO_CLASS) { if (fromClass() == "DataSet") throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); else if (fromClass() == "Attribute") throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); } + return(type_class); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index ef01105..1cac0c1 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -161,6 +161,10 @@ H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) // copy the id from rhs to this object, and increment the // reference counter of the id to indicate that another object // is referencing that id. +// Modification +// 2010/5/9 - BMR +// Removed close() and incRefCount() because setId/p_setId takes +// care of close() and setId takes care incRefCount(). // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent& IdComponent::operator=( const IdComponent& rhs ) @@ -169,16 +173,13 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs ) { // handling references to this id try { - close(); + setId(rhs.getId()); + // Note: a = b, so there are two objects with the same hdf5 id + // that's why incRefCount is needed, and it is called by setId } catch (Exception close_error) { throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); } - - // copy the data members from the rhs object - p_setId(rhs.getId()); - incRefCount(getId()); // a = b, so there are two objects with the same - // hdf5 id } return *this; } @@ -190,9 +191,8 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs ) ///\exception H5::IdComponentException when the attempt to close the HDF5 /// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// p_setId ensures that the current valid id of this object is +// properly closed before resetting the object's id to the new id. // Programmer Binh-Minh Ribler - 2000 // Modification // 2008/7/23 - BMR diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 579c8ac..2530204 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -66,29 +66,35 @@ PropList::PropList(const PropList& original) : IdComponent(original) ///\param plist_id - IN: Id of the existing property list ///\exception H5::PropListIException // Description -// This function calls H5Pcreate to create a new property list -// if the given id, plist_id, is that of a property class. If -// the given id is equal to H5P_ROOT, then set this -// property's id to H5P_DEFAULT, otherwise, to the given id. -// Note: someone else added this code without comments and this -// description was what I came up with from reading the code. +// This function creates a new property list if a property +// class is provided or makes a copy of a property list if one +// is given. If the given id is anything else, then set this +// property's id to H5P_DEFAULT. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PropList::PropList( const hid_t plist_id ) : IdComponent() { - if (H5I_GENPROP_CLS == H5Iget_type(plist_id)) { - // call C routine to create the new property - id = H5Pcreate(plist_id); - if( id < 0 ) - { - throw PropListIException("PropList constructor", "H5Pcreate failed"); - } - } - else { - if(plist_id==H5P_ROOT) - id=H5P_DEFAULT; - else - id=plist_id; + H5I_type_t id_type = H5Iget_type(plist_id); + switch (id_type) { + case H5I_GENPROP_CLS: + // call C routine to create a new property from the given prop class + id = H5Pcreate(plist_id); + if( id < 0 ) + { + throw PropListIException("PropList constructor", "H5Pcreate failed"); + } + break; + case H5I_GENPROP_LST: + // call C routine to make a copy of the given property list + id = H5Pcopy(plist_id); + if( id < 0 ) + { + throw PropListIException("PropList constructor", "H5Pcopy failed"); + } + break; + default: + id = H5P_DEFAULT; + break; } } diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 2c595fc..5ee5f64 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -221,12 +221,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ @@ -390,7 +390,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 59 +LT_VERS_REVISION = 63 LT_VERS_AGE = 0 # Include src directory diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt new file mode 100644 index 0000000..770348e --- /dev/null +++ b/c++/test/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required (VERSION 2.8) +# -------------------------------------------------------------------- +# Notes: When creating unit test executables they should be prefixed +# with "cpp_". This allows for easier filtering of the test suite when +# using ctest. An example would be +# ctest -R cpp_ +# which would only run the C++ based unit tests. +# -------------------------------------------------------------------- + +PROJECT (HDF5_CPP_TEST) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (CPP_TEST_SRCS + ${HDF5_CPP_TEST_SOURCE_DIR}/testhdf5.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tattr.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tcompound.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tfile.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tfilter.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/th5s.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tlinks.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/trefer.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/ttypes.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tvlstr.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/dsets.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/h5cpputil.cpp +) + +#----------------------------------------------------------------------------- +# Generate the H5srcdir_str.h file containing user settings needed by compilation +#----------------------------------------------------------------------------- +SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +CONFIGURE_FILE (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) + +INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR} ) + +ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) +H5_NAMING (cpp_testhdf5) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (cpp_testhdf5 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (cpp_testhdf5 + ${HDF5_CPP_LIB_TARGET} + ${HDF5_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} +) + +ADD_TEST (NAME cpp_testhdf5 COMMAND $) diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 0945169..9e68dcd 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -188,12 +188,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/config/ibm-aix b/config/ibm-aix index 954dc7f..8b6a5a3 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -19,7 +19,6 @@ # the various compile modes. # Use AIX supplied C compiler by default, xlc for serial, mpcc_r for parallel. -# Use -D_LARGE_FILES by default to support large file size. # Make sure this is applied to other API compile options such as C++. if test "X-" = "X-$CC"; then if test "X-$enable_parallel" = "X-yes"; then @@ -44,19 +43,7 @@ fi case $CC_BASENAME in xlc|xlc-*|mpcc_r|mpcc_r-*) - # Turn off shared lib option. It causes some test suite to fail. - enable_shared="${enable_shared:-no}" - # Use -D_LARGE_FILES by default to support large file size. - # Make sure this is applied to other API compile options such as C++. - AM_CFLAGS="-D_LARGE_FILES $AM_CFLAGS" - H5_CFLAGS="-qlanglvl=stdc99 $H5_CFLAGS" - DEBUG_CFLAGS="-g -qfullpath" - DEBUG_CPPFLAGS= - # -O causes test/dtypes to fail badly. Turn it off for now. - PROD_CFLAGS="" - PROD_CPPFLAGS= - PROFILE_CFLAGS="-g -qfullpath -pg" - PROFILE_CPPFLAGS= + . $srcdir/config/ibm-flags ;; gcc) @@ -122,10 +109,6 @@ ac_cv_sizeof_uint_fast64_t=${ac_cv_sizeof_uint_fast64_t=8} # Don't cache long since it varies between 32 and 64 bits #ac_cv_sizeof_long=${ac_cv_sizeof_long=4} -# Don't cache size_t and off_t because they depend on if -D_LARGE_FILES is used -#ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4} -#ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8} - # The default Fortran 90 compiler if test "X-" = "X-$FC"; then @@ -164,8 +147,7 @@ CXX=${CXX=xlC} # Added -qweaksymbol to suppress linker messages warning of duplicate # symbols; these warnings are harmless. - BMR -# Use -D_LARGE_FILES by default to support large file size. H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol" -AM_CXXFLAGS="$AM_CXXFLAGS -D_LARGE_FILES" +AM_CXXFLAGS="$AM_CXXFLAGS" diff --git a/config/ibm-flags b/config/ibm-flags new file mode 100644 index 0000000..9e63f79 --- /dev/null +++ b/config/ibm-flags @@ -0,0 +1,77 @@ +# -*- shell-script -*- +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from help@hdfgroup.org. + + +# This file should be sourced into configure if the compiler is the +# IBM XL compiler or a derivative. It is careful not to do anything +# if the compiler is not IBM; otherwise `cc_flags_set' is set to `yes' +# + +# Get the compiler version in a way that works for pgcc +# pgcc unless a compiler version is already known +# +# cc_vendor: The compiler product name: XL +# cc_version: Version number: 10.1 +# cc_version_info: More descriptive version information +# +if test X = "X$cc_flags_set"; then + # Verify this is an IBM XL compiler + cc_version="`$CC $CFLAGS -qversion 2>&1 | grep '^IBM XL C/C++'`" + if test X != "X$cc_version"; then + cc_vendor="XL" + cc_version="`$CC $CFLAGS -qversion 2>&1 | sed -n 's/Version: \([0-9\.]*\).*/\1/p'`" + cc_version_info="IBM XL C/C++ $cc_version" + echo "compiler '$CC' is IBM $cc_vendor-$cc_version" + + # Some more version numbers. + # XL version numbers are of the form: "major.minor.X.Y" + # (Need to find out the official meaning of the 4 components.) + cc_vers_major=`echo $cc_version | cut -f1 -d.` + cc_vers_minor=`echo $cc_version | cut -f2 -d.` + cc_vers_patch=`echo $cc_version | cut -f3 -d.` + test -n "$cc_vers_major" || cc_vers_major=0 + test -n "$cc_vers_minor" || cc_vers_minor=0 + test -n "$cc_vers_patch" || cc_vers_patch=0 + cc_vers_all=`expr \( \( $cc_vers_major \* 100 + $cc_vers_minor \) \* 100 \) + $cc_vers_patch` + fi +fi + +# Common XL flags for various situations +if test "XL" = "$cc_vendor"; then + # Insert section about version specific problems from gnu-flags here, if + # necessary. + + # Turn off shared lib option. It causes some test suite to fail. + enable_shared="${enable_shared:-no}" + # Make sure this is applied to other API compile options such as C++. + AM_CFLAGS="$AM_CFLAGS" + H5_CFLAGS="-qlanglvl=stdc99 $H5_CFLAGS" + DEBUG_CFLAGS="-g -qfullpath" + DEBUG_CPPFLAGS= + # -O causes test/dtypes to fail badly. Turn it off for now. + PROD_CFLAGS="" + PROD_CPPFLAGS= + PROFILE_CFLAGS="-g -qfullpath -pg" + PROFILE_CPPFLAGS= + # Flags are set + cc_flags_set=yes +fi + +# Clear cc info if no flags set +if test "X-$cc_flags_set" = "X-"; then + cc_vendor= + cc_version= + cc_version_info= +fi diff --git a/config/lt_vers.am b/config/lt_vers.am index 766e2e3..71fa126 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 59 +LT_VERS_REVISION = 63 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/config/powerpc-ibm-aix5.x b/config/powerpc-ibm-aix5.x index 96ad26a..aecbf33 100644 --- a/config/powerpc-ibm-aix5.x +++ b/config/powerpc-ibm-aix5.x @@ -19,7 +19,6 @@ # the various compile modes. # Use AIX supplied C compiler by default, xlc for serial, mpcc_r for parallel. -# Use -D_LARGE_FILES by default to support large file size. # Make sure this is applied to other API compile options such as C++. if test "X-" = "X-$CC"; then if test "X-$enable_parallel" = "X-yes"; then @@ -46,9 +45,8 @@ case $CC_BASENAME in xlc|xlc-*|mpcc_r|mpcc_r-*) # Turn off shared lib option. It causes some test suite to fail. enable_shared="${enable_shared:-no}" - # Use -D_LARGE_FILES by default to support large file size. # Make sure this is applied to other API compile options such as C++. - AM_CFLAGS="-D_LARGE_FILES $AM_CFLAGS" + AM_CFLAGS="$AM_CFLAGS" H5_CFLAGS="-qlanglvl=stdc99 $H5_CFLAGS" DEBUG_CFLAGS="-g -qfullpath" DEBUG_CPPFLAGS= @@ -121,10 +119,6 @@ ac_cv_sizeof_uint_fast64_t=${ac_cv_sizeof_uint_fast64_t=8} # Don't cache long since it varies between 32 and 64 bits #ac_cv_sizeof_long=${ac_cv_sizeof_long=4} -# Don't cache size_t and off_t because they depend on if -D_LARGE_FILES is used -#ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4} -#ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8} - # The default Fortran 90 compiler if test "X-" = "X-$FC"; then @@ -163,8 +157,7 @@ CXX=${CXX=xlC} # Added -qweaksymbol to suppress linker messages warning of duplicate # symbols; these warnings are harmless. - BMR -# Use -D_LARGE_FILES by default to support large file size. H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol" -AM_CXXFLAGS="$AM_CXXFLAGS -D_LARGE_FILES" +AM_CXXFLAGS="$AM_CXXFLAGS" diff --git a/configure b/configure index 8ec567c..948fd87 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 18639 2010-04-27 20:06:15Z koziol . +# From configure.in Id: configure.in 18708 2010-05-05 17:18:50Z koziol . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for HDF5 1.9.68-FA_a4. +# Generated by GNU Autoconf 2.65 for HDF5 1.9.73-FA_a4. # # Report bugs to . # @@ -702,8 +702,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.68-FA_a4' -PACKAGE_STRING='HDF5 1.9.68-FA_a4' +PACKAGE_VERSION='1.9.73-FA_a4' +PACKAGE_STRING='HDF5 1.9.73-FA_a4' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -880,7 +880,7 @@ DIRECT_VFD HAVE_DMALLOC CODESTACK INSTRUMENT -LINUX_LFS +LARGEFILE GPFS HDF5_HL CXX @@ -988,7 +988,7 @@ enable_libtool_lock enable_static_exec enable_sharedlib_rpath enable_production -enable_linux_lfs +enable_largefile with_fnord with_dmalloc with_zlib @@ -1574,7 +1574,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.68-FA_a4 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.73-FA_a4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1644,7 +1644,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.68-FA_a4:";; + short | recursive ) echo "Configuration of HDF5 1.9.73-FA_a4:";; esac cat <<\_ACEOF @@ -1668,8 +1668,7 @@ Optional Features: --disable-sharedlib-rpath Disable use of the '=Wl,-rpath' linker option --enable-production Determines how to run the compiler. - --enable-linux-lfs Enable support for large (64-bit) files on Linux. - [default=check] + --disable-largefile omit support for large files --enable-threadsafe Enable thread safe capability --enable-gpfs Enable GPFS hints for the MPI/POSIX file driver. [default=no] @@ -1831,7 +1830,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.68-FA_a4 +HDF5 configure 1.9.73-FA_a4 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2915,7 +2914,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.68-FA_a4, which was +It was created by HDF5 $as_me 1.9.73-FA_a4, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -3728,7 +3727,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.68-FA_a4' + VERSION='1.9.73-FA_a4' cat >>confdefs.h <<_ACEOF @@ -3927,7 +3926,7 @@ $as_echo "done" >&6; } HDF_CXX=no HDF5_HL=yes GPFS=no - LINUX_LFS=no + LARGEFILE=yes CODESTACK=no HAVE_DMALLOC=no @@ -7398,8 +7397,8 @@ fi case "$CC_BASENAME" in mpicc) PARALLEL=mpicc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpirun" >&5 -$as_echo_n "checking for mpirun... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpiexec" >&5 +$as_echo_n "checking for mpiexec... " >&6; } cmd="`echo $CC | cut -f1 -d' '`" if (echo $cmd | grep / >/dev/null); then @@ -7412,13 +7411,13 @@ $as_echo_n "checking for mpirun... " >&6; } done fi - if test -x $path/mpirun; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path/mpirun" >&5 -$as_echo "$path/mpirun" >&6; } + if test -x $path/mpiexec; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path/mpiexec" >&5 +$as_echo "$path/mpiexec" >&6; } RUNSERIAL="${RUNSERIAL:-none}" if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpirun -np \$\${NPROCS:=3}" + RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=3}" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 @@ -7497,8 +7496,8 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu case "$FC" in *mpif90*) PARALLEL=mpif90 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpirun" >&5 -$as_echo_n "checking for mpirun... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpiexec" >&5 +$as_echo_n "checking for mpiexec... " >&6; } cmd=`echo $FC |cut -f1 -d' '` if (echo $cmd |grep / >/dev/null); then @@ -7511,13 +7510,13 @@ $as_echo_n "checking for mpirun... " >&6; } done fi - if test -x $path/mpirun; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path/mpirun" >&5 -$as_echo "$path/mpirun" >&6; } + if test -x $path/mpiexec; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path/mpiexec" >&5 +$as_echo "$path/mpiexec" >&6; } RUNSERIAL="${RUNSERIAL:-none}" if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpirun -np \$\${NPROCS:=2}" + RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=2}" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 @@ -8248,13 +8247,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:8251: $ac_compile\"" >&5) + (eval echo "\"\$as_me:8250: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:8254: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:8253: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:8257: output\"" >&5) + (eval echo "\"\$as_me:8256: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -9459,7 +9458,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 9462 "configure"' > conftest.$ac_ext + echo '#line 9461 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -11778,11 +11777,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11781: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11780: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11785: \$? = $ac_status" >&5 + echo "$as_me:11784: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12117,11 +12116,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12120: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12119: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12124: \$? = $ac_status" >&5 + echo "$as_me:12123: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12222,11 +12221,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12225: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12224: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12229: \$? = $ac_status" >&5 + echo "$as_me:12228: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12277,11 +12276,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12280: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12279: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12284: \$? = $ac_status" >&5 + echo "$as_me:12283: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14708,7 +14707,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14711 "configure" +#line 14710 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14804,7 +14803,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14807 "configure" +#line 14806 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16776,11 +16775,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16779: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16778: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16783: \$? = $ac_status" >&5 + echo "$as_me:16782: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16875,11 +16874,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16878: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16877: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16882: \$? = $ac_status" >&5 + echo "$as_me:16881: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16927,11 +16926,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16930: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16929: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16934: \$? = $ac_status" >&5 + echo "$as_me:16933: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18444,11 +18443,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18447: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18446: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18451: \$? = $ac_status" >&5 + echo "$as_me:18450: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -18543,11 +18542,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18546: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18545: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18550: \$? = $ac_status" >&5 + echo "$as_me:18549: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18595,11 +18594,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18598: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18597: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18602: \$? = $ac_status" >&5 + echo "$as_me:18601: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21178,43 +21177,320 @@ done ;; esac -case "$host_cpu-$host_vendor-$host_os" in - *linux*) - # Check whether --enable-linux-lfs was given. -if test "${enable_linux_lfs+set}" = set; then : - enableval=$enable_linux_lfs; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if configure should try to set up large file support" >&5 +$as_echo_n "checking if configure should try to set up large file support... " >&6; } + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; fi - LINUX_LFS="no" - case "X-$enable_linux_lfs" in - X-yes) - LINUX_LFS=yes - ;; - X-no) - ;; - X-|*) - MAJOR_VER="`uname -r | cut -d '.' -f1`" - MINOR_VER="`uname -r | cut -d '.' -f2`" +if test "$enable_largefile" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } - if test ${MAJOR_VER} -gt 2 -o ${MAJOR_VER} -eq 2 -a ${MINOR_VER} -ge 4; then - LINUX_LFS="yes" - fi - ;; - esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for large file support mode on Linux" >&5 -$as_echo_n "checking for large file support mode on Linux... " >&6; } - if test "X$LINUX_LFS" = "Xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 -$as_echo "enabled" >&6; } - AM_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ - H5_CPPFLAGS="-D_POSIX_SOURCE $H5_CPPFLAGS" + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF + + AM_CPPFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits $AM_CPPFLAGS";; +esac +rm -rf conftest* + + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF + + AM_CPPFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $AM_CPPFLAGS";; +esac +rm -rf conftest* + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if large (64-bit) files are supported on this system." >&5 +$as_echo_n "checking if large (64-bit) files are supported on this system.... " >&6; } + if test "${hdf5_cv_have_lfs+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + #define BIG_FILE (off_t)0x80000000UL + int main(void) { + int fd; + if ((fd=open("test.conf", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) exit(1); + if (lseek(fd, BIG_FILE, SEEK_SET)!=BIG_FILE) exit(1); + if (5!=write(fd, "hello", (size_t)5)) exit(1); + if (lseek(fd, 2*BIG_FILE, SEEK_SET) != 2*BIG_FILE) exit(1); + if (5!=write(fd, "hello", (size_t)5)) exit(1); + if (unlink("test.conf") < 0) exit(1); + exit(0); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + hdf5_cv_have_lfs=yes +else + hdf5_cv_have_lfs=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + + + if test "X${hdf5_cv_have_lfs}" = "Xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LARGEFILE="yes" + fi + if test "X${hdf5_cv_have_lfs}" = "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + LARGEFILE="no" + fi + +else + LARGEFILE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + if test "X$LARGEFILE" != "Xno"; then + AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" + fi + + H5_CPPFLAGS="-D_POSIX_SOURCE $H5_CPPFLAGS" AM_CPPFLAGS="-D_BSD_SOURCE $AM_CPPFLAGS" ;; @@ -24825,7 +25101,20 @@ _ACEOF fi done -for ac_func in gethostname getpwuid getrusage longjmp lstat +for ac_func in gethostname getpwuid getrusage lstat +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in rand_r random setsysinfo do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -24838,7 +25127,7 @@ _ACEOF fi done -for ac_func in rand_r random setsysinfo siglongjmp signal +for ac_func in signal longjmp setjmp siglongjmp sigsetjmp sigprocmask do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -26094,7 +26383,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then - RUNPARALLEL="mpirun -np \$\${NPROCS:=3}" + RUNPARALLEL="mpiexec -n \$\${NPROCS:=3}" fi ;; @@ -27594,6 +27883,9 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + #include + int main(void) { /* General variables */ @@ -28919,7 +29211,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.68-FA_a4, which was +This file was extended by HDF5 $as_me 1.9.73-FA_a4, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -28985,7 +29277,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.68-FA_a4 +HDF5 config.status 1.9.73-FA_a4 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index d069c94..7728fc3 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.69-FA_a4], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.73-FA_a4], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) @@ -157,7 +157,7 @@ dnl HDF_CXX: whether C++ is enabled. Default no. dnl CXX: C++ compiler. dnl HDF5_HL: whether high-level library is enabled. Default is yes. dnl GPFS: whether gpfs is enabled. Default no. -dnl LINUX_LFS: whether LINUX_LFS is enabled. Default no. +dnl LARGEFILE: whether largefile support is enabled. Default yes. dnl INSTRUMENT: whether INSTRUMENT is enabled. No default set here. dnl CODESTACK: whether CODESTACK is enabled. Default no. dnl HAVE_DMALLOC: whether system has dmalloc support. Default no. @@ -177,7 +177,7 @@ AC_SUBST(HDF_CXX) HDF_CXX=no AC_SUBST(CXX) HDF_CXX=no AC_SUBST(HDF5_HL) HDF5_HL=yes AC_SUBST(GPFS) GPFS=no -AC_SUBST(LINUX_LFS) LINUX_LFS=no +AC_SUBST(LARGEFILE) LARGEFILE=yes AC_SUBST(INSTRUMENT) AC_SUBST(CODESTACK) CODESTACK=no AC_SUBST(HAVE_DMALLOC) HAVE_DMALLOC=no @@ -681,7 +681,7 @@ dnl RUNSERIAL -- This is a command which will be prepended to dnl the executable name to run the executable using dnl a single process. For serial versions of the dnl library this will normally be empty. For parallel -dnl versions it might be something like `mpirun -np 1'. +dnl versions it might be something like `mpiexec -n 1'. dnl The value of this variable is substituted in *.in dnl files. dnl @@ -706,15 +706,15 @@ dnl ---------------------------------------------------------------------- dnl If the compiler is obviously a parallel compiler then we're building dnl a parallel version of hdf5 and should define HAVE_PARALLEL. Furthermore, dnl the name of the compiler might tell us how to run the resulting -dnl executable. For `mpicc' the executable should be run with `mpirun' from +dnl executable. For `mpicc' the executable should be run with `mpiexec' from dnl the same directory as mpicc if it exists. dnl case "$CC_BASENAME" in mpicc) - dnl The mpich compiler. Use mpirun from the same directory if it + dnl The mpich compiler. Use mpiexec from the same directory if it dnl exists. PARALLEL=mpicc - AC_MSG_CHECKING([for mpirun]) + AC_MSG_CHECKING([for mpiexec]) dnl Find the path where mpicc is located. cmd="`echo $CC | cut -f1 -d' '`" @@ -728,13 +728,13 @@ case "$CC_BASENAME" in done fi - dnl Is there an mpirun at that path? - if test -x $path/mpirun; then - AC_MSG_RESULT([$path/mpirun]) + dnl Is there an mpiexec at that path? + if test -x $path/mpiexec; then + AC_MSG_RESULT([$path/mpiexec]) RUNSERIAL="${RUNSERIAL:-none}" if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpirun -np \$\${NPROCS:=3}" + RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=3}" fi else AC_MSG_RESULT([none]) @@ -811,7 +811,7 @@ dnl If the Fortran compiler is obviously a parallel compiler then we're dnl building a parallel version of hdf5 and should define HAVE_PARALLEL. dnl Furthermore, the name of the compiler might tell us how to run the dnl resulting executable. For `mpif90' the executable should be run with -dnl `mpirun' from the same directory as mpif90 if it exists. +dnl `mpiexec' from the same directory as mpif90 if it exists. dnl if test "X$HDF_FORTRAN" = "Xyes"; then dnl Change to the Fortran 90 language @@ -819,10 +819,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then case "$FC" in *mpif90*) - dnl The Fortran mpich compiler. Use mpirun from the same directory + dnl The Fortran mpich compiler. Use mpiexec from the same directory dnl if it exists. PARALLEL=mpif90 - AC_MSG_CHECKING([for mpirun]) + AC_MSG_CHECKING([for mpiexec]) dnl Find the path where mpif90 is located. cmd=`echo $FC |cut -f1 -d' '` @@ -836,13 +836,13 @@ if test "X$HDF_FORTRAN" = "Xyes"; then done fi - dnl Is there an mpirun at that path? - if test -x $path/mpirun; then - AC_MSG_RESULT([$path/mpirun]) + dnl Is there an mpiexec at that path? + if test -x $path/mpiexec; then + AC_MSG_RESULT([$path/mpiexec]) RUNSERIAL="${RUNSERIAL:-none}" if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpirun -np \$\${NPROCS:=2}" + RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=2}" fi else AC_MSG_RESULT([none]) @@ -1260,47 +1260,123 @@ case "$host" in esac dnl ---------------------------------------------------------------------- -dnl Test for 64bit stuff before the data types and their sizes. The -dnl result could effect the outcome of the sizeof macros below. +dnl Test for Largefile support. dnl -case "$host_cpu-$host_vendor-$host_os" in - *linux*) - dnl ---------------------------------------------------------------------- - dnl Enable large file support on linux? Store the result in the LINUX_LFS - dnl variable for posterity - AC_ARG_ENABLE([linux-lfs], - [AC_HELP_STRING([--enable-linux-lfs], - [Enable support for large (64-bit) - files on Linux. [default=check]])]) - - LINUX_LFS="no" - case "X-$enable_linux_lfs" in - X-yes) - LINUX_LFS=yes - ;; - X-no) - ;; - X-|*) - MAJOR_VER="`uname -r | cut -d '.' -f1`" - MINOR_VER="`uname -r | cut -d '.' -f2`" +AC_MSG_CHECKING([if configure should try to set up large file support]) + +AC_ARG_ENABLE([largefile], + [AC_HELP_STRING([--disable-largefile], + [omit support for large files])]) + +dnl If largefile support is enabled, then set up appropriate compiler options. +if test "$enable_largefile" != no; then + AC_MSG_RESULT(yes) + + dnl Check for needed compiler options. This check is pulled drectly + dnl from autoconf's AC_SYS_LARGEFILE macro, as of Autoconf v2.65. + AC_CACHE_CHECK([for special C compiler options needed for large files], + ac_cv_sys_largefile_CC, + [ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])]) + AC_COMPILE_IFELSE([], [break]) + CC="$CC -n32" + AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi]) + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi - if test ${MAJOR_VER} -gt 2 -o ${MAJOR_VER} -eq 2 -a ${MINOR_VER} -ge 4; then - LINUX_LFS="yes" - fi - ;; - esac + dnl Use the macro _AC_SYS_LARGEFILE_MACRO_VALUE to test defines + dnl that might need to be set for largefile support to behave + dnl correctly. This macro is defined in acsite.m4 and overrides + dnl the version provided by Autoconf (as of v2.65). The custom + dnl macro additionally adds the appropriate defines to AM_CPPFLAGS + dnl so that later configure checks have them visible. + + dnl Check for _FILE_OFFSET_BITS + _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + [_AC_SYS_LARGEFILE_TEST_INCLUDES]) + + dnl Check for _LARGE_FILES + if test $ac_cv_sys_file_offset_bits = unknown; then + _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + [_AC_SYS_LARGEFILE_TEST_INCLUDES]) + fi - AC_MSG_CHECKING([for large file support mode on Linux]) - if test "X$LINUX_LFS" = "Xyes"; then - AC_MSG_RESULT([enabled]) - AM_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" - else - AC_MSG_RESULT([disabled]) + dnl Now actually test to see if we can create large files after we've + dnl checked for any needed defines. + AC_MSG_CHECKING([if large (64-bit) files are supported on this system.]) + AC_CACHE_VAL([hdf5_cv_have_lfs], + [AC_TRY_RUN([ + #include + #include + #include + #include + #define BIG_FILE (off_t)0x80000000UL + int main(void) { + int fd; + if ((fd=open("test.conf", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) exit(1); + if (lseek(fd, BIG_FILE, SEEK_SET)!=BIG_FILE) exit(1); + if (5!=write(fd, "hello", (size_t)5)) exit(1); + if (lseek(fd, 2*BIG_FILE, SEEK_SET) != 2*BIG_FILE) exit(1); + if (5!=write(fd, "hello", (size_t)5)) exit(1); + if (unlink("test.conf") < 0) exit(1); + exit(0); + } + ],[hdf5_cv_have_lfs=yes],[hdf5_cv_have_lfs=no],)]) + + if test "X${hdf5_cv_have_lfs}" = "Xyes"; then + AC_MSG_RESULT([yes]) + LARGEFILE="yes" + fi + if test "X${hdf5_cv_have_lfs}" = "Xno"; then + AC_MSG_RESULT([no]) + LARGEFILE="no" + fi + +else + LARGEFILE="no" + AC_MSG_RESULT(no) +fi + +dnl ---------------------------------------------------------------------- +dnl Add necessary defines for Linux Systems. +dnl +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + dnl If largefile support is enabled, then make available various + dnl LFS-related routines using the following _LARGEFILE*_SOURCE macros. + if test "X$LARGEFILE" != "Xno"; then + AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" fi dnl Add POSIX support on Linux systems, so defines dnl __USE_POSIX, which is required to get the prototype for fdopen - dnl defined correctly in + dnl defined correctly in . + dnl This flag was removed from h5cc as of 2009-10-17 when it was found + dnl that the flag broke compiling netCDF-4 code with h5cc, but kept in + dnl H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen + dnl is used only by H5_debug_mask which is used only when debugging in + dnl H5_init_library (all in H5.c). When the flag was removed this was + dnl the only compile failure noted; however, defining the Macro + dnl makes available the functionality from the POSIX.1 standard as well + dnl as all or the ISO C facilities, according to a discussion of + dnl defining the _POSIX_SOURCE, _BSD_SOURCE, and _POSIX_C_SOURCE Macros + dnl and their interaction found at + dnl http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html. H5_CPPFLAGS="-D_POSIX_SOURCE $H5_CPPFLAGS" dnl Also add BSD support on Linux systems, so defines @@ -2517,9 +2593,9 @@ case "X-$enable_parallel" in AC_LANG_POP(Fortran) fi - dnl Set RUNPARALLEL to mpirun if not set yet. + dnl Set RUNPARALLEL to mpiexec if not set yet. dnl Check for building on Cray if RUNPARALLEL is not yet set by checking - dnl for 'aprun' command (which is the parallel job launcher, like mpirun). + dnl for 'aprun' command (which is the parallel job launcher, like mpiexec). if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then dnl Find the path where aprun is located. for path in `echo $PATH | ${TR} ":" " "`; do @@ -2530,9 +2606,9 @@ case "X-$enable_parallel" in done fi - dnl Set RUNPARALLEL to mpirun if not set yet. + dnl Set RUNPARALLEL to mpiexec if not set yet. if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then - RUNPARALLEL="mpirun -np \$\${NPROCS:=3}" + RUNPARALLEL="mpiexec -n \$\${NPROCS:=3}" fi ;; diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..446bc7e --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_EXAMPLES) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (examples + h5_write + h5_read + h5_extend_write + h5_chunk_read + h5_compound + h5_group + h5_select + h5_attribute + h5_mount + h5_reference + h5_drivers + h5_ref2reg + h5_extlink + h5_elink_unix2win + h5_shared_mesg +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) + H5_NAMING (${example}) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${example} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) +ENDFOREACH (example ${examples}) + +IF (H5_HAVE_PARALLEL) + ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) + H5_NAMING (ph5example) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (ph5example + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) +ENDIF (H5_HAVE_PARALLEL) diff --git a/examples/Makefile.in b/examples/Makefile.in index 04c5f2d..130aff9 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -165,12 +165,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt new file mode 100644 index 0000000..9fc9ba0 --- /dev/null +++ b/fortran/CMakeLists.txt @@ -0,0 +1,152 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_F90 C CXX Fortran) + +#----------------------------------------------------------------------------- +# Detect name mangling convention used between Fortran and C +#----------------------------------------------------------------------------- +INCLUDE (FortranCInterface) +FortranCInterface_HEADER ( + ${HDF5_F90_BINARY_DIR}/FCMangle.h + MACRO_NAMESPACE "H5_FC_" + SYMBOL_NAMESPACE "H5_FC_" + SYMBOLS mysub mymod:my_sub +) + +FILE (STRINGS ${HDF5_F90_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") +STRING (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}" PARENT_SCOPE) + +FILE (STRINGS ${HDF5_F90_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)") +STRING (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}" PARENT_SCOPE) + +#----------------------------------------------------------------------------- +# The provided CMake Fortran macros don't provide a general check function +# so this one is used for a sizeof test. +#----------------------------------------------------------------------------- +MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) + IF (NOT DEFINED ${VARIABLE}) + MESSAGE (STATUS "Testing Fortran ${FUNCTION}") + IF (CMAKE_REQUIRED_LIBRARIES) + SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + ELSE (CMAKE_REQUIRED_LIBRARIES) + SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + ENDIF (CMAKE_REQUIRED_LIBRARIES) + FILE (WRITE + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f + "${CODE}" + ) + TRY_COMPILE (${VARIABLE} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f + CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + +# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# MESSAGE ( "Test result ${OUTPUT}") +# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + + IF (${VARIABLE}) + SET (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") + MESSAGE (STATUS "Testing Fortran ${FUNCTION} - OK") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" + "${OUTPUT}\n\n" + ) + ELSE (${VARIABLE}) + MESSAGE (STATUS "Testing Fortran ${FUNCTION} - Fail") + SET (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" + "${OUTPUT}\n\n") + ENDIF (${VARIABLE}) + ENDIF (NOT DEFINED ${VARIABLE}) +ENDMACRO (CHECK_FORTRAN_FEATURE) + +#----------------------------------------------------------------------------- +# Configure Checks which require Fortran compilation must go in here +# not in the main ConfigureChecks.cmake files, because if the user has +# no Fortran compiler, problems arise. +# +# Be careful with leading spaces here, do not remove them. +#----------------------------------------------------------------------------- +CHECK_FORTRAN_FEATURE(sizeof + " + PROGRAM main + i = sizeof(x) + END PROGRAM + " + FORTRAN_HAVE_SIZEOF +) + +CHECK_FORTRAN_FEATURE(RealIsNotDouble + " + MODULE type_mod + INTERFACE h5t + MODULE PROCEDURE h5t_real + MODULE PROCEDURE h5t_dble + END INTERFACE + CONTAINS + SUBROUTINE h5t_real(r) + REAL :: r + END SUBROUTINE h5t_real + SUBROUTINE h5t_dble(d) + DOUBLE PRECISION :: d + END SUBROUTINE h5t_dble + END MODULE type_mod + PROGRAM main + USE type_mod + REAL :: r + DOUBLE PRECISION :: d + CALL h5t(r) + CALL h5t(d) + END PROGRAM main + " + FORTRAN_DEFAULT_REAL_NOT_DOUBLE +) + +#----------------------------------------------------------------------------- +# Make sure generated files and modules are picked up correctly +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ) + +#----------------------------------------------------------------------------- +# Add debug information (intel Fortran : JB) +#----------------------------------------------------------------------------- +IF (CMAKE_Fortran_COMPILER MATCHES ifort) + IF (WIN32) + SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + ENDIF (WIN32) +ENDIF (CMAKE_Fortran_COMPILER MATCHES ifort) + +#----------------------------------------------------------------------------- +# Traverse source subdirectory +#----------------------------------------------------------------------------- +ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# When building utility executables we reuse these variables +#----------------------------------------------------------------------------- +#inherit EXE_EXT from parent HDF5 cmake project +#inherit MAKE_SYSTEM from parent HDF5 cmake project +#inherit CFG_INIT from parent HDF5 cmake project + +#----------------------------------------------------------------------------- +# Build the Fortran Examples +#----------------------------------------------------------------------------- +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +#----------------------------------------------------------------------------- +# Testing +#----------------------------------------------------------------------------- +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 1a1be60..be785e9 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -203,12 +203,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt new file mode 100644 index 0000000..f8a453e --- /dev/null +++ b/fortran/examples/CMakeLists.txt @@ -0,0 +1,68 @@ +cmake_minimum_required (VERSION 2.8) +# -------------------------------------------------------------------- +# Notes: When creating examples they should be prefixed +# with "f90_ex_". This allows for easier filtering of the examples. +# -------------------------------------------------------------------- +PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (examples + dsetexample + fileexample + rwdsetexample + attrexample + groupexample + grpsexample + grpdsetexample + hyperslab + selectele + grpit + refobjexample + refregexample + mountexample + compound +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + H5_NAMING (f90_ex_${example}) + IF (WIN32) + IF (BUILD_SHARED_LIBS) + IF (MSVC) + SET_TARGET_PROPERTIES (f90_ex_${example} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ELSE (BUILD_SHARED_LIBS) + IF (MSVC) + SET_TARGET_PROPERTIES (f90_ex_${example} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET f90_ex_${example} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) + SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (f90_ex_${example} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) +ENDFOREACH (example ${examples}) diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 7a92157..2ac6630 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -165,12 +165,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt new file mode 100644 index 0000000..c2ca1e6 --- /dev/null +++ b/fortran/src/CMakeLists.txt @@ -0,0 +1,254 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_F90_SRC C CXX Fortran) + +#----------------------------------------------------------------------------- +# When building utility executables that generate other (source) files : +# we make use of the following variables defined in the root CMakeLists. +# Certain systems may add /Debug or /Release to output paths +# and we need to call the executable from inside the CMake configuration +#----------------------------------------------------------------------------- +#inherit EXE_EXT from parent HDF5 cmake project +#inherit CFG_INIT from parent HDF5 cmake project + +#----------------------------------------------------------------------------- +# Setup the Fortran auto-detection utilities +# H5test_kind(_SIZEOF).f90 used to generate H5fortran_detect.f90 +# H5fortran_detect.f90 used to generate H5fort_type_defines.h +# H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.f90 +#----------------------------------------------------------------------------- +IF (FORTRAN_HAVE_SIZEOF) + ADD_EXECUTABLE (H5test_FortranHavekind + ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 + ) +ELSE (FORTRAN_HAVE_SIZEOF) + ADD_EXECUTABLE (H5test_FortranHavekind + ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 + ) +ENDIF (FORTRAN_HAVE_SIZEOF) +IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5test_FortranHavekind + PROPERTIES + COMPILE_FLAGS "/MT" + ) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5test_FortranHavekind + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) + +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5test_FortranHavekind${EXE_EXT}) +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 + COMMAND ${CMD} + ARGS > ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5test_FortranHavekind +) +#----------------------------------------------------------------------------- +ADD_EXECUTABLE (H5fortran_detect + ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 +) +IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5fortran_detect + PROPERTIES + COMPILE_FLAGS "/MT" + ) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5fortran_detect + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) + +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5fortran_detect${EXE_EXT}) +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h + COMMAND ${CMD} + ARGS > ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5fortran_detect +) + +#----------------------------------------------------------------------------- +ADD_EXECUTABLE (H5match_types + ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c +) +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5match_types${EXE_EXT}) +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 + COMMAND ${CMD} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5match_types +) + +#----------------------------------------------------------------------------- +# f90CStub lib +#----------------------------------------------------------------------------- +SET (f90CStub_C_SRCS + # generated files + ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90kit.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5_f.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Af.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Df.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Ef.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Ff.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Gf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5If.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Lf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Of.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Pf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Rf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Sf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Tf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Zf.c +) + +IF (H5_HAVE_PARALLEL) + SET (f90CStub_C_SRCS + ${f90CStub_C_SRCS} + ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c + ) +ENDIF (H5_HAVE_PARALLEL) + +SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) + +ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS}) +TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Fortran Real Size +#----------------------------------------------------------------------------- +IF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + # default real is 4 bytes, so include double signatures + SET (F_DBLE "Include") +ELSE (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + # default real is 8 bytes, so exclude double signatures + SET (F_DBLE "Exclude") +ENDIF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + +#----------------------------------------------------------------------------- +# Fortran Modules +#----------------------------------------------------------------------------- +SET (f90_F_SRCS + # generated files + ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5_ff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Gff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Iff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Off.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Rff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Sff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5_DBLE_Interface${F_DBLE}.f90 +) + +#----------------------------------------------------------------------------- +# Add H5FDMPIO if parallel +#----------------------------------------------------------------------------- +IF (H5_HAVE_PARALLEL) + SET (f90_F_SRCS + ${f90_F_SRCS} + ${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90 + ) +ELSE (H5_HAVE_PARALLEL) + SET (f90_F_SRCS + ${f90_F_SRCS} + ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 + ) +ENDIF (H5_HAVE_PARALLEL) + +#----------------------------------------------------------------------------- +# Add Main fortran library +#----------------------------------------------------------------------------- +ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) +IF (WIN32) + IF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) + IF (MSVC) + SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE /DLL /DEF:${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def" + ) + ENDIF (MSVC) + ENDIF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h + ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 + DESTINATION + include/fortran + COMPONENT + fortheaders +) + +INSTALL ( + DIRECTORY + ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ + DESTINATION + include/fortran + COMPONENT + fortheaders +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_F90_C_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib COMPONENT fortlibraries + ARCHIVE DESTINATION lib COMPONENT fortlibraries + RUNTIME DESTINATION bin COMPONENT fortlibraries + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 51a53a8..9640444 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -444,32 +444,36 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) * number of open objects * Thursday, September 25, 2008 EIP *---------------------------------------------------------------------------*/ - int_f -nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs) +nh5fget_obj_ids_c(hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, + hid_t_f *obj_ids, size_t_f *num_objs) { - int ret_value = 0; - hid_t c_file_id; - unsigned c_obj_type; - int i; - size_t c_max_objs; - ssize_t c_num_objs; - hid_t *c_obj_ids; - - c_file_id = (hid_t)*file_id; - c_obj_type = (unsigned) *obj_type; - c_max_objs = (size_t)*max_objs; - c_obj_ids = (hid_t *)HDmalloc(sizeof(hid_t)*c_max_objs); - - c_num_objs = H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, c_obj_ids); - if ( c_num_objs < 0 ) ret_value = -1; - for (i=0; i< c_max_objs; i++) obj_ids[i] = (hid_t_f)c_obj_ids[i]; - - HDfree(c_obj_ids); - *num_objs = (size_t_f)c_num_objs; - - return ret_value; + int ret_value = 0; + hid_t c_file_id; + unsigned c_obj_type; + size_t u; + size_t c_max_objs; + ssize_t c_num_objs; + hid_t *c_obj_ids; + + c_file_id = (hid_t)*file_id; + c_obj_type = (unsigned) *obj_type; + c_max_objs = (size_t)*max_objs; + c_obj_ids = (hid_t *)HDmalloc(sizeof(hid_t)*c_max_objs); + + c_num_objs = H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, c_obj_ids); + if(c_num_objs < 0) + ret_value = -1; + for(u = 0; u < c_max_objs; u++) + obj_ids[u] = (hid_t_f)c_obj_ids[u]; + + HDfree(c_obj_ids); + *num_objs = (size_t_f)c_num_objs; + + return ret_value; } + + /*---------------------------------------------------------------------------- * Name: h5fget_freespace_c * Purpose: Call H5Fget_freespace to get amount of free space within a file diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 4fd4a5a..fe25387 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -255,12 +255,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ @@ -424,7 +424,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 59 +LT_VERS_REVISION = 63 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt new file mode 100644 index 0000000..7875f97 --- /dev/null +++ b/fortran/test/CMakeLists.txt @@ -0,0 +1,195 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +#----------------------------------------------------------------------------- +# Add Test Lib +#----------------------------------------------------------------------------- +ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) +# Must explicity add a dependency here to force the generation of headers +# which are created for ${HDF5_F90_C_LIB_TARGET} +#ADD_DEPENDENCIES(${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ) +TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET} + ${HDF5_F90_C_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} +) +H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE}) + +ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) +# Must explicity add a dependency here to force the generation of headers +# which are created for ${HDF5_F90_C_LIB_TARGET} +ADD_DEPENDENCIES(${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_C_TEST_LIB_TARGET} +) +IF (WIN32) + IF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) + IF (MSVC) + SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE /DLL" + ) + ENDIF (MSVC) + ENDIF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add Tests +#----------------------------------------------------------------------------- + +#-- Adding test for testhdf5_fortran +ADD_EXECUTABLE (testhdf5_fortran + fortranlib_test.f90 + tH5A.f90 + tH5D.f90 + tH5E.f90 + tH5F.f90 + tH5G.f90 + tH5I.f90 + tH5P.f90 + tH5R.f90 + tH5S.f90 + tH5Sselect.f90 + tH5T.f90 + tH5VL.f90 + tH5Z.f90 +) +H5_NAMING (testhdf5_fortran) +TARGET_LINK_LIBRARIES (testhdf5_fortran + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testhdf5_fortran + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testhdf5_fortran + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME testhdf5_fortran COMMAND $) + +#-- Adding test for testhdf5_fortran_1_8 +ADD_EXECUTABLE (testhdf5_fortran_1_8 + fortranlib_test_1_8.f90 + tH5F.f90 + tH5O.f90 + tH5A_1_8.f90 + tH5G_1_8.f90 +) +H5_NAMING (testhdf5_fortran_1_8) +TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) + +#-- Adding test for fflush1 +ADD_EXECUTABLE (fflush1 fflush1.f90) +H5_NAMING (fflush1) +TARGET_LINK_LIBRARIES (fflush1 + ${HDF5_F90_LIB_TARGET} + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (fflush1 + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (fflush1 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME fflush1 COMMAND $) + +#-- Adding test for fflush2 +ADD_EXECUTABLE (fflush2 fflush2.f90) +H5_NAMING (fflush2) +TARGET_LINK_LIBRARIES (fflush2 + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (fflush2 + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (fflush2 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME fflush2 COMMAND $) diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 3de711a..515d66b 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -236,12 +236,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 613a0ec..0a71e8b 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -189,12 +189,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt new file mode 100644 index 0000000..bc7c652 --- /dev/null +++ b/hl/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL) + +#----------------------------------------------------------------------------- +# Shared Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (HL_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) + +ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) + +#-- Build the High level Tools +IF (HDF5_BUILD_TOOLS) + ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) +ENDIF (HDF5_BUILD_TOOLS) + +#-- Add High Level Examples +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +#-- Build the Unit testing if requested +IF (NOT HDF5_EXTERNALLY_CONFIGURED) + IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) + ENDIF (BUILD_TESTING) +ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + +#-- Build the High Level Fortran source codes +IF (HDF5_BUILD_FORTRAN) + ADD_SUBDIRECTORY (fortran) +ENDIF (HDF5_BUILD_FORTRAN) + +IF (HDF5_BUILD_CPP_LIB) + ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/c++ ${HDF5_HL_BINARY_DIR}/c++) +ENDIF (HDF5_BUILD_CPP_LIB) diff --git a/hl/Makefile.in b/hl/Makefile.in index 0d4c6c1..d44f082 100755 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -203,12 +203,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt new file mode 100644 index 0000000..15ae809 --- /dev/null +++ b/hl/c++/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP) + +#----------------------------------------------------------------------------- +# Main HL lib is in /src +#----------------------------------------------------------------------------- +ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) + +# -------------------------------------------------------------------- +# Add in the examples for the Packet Table codes +# -------------------------------------------------------------------- +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +# -------------------------------------------------------------------- +# Add in the unit tests for the packet table c++ wrapper +# -------------------------------------------------------------------- + +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 0a5d32d..95b16b2 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -199,12 +199,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt new file mode 100644 index 0000000..8fcb9bd --- /dev/null +++ b/hl/c++/examples/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP_EXAMPLES) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SOURCE_DIR}/src) + +# -------------------------------------------------------------------- +# Add in the examples for the Packet Table codes +# -------------------------------------------------------------------- +IF (HDF5_BUILD_EXAMPLES) + ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) + H5_NAMING (ptExampleFL) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (ptExampleFL + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES ( + ptExampleFL + ${HDF5_HL_CPP_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + + ADD_EXECUTABLE (ptExampleVL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleVL.cpp) + H5_NAMING (ptExampleVL) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (ptExampleVL + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES ( + ptExampleVL + ${HDF5_HL_CPP_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) +ENDIF (HDF5_BUILD_EXAMPLES) diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 51c04ad..fd1a100 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -165,12 +165,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt new file mode 100644 index 0000000..459520e --- /dev/null +++ b/hl/c++/src/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP_SRC) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) +SET (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) + +ADD_LIBRARY ( ${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +TARGET_LINK_LIBRARIES ( + ${HDF5_HL_CPP_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${HDF5_HL_CPP_HDRS} + DESTINATION + include/hl/cpp + COMPONENT + hlcppheaders +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_HL_CPP_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib COMPONENT hlcpplibraries + ARCHIVE DESTINATION lib COMPONENT hlcpplibraries + RUNTIME DESTINATION bin COMPONENT hlcpplibraries + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index f815a66..74b8029 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -190,7 +190,7 @@ if (startIndex > endIndex) return -1; - return H5PTread_packets(table_id, startIndex, endIndex-startIndex+1, data); + return H5PTread_packets(table_id, startIndex, (size_t)(endIndex-startIndex+1), data); } /* GetNextPacket (single packet) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 1ebda2b..325323a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -211,12 +211,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ @@ -380,7 +380,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 59 +LT_VERS_REVISION = 63 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt new file mode 100644 index 0000000..e9b09da --- /dev/null +++ b/hl/c++/test/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP_TEST) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SOURCE_DIR}/src) + +# -------------------------------------------------------------------- +# Add in the unit tests for the packet table c++ wrapper +# -------------------------------------------------------------------- + +IF (BUILD_TESTING) + INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR}) + INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/test) + INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src) + + ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) + H5_NAMING (hl_ptableTest) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_ptableTest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES ( + hl_ptableTest + ${HDF5_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} + ${HDF5_CPP_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} + ${HDF5_HL_CPP_LIB_TARGET} + ) + GET_TARGET_PROPERTY (hl_ptableTestpath hl_ptableTest LOCATION) + GET_FILENAME_COMPONENT (hl_ptableTestexe ${hl_ptableTestpath} NAME) + + ADD_TEST (NAME hl_ptableTest COMMAND $) +ENDIF (BUILD_TESTING) diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 644966b..fc59115 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -185,12 +185,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt new file mode 100644 index 0000000..0d29b7f --- /dev/null +++ b/hl/examples/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_EXAMPLES ) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (examples + ex_lite1 + ex_lite2 + ex_lite3 + ptExampleFL + ptExampleVL + ex_image1 + ex_image2 + ex_table_01 + ex_table_02 + ex_table_03 + ex_table_04 + ex_table_05 + ex_table_06 + ex_table_07 + ex_table_08 + ex_table_09 + ex_table_10 + ex_table_11 + ex_table_12 + ex_ds1 +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) + H5_NAMING (hl_ex_${example}) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_ex_${example} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +ENDFOREACH (example ${examples}) + + diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 31c21f0..2b18c3d 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -165,12 +165,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt new file mode 100644 index 0000000..1aca0d7 --- /dev/null +++ b/hl/fortran/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT(HDF5_HL_F90 C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR}) +INCLUDE_DIRECTORIES (${HDF5_F90_SRC_BINARY_DIR}) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY}) + +LINK_DIRECTORIES (${HDF5_SRC_DIR} ${HDF5_FORTRAN_SOURCE_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + +#----------------------------------------------------------------------------- +# Add debug information (intel Fortran : JB) +#----------------------------------------------------------------------------- +IF (CMAKE_Fortran_COMPILER MATCHES ifort) + IF (WIN32) + SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + ENDIF (WIN32) +ENDIF (CMAKE_Fortran_COMPILER MATCHES ifort) + +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# Build the HL Fortran Examples +#----------------------------------------------------------------------------- +IF (HDF5_BUILD_FORTRAN_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_FORTRAN_EXAMPLES) + +#----------------------------------------------------------------------------- +# Testing +#----------------------------------------------------------------------------- +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 799edee..c382dbd 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -203,12 +203,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt new file mode 100644 index 0000000..bd9a695 --- /dev/null +++ b/hl/fortran/examples/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_HL_F90_BINARY_DIR} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +SET (examples + exlite +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.f90) + H5_NAMING (hl_f90_ex_${example}) + IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_ex_${example} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_ex_${example} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (hl_f90_ex_${example} + ${HDF5_HL_F90_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) +ENDFOREACH (example ${examples}) diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 3abc2dd..5e5584f 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -165,12 +165,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt new file mode 100644 index 0000000..71302f3 --- /dev/null +++ b/hl/fortran/src/CMakeLists.txt @@ -0,0 +1,100 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT(HDF5_HL_F90_SRC C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ${HDF5_F90_SOURCE_DIR}/src + ${HDF5_F90_SRC_BINARY_DIR} + ${HDF5_HL_F90_SRC_SOURCE_DIR} + ${HDF5_HL_SOURCE_DIR}/src +) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_HL_F90_BINARY_DIR} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +SET (HDF5_HL_F90_F_SRCS + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90 +) + +SET (HDF5_HL_F90_C_SRCS + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTfc.c + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMfc.c + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.c + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBfc.c +) + +SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) + +ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) +TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} + ${HDF5_F90_C_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} +) +# +# To Ensure that generated files are built, we must force a dependency +ADD_DEPENDENCIES(${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET}) + +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT + "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}" +) +H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) + +ADD_LIBRARY (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) +IF (BUILD_SHARED_LIBS) + IF (WIN32) + SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) + IF (MSVC) + SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE /DLL" + ) + ENDIF (MSVC) + ENDIF (WIN32) +ENDIF (BUILD_SHARED_LIBS) +IF (WIN32) + SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) + SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +ENDIF (WIN32) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT + "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}" +) +TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} + ${HDF5_HL_F90_C_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} +) +H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE}) +ADD_DEPENDENCIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET}) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_HL_F90_C_LIB_TARGET} + ${HDF5_HL_F90_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib COMPONENT hlfortlibraries + ARCHIVE DESTINATION lib COMPONENT hlfortlibraries + RUNTIME DESTINATION bin COMPONENT hlfortlibraries + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/fortran/src/H5IMcc.h b/hl/fortran/src/H5IMcc.h index 9f70bac..0b8a345 100644 --- a/hl/fortran/src/H5IMcc.h +++ b/hl/fortran/src/H5IMcc.h @@ -18,7 +18,7 @@ #include "H5LTprivate.h" #include "H5IMprivate.h" -#include "../../fortran/src/H5f90i_gen.h" +#include "H5f90i_gen.h" #ifdef __cplusplus extern "C" { diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index a01bcfa..bf1fe89 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -220,12 +220,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ @@ -389,7 +389,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 59 +LT_VERS_REVISION = 63 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt new file mode 100644 index 0000000..14bd622 --- /dev/null +++ b/hl/fortran/test/CMakeLists.txt @@ -0,0 +1,85 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) + +#----------------------------------------------------------------------------- +# Add Tests +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_HL_F90_BINARY_DIR} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +#-- Adding test for hl_f90_tstlite +ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) +H5_NAMING (hl_f90_tstlite) +IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_tstlite + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_tstlite + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME hl_f90_tstlite COMMAND $) + +#-- Adding test for hl_f90_tstimage +ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) +H5_NAMING (hl_f90_tstimage) +IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_tstimage + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_tstimage + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME hl_f90_tstimage COMMAND $) + +#-- Adding test for hl_f90_tsttable +ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) +H5_NAMING (hl_f90_tsttable) +IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_tsttable + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_f90_tsttable + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME hl_f90_tsttable COMMAND $) diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 6ff5d02..1f73b79 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -194,12 +194,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt new file mode 100644 index 0000000..6042853 --- /dev/null +++ b/hl/src/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_SRC) + +#----------------------------------------------------------------------------- +# Shared Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (HL_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) + +SET (HL_SRCS + ${HDF5_HL_SRC_SOURCE_DIR}/H5DS.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5IM.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5LT.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTanalyze.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5PT.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5TB.c +) + +SET (HL_HEADERS + ${HDF5_HL_SRC_SOURCE_DIR}/H5DSpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5IMpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5PTpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5TBpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/hdf5_hl.h +) + +ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) +SET_TARGET_PROPERTIES(${HDF5_HL_LIB_TARGET} PROPERTIES DEFINE_SYMBOL ${HDF5_HL_LIB_CORENAME}_EXPORTS) +TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${HL_HEADERS} + DESTINATION + include + COMPONENT + hlheaders +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_HL_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib COMPONENT hllibraries + ARCHIVE DESTINATION lib COMPONENT hllibraries + RUNTIME DESTINATION bin COMPONENT hllibraries + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 245a2c5..faa6d30 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -132,7 +132,7 @@ herr_t H5DSattach_scale(hid_t did, hid_t ntid = -1; /* attribute native type ID */ hid_t aid = -1; /* attribute ID */ int rank; /* rank of dataset */ - hsize_t *dims=NULL; /* dimension of the "REFERENCE_LIST" array */ + hsize_t dims[1]; /* dimension of the "REFERENCE_LIST" array */ ds_list_t dsl; /* attribute data in the DS pointing to the dataset */ ds_list_t *dsbuf=NULL; /* array of attribute data in the DS pointing to the dataset */ hobj_ref_t ref_to_ds; /* reference to the DS */ @@ -238,11 +238,6 @@ herr_t H5DSattach_scale(hid_t did, */ if (has_dimlist == 0) { - /* create one entry array */ - dims = (hsize_t*) malloc (1 * sizeof (hsize_t)); - - if(dims == NULL) - return FAIL; dims[0] = rank; @@ -288,11 +283,6 @@ herr_t H5DSattach_scale(hid_t did, if (H5Aclose(aid) < 0) goto out; - if (dims) - { - free(dims); - dims = NULL; - } if (buf) { free(buf); @@ -411,11 +401,6 @@ herr_t H5DSattach_scale(hid_t did, */ if (has_reflist == 0) { - /* create one entry array */ - dims = (hsize_t*) malloc (1 * sizeof (hsize_t)); - - if (dims == NULL) - goto out; dims[0] = 1; @@ -454,11 +439,6 @@ herr_t H5DSattach_scale(hid_t did, if(H5Aclose(aid) < 0) goto out; - if(dims) - { - free(dims); - dims = NULL; - } } /*------------------------------------------------------------------------- @@ -474,7 +454,8 @@ herr_t H5DSattach_scale(hid_t did, if((tid = H5Aget_type(aid)) < 0) goto out; - if((ntid = H5Tget_native_type(tid, H5T_DIR_DEFAULT)) < 0) + /* get native type to read attribute REFERENCE_LIST */ + if((ntid = H5DS_get_REFLIST_type()) < 0) goto out; /* get and save the old reference(s) */ @@ -499,8 +480,6 @@ herr_t H5DSattach_scale(hid_t did, goto out; if (H5Aclose(aid) < 0) goto out; - if (H5Tclose(ntid) < 0) - goto out; /*------------------------------------------------------------------------- * create a new attribute @@ -516,26 +495,17 @@ herr_t H5DSattach_scale(hid_t did, dsbuf[nelmts-1] = dsl; /* create a new data space for the new references array */ - dims = (hsize_t *)malloc((size_t)nelmts * sizeof(hsize_t)); - if(dims == NULL) - goto out; dims[0] = nelmts; if((sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if (dims) - { - free(dims); - dims = NULL; - } - /* create the attribute again with the changes of space */ if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* write the attribute with the new references */ - if(H5Awrite(aid, tid, dsbuf) < 0) + if(H5Awrite(aid, ntid, dsbuf) < 0) goto out; /* close */ @@ -545,6 +515,8 @@ herr_t H5DSattach_scale(hid_t did, goto out; if(H5Aclose(aid) < 0) goto out; + if (H5Tclose(ntid) < 0) + goto out; if (dsbuf) { @@ -573,11 +545,6 @@ herr_t H5DSattach_scale(hid_t did, /* error zone */ out: - if (dims) - { - free(dims); - dims = NULL; - } if (buf) { free(buf); @@ -620,9 +587,11 @@ out: * * Date: December 20, 2004 * -* Comments: +* Comments: * -* Modifications: +* Modifications: Function didn't delete DIMENSION_LIST attribute, when +* all dimension scales were detached from a dataset; added. +* 2010/05/13 EIP * *------------------------------------------------------------------------- */ @@ -642,14 +611,15 @@ herr_t H5DSdetach_scale(hid_t did, hid_t aid = -1; /* attribute ID */ int rank; /* rank of dataset */ ds_list_t *dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */ - ds_list_t *dsbufn = NULL; /* array of attribute data in the DS pointing to the dataset */ - hsize_t *dims = NULL; /* dimension of the "REFERENCE_LIST" array */ + hsize_t dims[1]; /* dimension of the "REFERENCE_LIST" array */ hobj_ref_t ref; /* reference to the DS */ hvl_t *buf = NULL; /* VL buffer to store in the attribute */ - unsigned i, j, jj; - H5O_info_t oi1, oi2, oi3, oi4; + int i; + size_t j; + hssize_t ii; + H5O_info_t did_oi, dsid_oi, tmp_oi; int found_dset = 0, found_ds = 0; - H5I_type_t it1, it2; + int have_ds = 0; htri_t is_scale; /*------------------------------------------------------------------------- @@ -657,32 +627,28 @@ herr_t H5DSdetach_scale(hid_t did, *------------------------------------------------------------------------- */ - if ((is_scale = H5DSis_scale(did)) < 0) + /* check for valid types of identifiers */ + + if(H5I_DATASET!=H5Iget_type(did) || H5I_DATASET!=H5Iget_type(dsid)) + return FAIL; + + if((is_scale = H5DSis_scale(did)) < 0) return FAIL; /* the dataset cannot be a DS dataset */ - if ( is_scale == 1) + if( is_scale == 1) return FAIL; /* get info for the dataset in the parameter list */ - if(H5Oget_info(did, &oi1) < 0) + if(H5Oget_info(did, &did_oi) < 0) return FAIL; /* get info for the scale in the parameter list */ - if(H5Oget_info(dsid, &oi2) < 0) + if(H5Oget_info(dsid, &dsid_oi) < 0) return FAIL; /* same object, not valid */ - if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr) - return FAIL; - - /* get ID type */ - if ((it1 = H5Iget_type(did)) < 0) - return FAIL; - if ((it2 = H5Iget_type(dsid)) < 0) - return FAIL; - - if (H5I_DATASET!=it1 || H5I_DATASET!=it2) + if(did_oi.fileno == dsid_oi.fileno && did_oi.addr == dsid_oi.addr) return FAIL; @@ -761,46 +727,62 @@ herr_t H5DSdetach_scale(hid_t did, if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref)) < 0) goto out; - /* get info for DS in the parameter list */ - if(H5Oget_info(dsid, &oi1) < 0) + /* get info for this DS */ + if(H5Oget_info(dsid_j, &tmp_oi) < 0) goto out; - /* get info for this DS */ - if(H5Oget_info(dsid_j, &oi2) < 0) + /* Close the dereferenced dataset */ + if (H5Dclose(dsid_j) < 0) goto out; /* same object, reset */ - if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr) + if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr) { - size_t len; - - for(jj=j; jj 0) { + have_ds = 1; + break; + } + } + if(have_ds) { + if(H5Awrite(aid,tid,buf) < 0) + goto out; + } + else { + if(H5Adelete(did,DIMENSION_LIST) < 0) + goto out; + } + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0) goto out; @@ -817,9 +799,6 @@ herr_t H5DSdetach_scale(hid_t did, buf = NULL; } - /* the scale must be present */ - if(found_ds == 0) - goto out; /*------------------------------------------------------------------------- * the "REFERENCE_LIST" array exists, update @@ -832,7 +811,8 @@ herr_t H5DSdetach_scale(hid_t did, if((tid = H5Aget_type(aid)) < 0) goto out; - if((ntid = H5Tget_native_type(tid, H5T_DIR_DEFAULT)) < 0) + /* get native type to read attribute REFERENCE_LIST */ + if((ntid = H5DS_get_REFLIST_type()) < 0) goto out; /* get and save the old reference(s) */ @@ -849,49 +829,42 @@ herr_t H5DSdetach_scale(hid_t did, if (H5Aread(aid,ntid,dsbuf) < 0) goto out; - for(i=0; i) + + #-- Copy the necessary files. + FOREACH (h5_file ${files}) + SET (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying HL Test File ${h5_file} to ${dest}") + ADD_CUSTOM_COMMAND ( + TARGET hl_${hl_name} + PRE_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_HL_TEST_SOURCE_DIR}/${h5_file} ${dest} + ) + + ENDFOREACH (h5_file ${HL_REFERENCE_TEST_FILES}) +ENDMACRO (HL_ADD_TEST) + +HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") +HL_ADD_TEST (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") +HL_ADD_TEST (test_lite "dtype_file.txt") +HL_ADD_TEST (test_packet "") +HL_ADD_TEST (test_table "test_table_be.hdf5;test_table_cray.hdf5;test_table_le.hdf5") + +# -------------------------------------------------------------------- +# This executable is used to generate test files for the test_ds test. +# It should only be run during development when new test files are needed +# -------------------------------------------------------------------- +IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) + H5_NAMING (hl_gen_test_ds) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hl_gen_test_ds + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (hl_gen_test_ds + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} + ) +ENDIF (NOT BUILD_SHARED_LIBS) diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index fc6e969..86e3318 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -46,6 +46,6 @@ endif # Temporary files. These files are the ones created by running `make test'. CHECK_CLEANFILES+=combine_tables[1-2].h5 test_ds[1-9].h5 test_image[1-3].h5 \ test_lite[1-2].h5 test_table.h5 test_packet_table.h5 \ - test_packet_compress.h5 + test_packet_compress.h5 test_detach.h5 include $(top_srcdir)/config/conclude.am diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 3d37e3e..a68831e 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -215,12 +215,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ @@ -383,7 +383,8 @@ TRACE = perl $(top_srcdir)/bin/trace # Temporary files. These files are the ones created by running `make test'. CHECK_CLEANFILES = *.chkexe *.chklog *.clog combine_tables[1-2].h5 \ test_ds[1-9].h5 test_image[1-3].h5 test_lite[1-2].h5 \ - test_table.h5 test_packet_table.h5 test_packet_compress.h5 + test_table.h5 test_packet_table.h5 test_packet_compress.h5 \ + test_detach.h5 # The tests depend on the hdf5, hdf5 test, and hdf5_hl libraries LDADD = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index d1705ec..53870f5 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -71,6 +71,7 @@ static int test_long_scalenames(const char *fileext); static int test_samelong_scalenames(const char *fileext); static int test_float_scalenames(const char *fileext); static int test_foreign_scaleattached(const char *fileforeign); +static int test_detachscales(void); static int test_simple(void); static int test_errors(void); @@ -136,6 +137,9 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf ) #define FILE6 "test_ds8.h5" #define FILE7 "test_ds9.h5" +#define DIMENSION_LIST "DIMENSION_LIST" +#define REFERENCE_LIST "REFERENCE_LIST" + /*------------------------------------------------------------------------- * the main program *------------------------------------------------------------------------- @@ -169,6 +173,7 @@ int main(void) nerrors += test_samelong_scalenames("2") < 0 ? 1 : 0; nerrors += test_foreign_scaleattached(FOREIGN_FILE1) < 0 ? 1 : 0; nerrors += test_foreign_scaleattached(FOREIGN_FILE2) < 0 ? 1 : 0; + nerrors += test_detachscales() < 0 ? 1 : 0; /* the following tests have not been rewritten to match those above */ nerrors += test_simple() < 0 ?1:0; @@ -238,8 +243,7 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) int rank = 3; int rankds = 1; hsize_t dims[3] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE}; - char buf[DIM_DATA*3] = {1,2,3,4,5,6,7,8,9,10,11,12, - 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12}; + char buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE]; hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s3_dim[1] = {DIM3_SIZE}; @@ -292,8 +296,7 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) int rank = 3; int rankds = 1; hsize_t dims[3] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE}; - short buf[DIM_DATA*3] = {1,2,3,4,5,6,7,8,9,10,11,12, - 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12}; + short buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE]; hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s3_dim[1] = {DIM3_SIZE}; @@ -347,7 +350,7 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) int rank = RANK; int rankds = 1; hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; - int buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12}; + int buf[DIM1_SIZE*DIM2_SIZE]; hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE}; int s1_wbuf[DIM1_SIZE] = {10,20,30}; @@ -389,10 +392,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int int rank = 4; int rankds = 1; hsize_t dims[4] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE,DIM4_SIZE}; - long buf[DIM_DATA*3*2] = {1,2,3,4,5,6,7,8,9,10,11,12, - 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12, - 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12, - 1,2,3,4,5,6,7,8,9,10,11,12}; + long buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE*DIM4_SIZE]; hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s3_dim[1] = {DIM3_SIZE}; @@ -458,7 +458,7 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) int rank = RANK; int rankds = 1; hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; - float buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12}; + float buf[DIM1_SIZE*DIM2_SIZE]; hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE}; float s1_wbuf[DIM1_SIZE] = {10,20,30}; @@ -1144,6 +1144,148 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc return ret_value; } +static int test_detachscales(void) +{ + hid_t fid = -1; + hid_t did = -1; + hid_t dsid = -1; + int rank1 = 1; + int rank3 = 3; + hsize_t dims[] = {1,2,3}; /*some bogus numbers, not important for the test*/ + int *buf = NULL; + char dname[10]; + int i; + + /* This tests creates two three dimensional datasets; then it creates + four integer datasets that are used as dim. scales; we will attach + and detach them to check that at the end there is no attributes + REFERENCE_LIST on a dimension scale and DIMENSION_LIST on a dataset */ + + TESTING2("test_detachscales"); + + if((fid = H5Fcreate("test_detach.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + + /* make datasets; they are three dimensional*/ + for (i=0; i < 2; i++) { + sprintf(dname,"D%d", i); + if(H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0) + goto out; + } + /* create datasets and make them dim. scales */ + + for (i=0; i < 4; i++) { + sprintf(dname, "DS%d", i); + if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0) + goto out; + } + /* attach scales to the first dataset; first dimension will have + two scales attached */ + if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { + for (i=0; i<4; i++) { + sprintf(dname, "DS%d", i); + if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) + goto out; + if(H5DSattach_scale(did, dsid, (unsigned int) i%3) < 0) + goto out; + if(H5Dclose(dsid) < 0) + goto out; + } + if(H5Dclose(did) < 0) + goto out; + } + else + goto out; + + /* attach scales to the second dataset */ + if((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) { + for (i=0; i<3; i++) { + sprintf(dname, "DS%d", i); + if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) + goto out; + if(H5DSattach_scale(did, dsid, (unsigned int) i) < 0) + goto out; + if(H5Dclose(dsid) < 0) + goto out; + } + if(H5Dclose(did) < 0) + goto out; + } + else + goto out; + + /* detach DS0 from first dimension of D0 and D1; then check + that DS0 doesn't have attribute REFERENCE _LIST */ + + if((dsid = H5Dopen2(fid, "DS0", H5P_DEFAULT)) < 0) + goto out; + + for (i=0; i<2; i++) { + sprintf(dname, "D%d", i); + if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) + goto out; + if(H5DSdetach_scale(did, dsid, (unsigned int)0) < 0) + goto out; + if(H5Dclose(did) < 0) + goto out; + } + /* Check that attribute "REFERENCE_LIST" doesn't exist anymore */ + if(H5Aexists(dsid, REFERENCE_LIST)!= 0) + goto out; + if(H5Dclose(dsid) < 0) + goto out; + /* Check that DS3 is the only dim. scale attached to the first + dimension of D0 */ + if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) < 0) + goto out; + if((dsid = H5Dopen2(fid, "DS3", H5P_DEFAULT)) < 0) + goto out; + if(H5DSis_attached(did, dsid, (unsigned int) 0) <= 0) + goto out; + if(H5Dclose(did) < 0) + goto out; + if(H5Dclose(dsid) < 0) + goto out; + + /* Detach the rest of the scales DS3, DS1, DS2 from D0 and make + sure that attribute "DIMENSION_LIST" doesn't exist anymore */ + if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { + for (i=1; i<4; i++) { + sprintf(dname, "DS%d", i); + if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) + goto out; + if(H5DSdetach_scale(did, dsid, (unsigned int) i%3) < 0) + goto out; + if(H5Dclose(dsid) < 0) + goto out; + } + /* Check that attribute "DIMENSION_LIST" doesn't exist anymore */ + if(H5Aexists(did, DIMENSION_LIST)!= 0) + goto out; + if(H5Dclose(did) < 0) + goto out; + } + else + goto out; + + + PASSED(); + + H5Fclose(fid); + return SUCCEED; + +out: + H5E_BEGIN_TRY { + H5Dclose(did); + H5Dclose(dsid); + H5Fclose(fid); + } H5E_END_TRY; + + H5_FAILED(); + + return FAIL; +} + static int test_char_attachscales(const char *fileext) { hid_t fid = -1; diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt new file mode 100644 index 0000000..e8c729d --- /dev/null +++ b/hl/tools/CMakeLists.txt @@ -0,0 +1,85 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_TOOLS) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (GIF2H5_SRCS + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif.h + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/decompress.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif2hdf.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif2mem.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gifread.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/writehdf.c +) + +#-- Add gif2hdf5 program +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) + +ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) +H5_NAMING (gif2h5) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (gif2h5 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +#-- Add h52gif program +SET (hdf2gif_SRCS + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdf2gif.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdfgifwr.c +) +ADD_EXECUTABLE (hdf2gif ${hdf2gif_SRCS}) +H5_NAMING (hdf2gif) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (hdf2gif + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (hdf2gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +# -------------------------------------------------------------------- +# This executable can generate the actual test files - Currently not +# used in the CMake Build system as we rely on the test files that are +# shipped with HDF5 source archives +# -------------------------------------------------------------------- +IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) + H5_NAMING (hl_h52gifgentest) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (hl_h52gifgentest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + +# ADD_TEST (NAME hl_h52gifgentest COMMAND $) +ENDIF (NOT BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + gif2h5 + hdf2gif + RUNTIME DESTINATION + bin/tools + COMPONENT + hltoolsapplications +) diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 99d627d..f6d8563 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -200,12 +200,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index ed61e3c..70c78bf 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -200,12 +200,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt new file mode 100644 index 0000000..a0b7fae --- /dev/null +++ b/perform/CMakeLists.txt @@ -0,0 +1,134 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_PERFORM ) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR}) +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib ) + +#----------------------------------------------------------------------------- +# Add Tests +#----------------------------------------------------------------------------- + +#-- Adding test for h5perf_serial +SET (h5perf_serial_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c + ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c + ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c +) +ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) +H5_NAMING (h5perf_serial) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5perf_serial + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME h5perf_serial COMMAND $) + +#-- Adding test for chunk +SET (chunk_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/chunk.c +) +ADD_EXECUTABLE(chunk ${chunk_SRCS}) +H5_NAMING (chunk) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (chunk + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME chunk COMMAND $) + +#-- Adding test for iopipe +SET (iopipe_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c +) +ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) +H5_NAMING (iopipe) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (iopipe + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME iopipe COMMAND $) + +#-- Adding test for overhead +SET (overhead_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/overhead.c +) +ADD_EXECUTABLE (overhead ${overhead_SRCS}) +H5_NAMING (overhead) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (overhead + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME overhead COMMAND $) + +#-- Adding test for perf_meta +SET (perf_meta_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c +) +ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) +H5_NAMING (perf_meta) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (perf_meta + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME perf_meta COMMAND $) + +#-- Adding test for zip_perf +SET (zip_perf_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c +) +ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) +H5_NAMING (zip_perf) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (zip_perf + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_TEST (NAME zip_perf COMMAND $ "-h") diff --git a/perform/Makefile.in b/perform/Makefile.in index 5d5df32..f788e72 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -236,12 +236,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/perform/benchpar.c b/perform/benchpar.c index 3ebbe6b..035e9d6 100644 --- a/perform/benchpar.c +++ b/perform/benchpar.c @@ -167,9 +167,9 @@ int main(int argc, char *argv[]) int curr_arg; /* Current command line argument being processed */ int rank; /* Number of dimensions of the dataset */ hsize_t dim_size; /* Dimension size of each dimension */ - hsize_t *dims; /* Pointer to array of dimensions */ - hssize_t *start; /* Pointer to array of starting locations for hyperslab selection */ - hsize_t *count; /* Pointer to array of counts for hyperslab selection */ + hsize_t dims[H5S_MAX_RANK]; /* Pointer to array of dimensions */ + hsize_t start[H5S_MAX_RANK]; /* Pointer to array of starting locations for hyperslab selection */ + hsize_t count[H5S_MAX_RANK]; /* Pointer to array of counts for hyperslab selection */ unsigned slice_dim; /* Dimension to slice up */ char *file_name=NULL; /* Name of file to put data into */ hid_t fcpl; /* HDF5 File creation property list ID */ @@ -365,8 +365,6 @@ int main(int argc, char *argv[]) assert(ret>=0); /* Create dataspace for dataset on disk */ - dims=malloc(sizeof(hsize_t)*rank); - assert(dims); for(i=0; i=0); /* Select hyperslab for file dataspace */ - start=malloc(sizeof(hssize_t)*rank); - assert(start); - count=malloc(sizeof(hsize_t)*rank); - assert(count); for(i=0; i -#endif - -/*Winsock.h includes windows.h, due to the different value of -WINVER, windows.h should be put before H5private.h. Kent yang 6/21/2001*/ - #if defined (__MWERKS__) #ifdef H5_HAVE_SYS_TIMEB #undef H5_HAVE_SYS_TIMEB diff --git a/perform/sio_perf.h b/perform/sio_perf.h index bd05cfe..2417b6f 100644 --- a/perform/sio_perf.h +++ b/perform/sio_perf.h @@ -18,6 +18,7 @@ #include "sio_timer.h" #ifndef STANDALONE #include "H5private.h" +#include "h5test.h" #include "h5tools_utils.h" #else #include "sio_standalone.h" diff --git a/perform/sio_timer.h b/perform/sio_timer.h index 943ce28..82f053d 100644 --- a/perform/sio_timer.h +++ b/perform/sio_timer.h @@ -27,7 +27,7 @@ #endif #ifdef _WIN32 -# include +# include #endif /* _WIN32 */ /* The different types of timers we can have */ diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt new file mode 100755 index 0000000..8a9dd03 --- /dev/null +++ b/release_docs/CMake.txt @@ -0,0 +1,111 @@ +************************************************************************ +* Build and Install HDF5 C/C++ Library with CMake * +************************************************************************ + +Notes: This short instruction is written for users who want to quickly build + HDF5 library and tools from the HDF5 source code package using the + CMake tools. + + More information about using CMake can be found at the KitWare site, + www.cmake.org. + + CMake uses the command line, however the visual CMake tool is + recommended for the configuration step. The steps are similiar for + all the operating systems supported by CMake. + + NOTES: + 1. CMake is being introduced in this release as early-access. While + we have attempted to provide error-free files, please understand + that this development with CMake has just began. The CMake + specific files may change before the next release. + + +======================================================================== + Preconditions +======================================================================== + + 1. We suggest you obtain the latest CMake for windows from the Kitware + web site. The HDF5 1.8.x product requires CMake version 2.8.1. + + 2. If you plan to use Zlib or Szip, download the packages and install them + in a central location. For example on Windows, create a folder extlibs + and install the packages there. Windows users should also read Section V + in INSTALL_Windows.txt. + +======================================================================== + Building HDF5 C/C++ Libraries with CMake +======================================================================== + + 1. Run CMake + + The CMake executable is named "cmake-gui.exe" on Windows and should be + available in your Start menu. For Linux, UNIX, and Mac users the + executable is named "cmake-gui" and can be found where CMake was + installed. + Specify the source and build directories. It is recommemded that you + choose a build directory different then the source directory + (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then + use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). + + 2. Configure the cache settings + + Click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example on Windows, Visual Studio 9 2008). + CMake will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you + can adjust the cache settings and/or specify locations of other programs. + + Any conflicts or new values will be highlighted by the configure + process in red. Once you are happy with all the settings and there are no + more values in red, click the Generate button to produce the appropriate + build files. + + On Windows, if you are using a Visual Studio generator, the solution and + project files will be created in the build folder. + + On linux, if you are using the Unix Makefiles generator, the Makefiles will + be created in the build folder. + + 3. Build HDF5 + + On Windows, you can build HDF5 using either the Visual Studio Environment + or the command line. The command line is used on linux, Unix, and Mac. + + To build from the command line, navigate to your build directory and + execute the following; + + cmake --build . --config {Debug | Release} + + NOTE: "--config {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release on Windows. + + 3.1 If you wish to use the Visual Studio environment, open the solution + file in your build directory. Be sure to select either Debug or + Release and build the solution. + + + 4. Test HDF5. + + To test the build, navigate to your build directory and execute; + + ctest . -C {Debug | Release} + + NOTE: "-C {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release to match the build + step on Windows. + + 5. The files that support building HDF5 with CMake are all the files in the + Resources folder, the CMakeLists.txt files in each source folder, and two + additional files, ConfigureChecks.cmake and CTestConfig.cmake. The + CTestConfig.cmake is specific to the internal testing performed by The HDF + Group. It should be altered for the users installation and needs. + + 6. More information about using CMake can be found at the KitWare site, + www.cmake.org. + + +************************************************************************ + +Need further assistance, send email to help@hdfgroup.org + diff --git a/release_docs/INSTALL_Cygwin.txt b/release_docs/INSTALL_Cygwin.txt index 36e7cd7..8416dfc 100644 --- a/release_docs/INSTALL_Cygwin.txt +++ b/release_docs/INSTALL_Cygwin.txt @@ -2,12 +2,10 @@ HDF5 Build and Install Instructions for Cygwin ************************************************************************ -Needs Updating to latest versions - Preconditions: -------------- -1. Installed Cygwin 1.5.17 or higher +1. Installed Cygwin 1.7.5 or higher To install the Cygwin net release, go to http://www.cygwin.com and click on "Install or update now!" icon. This will download a GUI @@ -27,25 +25,18 @@ Preconditions: 2.1 C/C++ Compilers HDF5-1.8 Supported - gcc-3.4.4 is included in Cygwin, which includes: - gcc : GNU C compiler - gcc-g++: GNU C++ compiler - - 2.2 Fortran Compiler HDF5-1.8 Supported - - HDF5-1.8 supports g95(GCC 4.0.1 (g95!) Jul 22 2005) and higher. - - g95 is a free, open source Fortran 95 compiler. Users can - download the g95 binaries for Cygwin in the following website: - http://www.g95.org. + gcc (4.3.4), which includes: + gcc4-core : C compiler + gcc4-g++ : C++ compiler + gcc4-fortran : fortran compiler - 2.3 Using Compilers Not Supported + 2.2 Using Compilers Not Supported - The compilers in 2.1 and 2.2 are supported and tested by HDF + The compilers in 2.1 are supported and tested by HDF group. Any other compilers may still work but they are not guaranteed by HDF group. - If users want to use other compilers except those in 2.1 and 2.2, + If users want to use other compilers except those in 2.1, try to set the following variables to override the default choices. @@ -85,28 +76,28 @@ Install HDF5 on Cygwin The HDF5 source code is distributed in a variety of formats which can be unpacked with the following commands, each of which creates - an `hdf5-1.8.1' directory. + an `hdf5-1.8.5' directory. 2.1 Non-compressed tar archive (*.tar) - $ tar xf hdf5-1.8.1.tar + $ tar xf hdf5-1.8.5.tar 2.2 Gzip'd tar archive (*.tar.gz) - $ gunzip < hdf5-1.8.1.tar.gz | tar xf - + $ gunzip < hdf5-1.8.5.tar.gz | tar xf - 2.3 Bzip'd tar archive (*.tar.bz2) - $ bunzip2 < hdf5-1.8.1.tar.bz2 | tar xf - + $ bunzip2 < hdf5-1.8.5.tar.bz2 | tar xf - 2. Setup Environment In Cygwin, most compilers and setting are automatically detected during the configure script. However, if you are building Fortran we recommend that you explicitly set the "FC" variable in your environment to use the - g95 Fortran compiler. For example, issue the command: + gfortran compiler. For example, issue the command: - $ export FC=g95 + $ export FC=gfortran 4. Configuring diff --git a/release_docs/INSTALL_MinGW.txt b/release_docs/INSTALL_MinGW.txt deleted file mode 100644 index 75ef07f..0000000 --- a/release_docs/INSTALL_MinGW.txt +++ /dev/null @@ -1,263 +0,0 @@ -************************************************************************ - HDF5 Build and Install Instructions for MinGW -************************************************************************ - -Preconditions: --------------- - -1. Installed MinGW (5.1.4 or higher) and MSYS (1.0.10 or higher) - - To install the MinGW net release, go to http://www.mingw.org and - click on "Install or update now!" icon. This will download a GUI - installer called setup.txt which can be run to download a complete - MinGW installation via the internet. Then follow the instructions - on each screen to install MinGW. - -2. Compilers Installed - - 2.1 C/C++ Compilers HDF5-1.8.1 Supported - - gcc-3.4.2 is included in MinGW, which includes: - gcc : GNU C compiler - gcc-g++: GNU C++ compiler - - 2.2 Using Compilers Not Supported - - The compilers in 2.1 are supported and tested by The HDF - Group. Any other compilers may still work but they are not - guaranteed by HDF group. - - If users want to use other compilers except those in 2.1, - try to set the following variables to override the default - choices. - - CC : C compiler command - CXX : C++ compiler command - FC : Fortran compiler command - -3. HDF5 Dependencies - - 3.1 Zlib - - zlib-1.2.2 or later is supported and tested on MinGW. - - 3.2 Szip - The HDF5 library has a predefined compression filter that uses - the extended-Rice lossless compression algorithm for chunked - datatsets. For more information about Szip compression and - license terms see - http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html. - - Szip is currently not supported on MinGW, although we plan to add - support in the future. - - -Build HDF5 on MinGW ----------------------- - -1. Get HDF5 source code package - Users can download HDF5 source code package from HDF website - (http://hdfgroup.org). - -2. Unpacking the distribution - - The HDF5 source code is distributed in a variety of formats which - can be unpacked with the following commands, each of which creates - an `hdf5-1.8.1' directory. - - 2.1 Non-compressed tar archive (*.tar) - - $ tar xf hdf5-1.8.1.tar - - 2.2 Gzip'd tar archive (*.tar.gz) - - $ gunzip < hdf5-1.8.1.tar.gz | tar xf - - - 2.3 Bzip'd tar archive (*.tar.bz2) - - $ bunzip2 < hdf5-1.8.1.tar.bz2 | tar xf - - -3. Setup Environment - - Building HDF5 1.8.1 requires an explicit link to libws2_32.a - to handle Windows Sockets. To do this, issue the command: - - $ export LIBS=-lws2_32 - - Also, the default search path can cause trouble using ./configure in HDF5 - 1.8.1. Check that non-MinGW or non-msys directories are not added to the - PATH. You can do this by: - - $ echo $PATH - - If there are spurious entries, specifically those related to other Windows - compilers or tools, remove them by setting a new PATH without them. For - example, - - $ export PATH=.:/usr/local/bin:/mingw/bin:/bin - - -4. Remove Unsupported Source - - There are some projects which are built by default to test performance on - POSIX systems. They are irrelevent on MinGW, and can cause compiler errors. - - To remove these projects from the build script, open ./perform/Makefile.in - Find all instances of "h5perf_serial", and remove them (along with their - respective extension or targets, if they exist). Then save the file. - - -5. Remove Tests - - When building with MinGW, many tests must be removed from the - test suite run with "make check". This is because of the way - MinGW and Windows handles certain parsing. For example, MinGW - treats any command parameter starting with '/' as a path, and - replaces it with it's root directory on Windows, such as - 'C:\msys\1.0\'. - - To remove the tests, open the given 'Makefile.in' and edit the - line begining with "TEST_SCRIPT = " to remove the test script. - For example, to remove the "testerror.sh" from ./test/Makefile.in: - - 1) Open ./test/Makefile.in - - 2) Find the line "TEST_SCRIPT = $(top_srcdir)/test/testerror.sh" - - 3) Change it to simply read "TEST_SCRIPT =", and save. - - Do this for the following Makefiles and tests: - - - ./test/Makefile.in: "testerror.sh" - - - ./tools/h5dump/Makefile.in: "testh5dump.sh" and "testh5dumpxml.sh" - - - ./tools/h5diff/Makefile.in: "testh5diff.sh" - - - ./tools/misc/Makefile.in: "testh5mkgrp.sh" - - - ./tools/h5copy/Makefile.in: "testh5copy.sh" - - - ./tools/h5ls/Makefile.in: "testh5ls.sh" - - - ./tools/h5stat/Makefile.in: "testh5stat.sh" - - -6. Configuring - - Notes: - 1) Building Fortran libraries is also currently unsupported. This is - because the current release of gcc for mingw (3.4.5) is not compatible - with the current g95 for mingw (g95 0.91!, gcc version 4.0.3). - - However, MinGW offers versions of gcc 4.x as a "Technology Preview" - or "Testing" release. These should be compatible with the latest - MinGW g95, but is untested. Keep in mind that this is UNSUPPORTED, - and any Fortran binaries build should be considered experimental. - - 2) Shared libraries can not be built on MinGW in release 1.8.1. - - 3) See detailed information in hdf5/release_docs/INSTALL, - part 5. Full installation instructions for source - distributions - - In short, - - To configure HDF5 with C Library, use - - $ ./configure - - If you would like to build the C++ library, add the parameter: - - --enable-cxx - - If you would like to build without the Zlib library, add the parameter: - - --without-zlib - - If you would like to specify the the Zlib library, there are two ways: - - Using - - --with-zlib=INCDIR,LIBDIR - - For example, if the zlib library is installed in - /usr, which is the parent directory of directories - "include" and "lib", - - --with-zlib=/usr/include,/usr/lib - - Through the CPPFLAGS and LDFLAGS Variables - - For example, if zlib was installed in the directory - /c/usr then using the following command to configure - HDF5 with zib - - $ export CPPFLAGS=-I/usr/include - $ export LDFLAGS=-L/usr/lib - - If you would like to specify the install directory, add the parameter: - - --prefix="path for installation" - - By default, HDF5 library, header files, examples, and - support programs will be installed in /usr/local/lib, - /usr/local/include, /usr/local/doc/hdf5/examples, and - /usr/local/bin. To use a path other than /usr/local specify - the path with the `--prefix=PATH' switch as in the above - command. - - Combination of Switches - - All of the above switches can be combined together. For - example, if users want to configure HDF5 C/C++ - library, with zlib library at /c/usr/, and - install HDF5 into directory /c/hdf5 using - gcc/g++ as C/C++ compiler: - - $ ./configure - --with-zlib=/usr/include,/usr/lib - --prefix=/c/hdf5 - --enable-cxx - <"If no more switches, then hit Enter"> - - Notes: The command format above is for readilibity. In practice, - please type in the command above with at least one - space between each line, No "Enter" until users finish - the switches and want to run the configure. - - - or do it through CPPFLAGS and LDFLAGS variables: - - $ CPPFLAGS=-I/usr/include \ - $ LDFLAGS=-L/usr/lib \ - - $ ./configure - --prefix=/c/hdf5 - --enable-cxx - <"If no more switches, then hit Enter"> - -7. Make and Make Check - - After configuration is done successfully, run the following series of - commands to build, test and install HDF5 - - $ make > "output file name" - $ make check > "output file name" - - Before run "make install", check output file for "make check", there - should be no failures at all. - -8. Make Install - - $ make install > "output file name" - - -9. Check installed HDF5 library - - After step 4, go to your installation directory, there should be - three subdirectories: "bin" "include" and "lib". - ------------------------------------------------------------------------ - -Need Further assistance, email help@hdfgroup.org diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index de31747..7344006 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -35,11 +35,11 @@ Contents: Preconditions: 1. Installed Microsoft Visual Studio. This document is written for Visual - Studio 2008. We no longer support building HDF5 - using Microsoft Visual Studio .NET 2003, or Visual Studio 2005. + Studio 2008. We no longer support building HDF5 using Microsoft Visual + Studio .NET 2003 or 2005. 2. (Optional) Installed Intel Compiler 10.1 or 11.1 if you want to build HDF5 - Fortran libraries. + Fortran libraries. We no longer support Intel Fortran Compiler 9.1. 3. Install Winzip or 7-zip for extracting source tarball. @@ -61,28 +61,34 @@ Preconditions: Click the "Miscellaneous" tab and uncheck "TAR file smart CR/LF conversion" option, then click OK. - 4. Set up a directory structure to unpack the library. For example: + 4. CMake is available for this release on a experimental basis. CMake 2.8.1 + can be downloaded from the KitWare website at http://www.kitware.com. + + Note: We have attempted to mirror our Autoconf configuration files for + maintainence reasons. We are still working out the problems with + some issues like fortran shared libraries and tools testing. We + will maintain the current VS2008 project files for the 1.8 product. + + 5. Set up a directory structure to unpack the library. For example: c:\ (any drive) MyHDFstuff\ (any folder name) - 5. Download the hdf5-1.9.x source code package and use 7zip or WinZip to + 6. Download the hdf5-1.9.x source code package and use 7zip or WinZip to extract the HDF5 package into c:\MyHDFstuff. This creates a directory called 'hdf5-1.9.x' under MyHDFstuff which contains several files and directories. Rename "hdf5-1.9.x" to "hdf5". - 6. HDF5 provide options to do in-memory compression within HDF5 library. + 7. HDF5 provide options to do in-memory compression within HDF5 library. Currently, two external compression libraries Zlib and Szip can be used with HDF5. - 6.1 HDF5 uses Zlib version 1.2.3 for compression and Zlib is NOT + 7.1 HDF5 uses Zlib version 1.2.5 for compression and Zlib is NOT distributed with HDF5 library in 1.9.x release. To use Zlib library, you have to install your own Zlib DLL library or go to - ftp://ftp.hdfgroup.org/lib-external/zlib/1.2/bin/windows - to download the Zlib library. - + http://www.zlib.net/ to download the Zlib library. - 6.2 HDF5 uses Szip version 2.1 for compression and Szip compression + 7.2 HDF5 uses Szip version 2.1 for compression and Szip compression software is provided with HDF5 products in 1.9.x release. To use Szip 2.1 library, you can download Szip source codes and binaries from ftp://ftp.hdfgroup.org/lib-external/szip/2.1/bin/windows @@ -93,7 +99,7 @@ Preconditions: Szip compression feature inside HDF5 is optional. - 7. Define the following environment variables: + 8. Define the following environment variables: HDF5_EXT_ZLIB HDF5_EXT_SZIP @@ -117,18 +123,17 @@ Preconditions: Similarly, you can set: - HDF5_EXT_SZIP environment variable as szlibdll.lib + HDF5_EXT_SZIP environment variable as szip.lib Notes: a. You will have to close and reopen running programs for the new environment variable settings to take effect. - b. c:\zlib123\zlib1.dll and c:\szip\dll\szlibdll.dll should be copied - into the location that the application can find, one suggestion is - to use the c:\WINDOWS\system. + b. c:\zlib\zlib1.dll and c:\szip\szip.dll should be copied + into a location that the application can find. - 6. Set up path for external libraries and headers + 9. Set up path for external libraries and headers Skip this part if you don't want to use ANY compression features provided by HDF5. Please do read Section V. @@ -139,21 +144,21 @@ Preconditions: Invoke Microsoft Visual Studio and go to "Tools" and select "Options", find "Projects", and then "VC++ Directories". - 6.1 If you are building on 64-bit Windows, find the "Platform" dropdown + 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown and select "x64". - 6.2 Find the box "Show directories for", choose "Include files", if you + 9.2 Find the box "Show directories for", choose "Include files", if you can not find your Zlib and Szip header path (for example, - c:\zlib123\include, c:\szip\include) from the directory list, add the - header path (c:\zlib123\include, c:\szip\include) to the included + c:\zlib\include, c:\szip\include) from the directory list, add the + header path (c:\zlib\include, c:\szip\include) to the included directories. - 6.3 Find the box "Show directories for", choose "Library files". If you + 9.3 Find the box "Show directories for", choose "Library files". If you cannot find your Zlib and Szip library path (for example, - c:\zlib123\dll, c:\szip\dll) from the directory list, add the library - path (c:\zlib123\dll, c:\szip\dll) to the library directories. + c:\zlib\dll, c:\szip\dll) from the directory list, add the library + path (c:\zlib\dll, c:\szip\dll) to the library directories. - 6.4 If building Fortran libraries, you will also need to setup the path + 9.4 If building Fortran libraries, you will also need to setup the path for the Intel Fortran compiler. Please see Section VI. Notes: @@ -164,28 +169,30 @@ Notes: 2. Visual Studio 6.0 is no longer supported in HDF5 1.8 or later releases. Visual Studio .NET is no longer support in HDF5 1.8.4 or later releases. Visual Studio 2005 is no longer support in HDF5 1.8.5 or later releases. + Intel Fortran 9.1 is no longer support in HDF5 1.8.5 or later releases. 3. For users who want to quickly build HDF5 library or do not want to know HDF5 building and installation details, please read the - INSTALL_Windows_Short_***.txt relating to your compiler. + INSTALL_Windows_Short_2008.txt relating to your compiler. 4. For users who would like to build and test HDF5 package from the command - line, please read INSATLL_Windows_From_Command_Line.txt. + line, please read INSTALL_Windows_From_Command_Line.txt. - 5. HDF4-related tools are not built and released with HDF5 library packages + 5. For users who would like to build and test HDF5 package using CMake, + please read CMake.txt. + + 6. HDF4-related tools are not built and released with HDF5 library packages any more. To obtain HDF4 related tools, please check http://hdfgroup.org/h4toh5/ and ftp://ftp.hdfgroup.org/HDF5/h4toh5 - 6. For Fortran users, Intel fortran Compiler 10.1 and 11.1 is currently - supported-- please see Section VI. Intel Compiler verion 9.x or earlier are - no longer supported. + 7. For Fortran users, Intel Fortran Compiler 10.1 is currently supported + -- please see Section VI. Intel Compiler verion 7.x, 8.x and 9.x are + no longer supported. Intel Compiler 11.1 can be used but the project files + must be upgraded within the Visual Studio IDE. - 7. For users who would like to build Muti-threaded version of HDF5 library, + 8. Visual Studio now only builds muti-threaded versions of HDF5 library, please read Section VII. - 8. To build HDF5 in Visual Studio 2010, be sure to read the instructions in - Section XI. - ======================================================================== Section I: What do we build and install? @@ -306,7 +313,7 @@ STEP 1: Building HDF5 Libraries and Tools Select "Build" -> "Build Solution" or "Rebuild Solution" to build release version of project "all". - Both debug and release versions must be built for testing. + Release version must be built for testing, debug version is optional. Warning messages can be ignored. @@ -459,6 +466,9 @@ We provide 2 options for users to test HDF5 libraries and tools. To use this option, HDF5 C++ and Fortran libraries must have been built. + nodebug -- can be added to any of the above to + not test debug versions + Invoke a command prompt window and run hdf5check with appropriate option. Users are encouraged to pipe the test output into a file. You should find no "*FAILED*" marks. @@ -796,7 +806,7 @@ To build and test HDF5 High Level C examples: Solution" option. Then open the solution - c:\MyHDFstuff\hdf5\windows\hl\examples\allhlcexamples\allhlcexamples.dsw + c:\MyHDFstuff\hdf5\windows\hl\examples\allhlcexamples\allhlcexamples.sln 2. Select "Build", and "Configuration Manager". @@ -894,7 +904,7 @@ project, you may choose one of the following two methods. HDF5, Zlib, and Szip header files directories. For example: c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib123\include + c:\zlib\include c:\szip\include Then click OK. @@ -916,7 +926,7 @@ project, you may choose one of the following two methods. example, c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib123\include + c:\zlib\include c:\szip\include @@ -941,7 +951,7 @@ project, you may choose one of the following two methods. HDF5, Zlib, and Szip library files directories. For example: c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib123\dll + c:\zlib\dll c:\szip\dll Note: To link with HDF5 DLLs rathern that static libraries, simply @@ -960,7 +970,7 @@ project, you may choose one of the following two methods. example, c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib123\dll + c:\zlib\dll c:\szip\dll Note: To link with HDF5 DLLs rathern that static libraries, simply @@ -975,7 +985,7 @@ project, you may choose one of the following two methods. 1. In Visual Studio, go to the Project menu and choose "Properties". 2. Find the "Link" option and "Input" category. In the "Additional - Dependencies" field, insert "zlib1.lib, szlibdll.lib, hdf5.lib". + Dependencies" field, insert "zlib.lib, libszip.lib, hdf5.lib". 3. (Optional) Also insert "hdf5_cpp.lib" if you want to use HDF5 C++ static library. @@ -1111,13 +1121,16 @@ Warning: When you modify the H5pubconf.h file as described below, DO NOT just Section VI: How to build HDF5 with Fortran Support ======================================================================== -Notes: 1. For Intel Compiler users, Intel fortran Compiler 10.1 and 11.1 are - currently supported-- please see below. Intel Compiler verion 9.x and - earlier are no longer supported. +Notes: 1. For Intel Compiler users, Intel fortran Compiler10.1 is + currently supported. Intel Compiler verion 7.x, 8.x and + 9.x are no longer supported. Intel Compiler 11.1 can be used, however + the fortran project files must be upgraded from within the IDE. - 2. The Compaq Fortran Compiler is no longer supported for HDF5 1.9. + 2. The Compaq Fortran Compiler is no longer supported for HDF5 1.8. - 3. Parallel builds should be disabled. To do so: Go to Tools > + 3. Visual Studio 2008 is supported only with Intel Fortran 10.1 and 11.1. + + 4. Parallel builds should be disabled. To do so: Go to Tools > Options > Projects and Solutions > Build and Run. Set "Maximum Number of Parallel Project Builds" to 1. @@ -1145,19 +1158,19 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 10.1 and 11.1 are right panel, make sure your "Selected Compiler" is Intel Fortran. 3) Select the right-most box for "Libraries", and add Zlib and Szip - library paths (c:\zlib123\dll, c:\szip\dll for example). + library paths (c:\zlib\dll, c:\szip\dll for example). 4) Select right-most box for "Includes", and add Zlib and Szip header - paths (c:\zlib123\include c:\szip\include, for example). + paths (c:\zlib\include c:\szip\include, for example). 5) Then click "OK". -1. Build with Intel Fortran Compiler 10.1 or 11.1 under Visual Studio 2008 +1. Build with Intel Fortran Compiler 11.1 under Visual Studio 2008 Note: This step will build HDF5 Static and DLL C and C++ Library using Visual Studio compiler as well as HDF5 Static and High Level - Fortran Library using Intel Fortran Compiler. + Fortran Library using Intel Fortran 11.1 Compiler. 1.1 Open all_fortran.sln @@ -1381,10 +1394,11 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 10.1 and 11.1 are Section VII : How to build Multi-threaded version of HDF5 library ======================================================================== -Notes: In Visual Studio 2008 Multi-threaded is built by default. Therefore, no extra +Notes: In Visual Studio 2008, the Single-threaded runtime libraries have been + depreciated, and Multi-threaded is built by default. Therefore, no extra work needs to be done to build Multi-threaded libraries in Visual Studio - 2008. - + 2008. + ======================================================================== Section VIII: How To Build And Test HDF5 With Thread-Safe Feature @@ -1577,7 +1591,7 @@ Notes: Prerequisites: - 1. A 64-bit Windows machine. Either AMD64 and Itanium is supported. + 1. A 64-bit Windows machine. 2. Microsoft Visual Studio 2008 installed with x64 Extensions. @@ -1623,7 +1637,7 @@ some minor changes. Therefore, follow the build instructions above, with the following considerations: 1. Only Visual Studio 2008 is currently supported on Windows Vista. - + 2. Elevated security permissions are required to test the HDF5 libraries. This is because DLLs are installed in the system directory. To enable elevated security: diff --git a/release_docs/INSTALL_Windows_From_Command_Line.txt b/release_docs/INSTALL_Windows_From_Command_Line.txt index 771bcf0..7557441 100755 --- a/release_docs/INSTALL_Windows_From_Command_Line.txt +++ b/release_docs/INSTALL_Windows_From_Command_Line.txt @@ -5,12 +5,15 @@ Note: This instruction is written for users who would like to build HDF5 libraries and tools from the HDF5 source code package on command line. We no longer support building HDF5 using Microsoft Visual - Studio 2005. + Studio .NET 2003 or Visual Studio VS2005 or Intel Fortran 91. Currently, we support: 1. Building and testing HDF5 C/C++/Fortran libraries on command line with Microsoft Visual Studio 2008 for 32- or 64-bit Windows. + + 2. Building and testing HDF5 C/C++/Fortran libraries and utilities using + CMake tools. Refer to the CMAKE.txt file for detailed information. For all other Windows development tools, HDF5 should be built in the development environment. Please refer to INSTALL_Windows.txt @@ -42,7 +45,7 @@ notes in INSTALL_Windows.txt before starting below procedures. This should output a path similar to: C:\Program Files\Microsoft Visual Studio 9\Common7\Tools\ - + 1.2 Run batch file copy_hdf.bat. Go to c:\MyHDFstuff\hdf5\windows and run copy_hdf.bat. @@ -112,6 +115,7 @@ notes in INSTALL_Windows.txt before starting below procedures. /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1 /ivf111 Build HDF5 Fortran using Intel Visual Fortran 11.1 /nodebug Build HDF5 release versions only + Note: Default is to build debug and release versions /useenv Build HDF5 using compiler settings defined in the environment, rather than the IDE. /? Help information diff --git a/release_docs/INSTALL_Windows_Short_VS2008.TXT b/release_docs/INSTALL_Windows_Short_VS2008.TXT new file mode 100755 index 0000000..8ff8866 --- /dev/null +++ b/release_docs/INSTALL_Windows_Short_VS2008.TXT @@ -0,0 +1,192 @@ +************************************************************************ +* Build and Install HDF5 C/C++ Library with Visual Studio 2008 * +* with Windows XP (Short Version) * +************************************************************************ + +Notes: This short instruction is written for users who want to quickly build + HDF5 library and tools from the HDF5 source code package with Microsoft + Visual Studio 2008 but do not want to know HDF5 building and installation + details on Windows XP. + + For detailed HDF5 build and install information, or if you have trouble + following any steps in the instructions, please refer to + INSTALL_Windows.txt for further information. + + For users who would like to build and test HDF5 package from the + command line, please refer to INSTALL_Windows_From_Command_Line.txt. + + Notes: + + 1. HDF5 1.8 can also be built using Visual Studio 2008 on Windows + Vista. For details, please see Section X of INSTALL_Windows.txt. + + 2. 64-bit builds are also supported in Visual Studio 2008. For details + please see Section IX of INSTALL_Windows.txt. + + 3. Fortran libraries can be built with Visual Studio 2008 and Intel + Fortran 10.1. For details, see Section VI of INSTALL_Windows.txt. + +WARNINGS: + +Please read CAREFULLY about HDF5 build and install preconditions and +notes in INSTALL_Windows.txt before starting below procedures. + + +======================================================================== + Preconditions +======================================================================== + + 1. Set up path for external libraries and headers + + Skip this part if you don't want to use ANY compression features provided + by HDF5. Please do read Section V in INSTALL_Windows.txt. + + You have to read this part even if you want to only use Zlib or Szip. You + also need to read Section V in INSTALL_Windows.txt. + + Invoke Microsoft Visual Studio and go to "Tools" and select "Options". In + the left pane of "Option" window poped up, choose and expand "Projects", + Click on "VC++ Directories". In the right pane, Find the box "Show + directories for", choose "Include files", if you can not find your Zlib + and Szip header path (for example, c:\zlib125\include, c:\szip\include) + from the directory list, add the header path (c:\zlib125\include, + c:\szip\include) to the included directories. + + Find the box "Show directories for", choose "Library files", If you cannot + find your Zlib and Szip library path (for example, c:\zlib125\dll, + c:\szip\dll) from the directory list, add the library path + (c:\zlib125\dll, c:\szip\dll) to the library directories. + +======================================================================== + Building HDF5 C/C++ Libraries with Visual Studio 2005 +======================================================================== + + 1. Run batch file copy_hdf.bat + + Go to c:\MyHDFstuff\hdf5\windows and run copy_hdf.bat. This process will + copy all the necessary batch files, windows specific source codes and + text files saved under c:\MyHDFstuff\hdf5\windows directory to the + corresponding directories under hdf5. + + 2. Invoke Microsoft Visual Studio compiler + + Invoke Microsoft Visual Studio. From the main menu, go to "File" and + select the "Open Solution" option. Then open the + c:\MyHDFstuff\hdf5\windows\proj\all\all.sln solution if you are building + without Fortran libraries, or + c:\MyHDFstuff\hdf5\windows\proj\all_fortran\all_fortran.sln if you would + like to use Fortran. + + You should find Windows project files listed as "all", "big", etc. on the + left. + + + 3. (Optional) Disable HDF5 C++ and High level C++ + + In HDF5 1.8, C++ and HL C++ libraries are built by default. To opt-out, + you must explicitly disable them. + + 3.1 Skip this step if you do want to build HDF5 High-Level C++ libraries + + Go to "Project" and select "Project Dependencies". Select "all", and + disable all of the following projects: + + hdf5_hl_cpp + hdf5_hl_cppdll + hl_test_table_cpp + hl_test_table_cppdll + + 3.2 Skip this step if you do want to build HDF5 High-Level libraries + + Go to "Project" and select "Project Dependencies". Select "all", and + disable all of the project files listed in the previous step, as well + as the following projects: + + hdf5_hl + hdf5_hldll + hl_test_image + hl_test_imagedll + hl_test_lite + hl_test_litedll + hl_test_table + hl_test_tabledll + hl_test_ds + hl_test_dsdll + hl_test_packet + hl_test_packetdll + + Click on "OK", From the main menu, choose "Build"-> "Build" or + "Rebuild ALL" to build both release and debug version of HDF5 + Libraries. + + + 4. Select "Build", then Select "Configuration Manager". + + 4.1 To build debug static libraries, debug multithreaded DLLs, and tests: + + In "Active Solution Configuration", select "Debug". Select "Close". + Select "Build" -> "Build Solution" or "Rebuild Solution" to build debug + version of project "all". + + 4.2 To build release static libraries, multithreaded DLLs and tests: + + In "Active Solution Configuration", select "Release". Select "Close". + Select "Build" -> "Build Solution" or "Rebuild Solution" to build release + version of project "all". + + Both debug and release versions must be built. + + Warning messages can be ignored. + +======================================================================== + Testing HDF5 C/C++ Libraries +======================================================================== + +HDF5 libraries and tools should be tested to make sure that they were +built correctly. c:\MyHDFstuff\hdf5\hdf5check.bat was provided to test +HDF5 libraries and tools. + +hdf5check.bat has four options: + + hdf5check test HDF5 C library and tools only + + hdf5check enablecpp test HDF5 C/C++ libraries and tools + + hdf5check enablefortran test HDF5 C/Fortran libraries and tools + + hdf5check enableall test HDF5 C/C++/Fortran libraries and tools + + nodebug -- can be added to any of the above to not + test debug versions + +Notes: Users who only build HDF5 C/C++ libraries ONLY have the first + two options. + +Invoke a command prompt window and run hdf5check with appropriate option. +Users are encouraged to pipe the test output into a file. You should find +no "*FAILED*" marks. + +If you want to test HDF5 libraries and tools one by one, please refer to +Section II, step 2 in INSTALL_Windows.txt. + + +======================================================================== + Installing HDF5 C/C++ Libraries +======================================================================== + +Run the batch file c:\MyHDFstuff\hdf5\installhdf5lib.bat to install +all HDF5 libraries and tools into c:\MyHDFstuff\hdf5\hdf5lib directory. + +======================================================================== + Building HDF5 Examples and Applications +======================================================================== + +Building HDF5 Examples is Optional. Please read Section II, step 4 and +the following part in INSTALL_Windows.txt for detailed information. + + + +************************************************************************ + +Need further assistance, send email to help@hdfgroup.org + diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a3946a7..3ea01a6 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.69-FA_a4 currently under development +HDF5 version 1.9.73-FA_a4 currently under development ================================================================================ @@ -39,6 +39,15 @@ New Features Configuration: ------------- + - PHDF5 changed to use "mpiexec", instead of mpirun, as the default MPI + applications startup command as defined in the MPI-2 definition, section + 4.1. (AKC - 2010/6/11 - Bug 1921) + - Configure now adds appropriate defines for supporting large (64-bit) + files on all systems, where supported, by default, instead of only linux. + This largefile support is controllable with the --enable-largefile + configure option. This is replacing the linux-specific --enable-linux-lfs + option, which has been removed from configure. + (MAM - 2010/05/05 - 1772/1434) - Upgraded versions of autotools used to generate configuration suite. We now use Automake 1.11.1, Autoconf 2.65, and Libtool 2.2.6b. MAM 2010/04/15. @@ -67,6 +76,8 @@ New Features Library: -------- + - Improved performance of the chunk cache by avoiding unnecessary b-tree + lookups of chunks already in cache. (NAF - 2010/06/15) - Greatly improved performance of extending a dataset with early allocation. (NAF - 2010/03/24 - 1637) - Added support for filtering densely stored groups. Many of the API @@ -127,10 +138,12 @@ New Features C++ Library: ------------ - - Added function CommonFG::getObjnameByIdx to take char* for name. - (BMR - 2010/05/02) - - Added function CommonFG::getObjTypeByIdx to return type name as - a char*. + - New member functions + + Overloaded CommonFG::getObjnameByIdx to take char* for name + + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. + (BMR - 2010/05/02) + + DataSet::getInMemDataSize() to simplify getting the dataset's + data size in memory. (BMR - 2009/07/26) - These member functions were added as wrapper for H5Rdereference to replace the incorrect IdComponent::dereference(). void H5Object::dereference(H5File& h5file, void* ref) @@ -151,9 +164,11 @@ New Features Tools: ------ + - h5ls: Add new flag --follow-symlinks. (refer to --help for details) + (JKM - 2010/05/25) - h5diff: Add new flag --no-dangling-links. (refer to --help for details) (JKM - 2010/02/10) - - h5diff: Add new flag --follow-links. (refer to --help for details) + - h5diff: Add new flag --follow-symlinks. (refer to --help for details) (JKM - 2010/01/25) - h5diff: fix for displaying garbage value on LE machine for BE data. (JKM - 2009/11/20) @@ -217,6 +232,10 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - Fixed a file corruption bug that could happen when shrinking a + compressed dataset. (NAF - 2010/05/20) + - Fixed some memory leaks in VL datatype conversion when strings are + used as fill values. (MAM - 2010/05/12 - BZ# 1826) - Fixed a bug when copying objects with NULL references with the H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - 1815) - Files can now be concurrently opened more than once using the core file @@ -411,6 +430,16 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - Change h5ls not to manipulate special characters in object name or + attribute name for smart display. bug#1784 (JKM 2010/06/28) + - Fixed h5ls to return exit code 1 (error) when non-existent file is + specified. bug#1793. (JKM 2010/04/27) + - h5copy failed to copy dangling link when the link is specified + directly. bug#1817. (JKM 2010/04/22) + - h5repack lost attributes from a dataset of reference type. bug#1726. + (JKM 2010/3/25) + - h5repack sets NULL for object reference value for group or + named datatype. bug#1814. (JKM 2010/03/19) - h5diff: fixed incorrect behavior (hang) in parallel mode when specify invalid options (ex: -v and -q) (JKM 2010/02/17) - h5dump/h5ls display buffer resize fixed in tools library. @@ -451,6 +480,18 @@ Bug Fixes since HDF5-1.8.0 release High-Level APIs: ------ + - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale + caused by using H5Tget_native_type function to determine the native + type for reading REFERENCE_LIST attribute. The bug was exposed + on Mac PPC. + (EIP - 2010/05/22 -1851) + - Fixed a bug in the H5DSdetach_scale function when 0 bytes + were allocated after the last reference to a dim. scale + was removed from the list of references in a VL element of the + DIMENSION_LIST attribute; modified the function to comply + with the Spec: DIMENSION_LIST attribute is deleted now when no + dimension scales left attached. + (EIP - 2010/05/14 -1822) - Fixed a bug where the H5TB API would forget the order of fields when added out of offset order. (NAF - 2009/10/27 - 1582) - H5DSis_attached failed to account for different platform types. Added a @@ -480,6 +521,16 @@ Bug Fixes since HDF5-1.8.0 release C++ APIs -------- + - The constructor PropList::PropList(id) was fixed to act properly + according to the nature of 'id'. When 'id' is a property class id, + a new property list will be created. When 'id' id a property list id, + a copy of the property list will be made. (BMR - 2010/5/9) + - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and + CommonFG::getComment, respectively, now have default values for + user's convenience. (BMR - 2009/10/23) + - NULL pointer accessing was fixed, bugzilla 1061. (BMR - 2009/10/05) + - read/write methods of DataSet and Attribute classes were fixed + to handle string correctly. (BMR - 2009/07/26) - Fixed bug that caused segfaults in Attribute::read. (BMR - 2008/04/20) - Fixed bug in PropList::getClassName to use portable HDfree instead of free. (BMR - 2008/04/20) @@ -541,15 +592,15 @@ Platforms Tested Intel(R) C++ Version 8.1 Intel(R) Fortran Compiler Version 8.1 mpich-gm-1.2.5..10-intel-r2 - Windows XP - Visual Studio .NET - Visual Studio 2005 w/ Intel Fortran 9.1 - Cygwin(native gcc compiler and g95) - MinGW(native gcc compiler and g95) - Windows XP x64 - Visual Studio 2005 w/ Intel Fortran 9.1 - Windows Vista - Visual Studio 2005 + + Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 + Cygwin(1.7.5 native gcc compiler and gfortran) + + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 10.1 + + Windows Vista Visual Studio 2008 w/ Intel Fortran 10.1 + + Windows Vista x64 Visual Studio 2008 w/ Intel Fortran 10.1 MAC OS 10.5 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) @@ -578,7 +629,8 @@ Cray XT3 (not tested for this release) n n n n n n Windows XP n y(3) n(3) y y y Windows XP x64 n y(3) n(3) y y y -Windows Vista n n n y y y +Windows Vista n y(3) n(3) y y y +Windows Vista x64 n y(3) n(3) y y y Mac OS X 10.5 Intel n y n y y y FreeBSD 6.2 32-bit n n n y y y FreeBSD 6.2 64-bit @@ -606,9 +658,10 @@ AIX-5.2 32-bit n n n x n AIX-5.2 64-bit n n n x n Cray XT3 (not tested for this release) n n n x n -Windows XP y y(3) y y y -Windows XP x64 y y(3) y y y -Windows Vista y n n y y +Windows XP y y(3) y y n +Windows XP x64 y y(3) y y n +Windows Vista y y(3) y y n +Windows Vista x64 y y(3) y y n Mac OS X 10.5 Intel y y y x n FreeBSD 6.2 32-bit y y y x n FreeBSD 6.2 64-bit y y y x n @@ -627,7 +680,7 @@ SuSe Linux 2.6.5 Notes: (1) Using mpich 1.2.6. (2) Using mpich2 1.0.6. - (3) Using Visual Studio 2005 or Cygwin + (3) Using Visual Studio 2008 (Cygwin shared libraries are not supported) (4) With PGI and Absoft compilers. (5) AMD Opteron x86_64 Compiler versions for each platform are listed in the preceding diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..1e05424 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,720 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_SRC C CXX) + +#----------------------------------------------------------------------------- +# List Source Files +#----------------------------------------------------------------------------- +SET (H5_SRCS + ${HDF5_SRC_DIR}/H5.c + ${HDF5_SRC_DIR}/H5checksum.c + ${HDF5_SRC_DIR}/H5dbg.c + ${HDF5_SRC_DIR}/H5system.c + ${HDF5_SRC_DIR}/H5timer.c + ${HDF5_SRC_DIR}/H5trace.c +) + +SET (H5_HDRS + ${HDF5_SRC_DIR}/hdf5.h + ${HDF5_SRC_DIR}/H5api_adpt.h + ${HDF5_SRC_DIR}/H5public.h + ${HDF5_SRC_DIR}/H5version.h + ${HDF5_SRC_DIR}/H5overflow.h +) +IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) + +SET (H5A_SRCS + ${HDF5_SRC_DIR}/H5A.c + ${HDF5_SRC_DIR}/H5Abtree2.c + ${HDF5_SRC_DIR}/H5Adense.c + ${HDF5_SRC_DIR}/H5Adeprec.c + ${HDF5_SRC_DIR}/H5Aint.c + ${HDF5_SRC_DIR}/H5Atest.c +) + +SET (H5A_HDRS + ${HDF5_SRC_DIR}/H5Apkg.h + ${HDF5_SRC_DIR}/H5Apublic.h +) +IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) + +SET (H5AC_SRCS + ${HDF5_SRC_DIR}/H5AC.c +) + +SET (H5AC_HDRS + ${HDF5_SRC_DIR}/H5ACpkg.h + ${HDF5_SRC_DIR}/H5ACpublic.h +) +IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) + +SET (H5B_SRCS + ${HDF5_SRC_DIR}/H5B.c + ${HDF5_SRC_DIR}/H5B2.c + ${HDF5_SRC_DIR}/H5B2cache.c + ${HDF5_SRC_DIR}/H5B2dbg.c + ${HDF5_SRC_DIR}/H5B2hdr.c + ${HDF5_SRC_DIR}/H5B2int.c + ${HDF5_SRC_DIR}/H5B2stat.c + ${HDF5_SRC_DIR}/H5B2test.c + ${HDF5_SRC_DIR}/H5Bcache.c + ${HDF5_SRC_DIR}/H5Bdbg.c +) + +SET (H5B_HDRS + ${HDF5_SRC_DIR}/H5B2pkg.h + ${HDF5_SRC_DIR}/H5B2public.h + ${HDF5_SRC_DIR}/H5Bpkg.h + ${HDF5_SRC_DIR}/H5Bpublic.h +) +IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) + +SET (H5C_SRCS + ${HDF5_SRC_DIR}/H5C.c + ${HDF5_SRC_DIR}/H5CS.c +) + +SET (H5C_HDRS + ${HDF5_SRC_DIR}/H5Cpkg.h + ${HDF5_SRC_DIR}/H5Cpublic.h +) +IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SRCS}" ) + +SET (H5D_SRCS + ${HDF5_SRC_DIR}/H5D.c + ${HDF5_SRC_DIR}/H5Dbtree.c + ${HDF5_SRC_DIR}/H5Dchunk.c + ${HDF5_SRC_DIR}/H5Dcompact.c + ${HDF5_SRC_DIR}/H5Dcontig.c + ${HDF5_SRC_DIR}/H5Ddbg.c + ${HDF5_SRC_DIR}/H5Ddeprec.c + ${HDF5_SRC_DIR}/H5Defl.c + ${HDF5_SRC_DIR}/H5Dfill.c + ${HDF5_SRC_DIR}/H5Dint.c + ${HDF5_SRC_DIR}/H5Dio.c + ${HDF5_SRC_DIR}/H5Dlayout.c + ${HDF5_SRC_DIR}/H5Dmpio.c + ${HDF5_SRC_DIR}/H5Doh.c + ${HDF5_SRC_DIR}/H5Dscatgath.c + ${HDF5_SRC_DIR}/H5Dselect.c + ${HDF5_SRC_DIR}/H5Dtest.c +) + +SET (H5D_HDRS + ${HDF5_SRC_DIR}/H5Dpkg.h + ${HDF5_SRC_DIR}/H5Dpublic.h +) +IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) + +SET (H5E_SRCS + ${HDF5_SRC_DIR}/H5E.c + ${HDF5_SRC_DIR}/H5Edeprec.c + ${HDF5_SRC_DIR}/H5Eint.c +) + +SET (H5E_HDRS + ${HDF5_SRC_DIR}/H5Edefin.h + ${HDF5_SRC_DIR}/H5Einit.h + ${HDF5_SRC_DIR}/H5Epkg.h + ${HDF5_SRC_DIR}/H5Epubgen.h + ${HDF5_SRC_DIR}/H5Epublic.h + ${HDF5_SRC_DIR}/H5Eterm.h +) +IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" ) + +SET (H5EA_SRCS + ${HDF5_SRC_DIR}/H5EA.c + ${HDF5_SRC_DIR}/H5EAcache.c + ${HDF5_SRC_DIR}/H5EAdbg.c + ${HDF5_SRC_DIR}/H5EAdblkpage.c + ${HDF5_SRC_DIR}/H5EAdblock.c + ${HDF5_SRC_DIR}/H5EAhdr.c + ${HDF5_SRC_DIR}/H5EAiblock.c + ${HDF5_SRC_DIR}/H5EAint.c + ${HDF5_SRC_DIR}/H5EAsblock.c + ${HDF5_SRC_DIR}/H5EAstat.c + ${HDF5_SRC_DIR}/H5EAtest.c +) + +SET (H5EA_HDRS + ${HDF5_SRC_DIR}/H5EApkg.h +) +IDE_GENERATED_PROPERTIES ("H5EA" "${H5EA_HDRS}" "${H5EA_SRCS}" ) + +SET (H5F_SRCS + ${HDF5_SRC_DIR}/H5F.c + ${HDF5_SRC_DIR}/H5Faccum.c + ${HDF5_SRC_DIR}/H5Fdbg.c + ${HDF5_SRC_DIR}/H5Fdeprec.c + ${HDF5_SRC_DIR}/H5Ffake.c + ${HDF5_SRC_DIR}/H5Fio.c + ${HDF5_SRC_DIR}/H5Fmount.c + ${HDF5_SRC_DIR}/H5Fmpi.c + ${HDF5_SRC_DIR}/H5Fquery.c + ${HDF5_SRC_DIR}/H5Fsfile.c + ${HDF5_SRC_DIR}/H5Fsuper.c + ${HDF5_SRC_DIR}/H5Fsuper_cache.c + ${HDF5_SRC_DIR}/H5Ftest.c +) + +SET (H5F_HDRS + ${HDF5_SRC_DIR}/H5Fpkg.h + ${HDF5_SRC_DIR}/H5Fpublic.h +) +IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" ) + +SET (H5FA_SRCS + ${HDF5_SRC_DIR}/H5FA.c + ${HDF5_SRC_DIR}/H5FAcache.c + ${HDF5_SRC_DIR}/H5FAdbg.c + ${HDF5_SRC_DIR}/H5FAdblock.c + ${HDF5_SRC_DIR}/H5FAdblkpage.c + ${HDF5_SRC_DIR}/H5FAhdr.c + ${HDF5_SRC_DIR}/H5FAstat.c + ${HDF5_SRC_DIR}/H5FAtest.c +) + +SET (H5FA_HDRS + ${HDF5_SRC_DIR}/H5FApkg.h +) +IDE_GENERATED_PROPERTIES ("H5FA" "${H5FA_HDRS}" "${H5FA_SRCS}" ) + +SET (H5FD_SRCS + ${HDF5_SRC_DIR}/H5FD.c + ${HDF5_SRC_DIR}/H5FDcore.c + ${HDF5_SRC_DIR}/H5FDdirect.c + ${HDF5_SRC_DIR}/H5FDfamily.c + ${HDF5_SRC_DIR}/H5FDint.c + ${HDF5_SRC_DIR}/H5FDlog.c + ${HDF5_SRC_DIR}/H5FDmpi.c + ${HDF5_SRC_DIR}/H5FDmpio.c + ${HDF5_SRC_DIR}/H5FDmpiposix.c + ${HDF5_SRC_DIR}/H5FDmulti.c + ${HDF5_SRC_DIR}/H5FDsec2.c + ${HDF5_SRC_DIR}/H5FDspace.c + ${HDF5_SRC_DIR}/H5FDstdio.c +) + +SET (H5FD_HDRS + ${HDF5_SRC_DIR}/H5FDcore.h + ${HDF5_SRC_DIR}/H5FDdirect.h + ${HDF5_SRC_DIR}/H5FDfamily.h + ${HDF5_SRC_DIR}/H5FDlog.h + ${HDF5_SRC_DIR}/H5FDmpi.h + ${HDF5_SRC_DIR}/H5FDmpio.h + ${HDF5_SRC_DIR}/H5FDmpiposix.h + ${HDF5_SRC_DIR}/H5FDmulti.h + ${HDF5_SRC_DIR}/H5FDpkg.h + ${HDF5_SRC_DIR}/H5FDpublic.h + ${HDF5_SRC_DIR}/H5FDsec2.h + ${HDF5_SRC_DIR}/H5FDstdio.h +) +IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" ) + +SET (H5FS_SRCS + ${HDF5_SRC_DIR}/H5FS.c + ${HDF5_SRC_DIR}/H5FScache.c + ${HDF5_SRC_DIR}/H5FSdbg.c + ${HDF5_SRC_DIR}/H5FSsection.c + ${HDF5_SRC_DIR}/H5FSstat.c + ${HDF5_SRC_DIR}/H5FStest.c +) + +SET (H5FS_HDRS + ${HDF5_SRC_DIR}/H5FSpkg.h + ${HDF5_SRC_DIR}/H5FSpublic.h +) +IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) + +SET (H5G_SRCS + ${HDF5_SRC_DIR}/H5G.c + ${HDF5_SRC_DIR}/H5Gbtree2.c + ${HDF5_SRC_DIR}/H5Gcache.c + ${HDF5_SRC_DIR}/H5Gcompact.c + ${HDF5_SRC_DIR}/H5Gdense.c + ${HDF5_SRC_DIR}/H5Gdeprec.c + ${HDF5_SRC_DIR}/H5Gent.c + ${HDF5_SRC_DIR}/H5Gint.c + ${HDF5_SRC_DIR}/H5Glink.c + ${HDF5_SRC_DIR}/H5Gloc.c + ${HDF5_SRC_DIR}/H5Gname.c + ${HDF5_SRC_DIR}/H5Gnode.c + ${HDF5_SRC_DIR}/H5Gobj.c + ${HDF5_SRC_DIR}/H5Goh.c + ${HDF5_SRC_DIR}/H5Groot.c + ${HDF5_SRC_DIR}/H5Gstab.c + ${HDF5_SRC_DIR}/H5Gtest.c + ${HDF5_SRC_DIR}/H5Gtraverse.c +) + +SET (H5G_HDRS + ${HDF5_SRC_DIR}/H5Gpkg.h + ${HDF5_SRC_DIR}/H5Gpublic.h +) +IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) + +SET (H5HF_SRCS + ${HDF5_SRC_DIR}/H5HF.c + ${HDF5_SRC_DIR}/H5HFbtree2.c + ${HDF5_SRC_DIR}/H5HFcache.c + ${HDF5_SRC_DIR}/H5HFdbg.c + ${HDF5_SRC_DIR}/H5HFdblock.c + ${HDF5_SRC_DIR}/H5HFdtable.c + ${HDF5_SRC_DIR}/H5HFhdr.c + ${HDF5_SRC_DIR}/H5HFhuge.c + ${HDF5_SRC_DIR}/H5HFiblock.c + ${HDF5_SRC_DIR}/H5HFiter.c + ${HDF5_SRC_DIR}/H5HFman.c + ${HDF5_SRC_DIR}/H5HFsection.c + ${HDF5_SRC_DIR}/H5HFspace.c + ${HDF5_SRC_DIR}/H5HFstat.c + ${HDF5_SRC_DIR}/H5HFtest.c + ${HDF5_SRC_DIR}/H5HFtiny.c +) + +SET (H5HF_HDRS + ${HDF5_SRC_DIR}/H5HFpkg.h + ${HDF5_SRC_DIR}/H5HFpublic.h +) +IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) + +SET (H5HG_SRCS + ${HDF5_SRC_DIR}/H5HG.c + ${HDF5_SRC_DIR}/H5HGcache.c + ${HDF5_SRC_DIR}/H5HGdbg.c +) + +SET (H5HG_HDRS + ${HDF5_SRC_DIR}/H5HGpkg.h + ${HDF5_SRC_DIR}/H5HGpublic.h +) +IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" ) + +SET (H5HL_SRCS + ${HDF5_SRC_DIR}/H5HL.c + ${HDF5_SRC_DIR}/H5HLcache.c + ${HDF5_SRC_DIR}/H5HLdbg.c + ${HDF5_SRC_DIR}/H5HLint.c +) + +SET (H5HL_HDRS + ${HDF5_SRC_DIR}/H5HLpkg.h + ${HDF5_SRC_DIR}/H5HLpublic.h +) +IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_SRCS}" ) + +SET (H5MF_SRCS + ${HDF5_SRC_DIR}/H5MF.c + ${HDF5_SRC_DIR}/H5MFaggr.c + ${HDF5_SRC_DIR}/H5MFdbg.c + ${HDF5_SRC_DIR}/H5MFsection.c +) + +SET (H5MF_HDRS +) +IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" ) + +SET (H5MP_SRCS + ${HDF5_SRC_DIR}/H5MP.c + ${HDF5_SRC_DIR}/H5MPtest.c +) + +SET (H5MP_HDRS + ${HDF5_SRC_DIR}/H5MPpkg.h +) +IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) + +SET (H5O_SRCS + ${HDF5_SRC_DIR}/H5O.c + ${HDF5_SRC_DIR}/H5Oainfo.c + ${HDF5_SRC_DIR}/H5Oalloc.c + ${HDF5_SRC_DIR}/H5Oattr.c + ${HDF5_SRC_DIR}/H5Oattribute.c + ${HDF5_SRC_DIR}/H5Obogus.c + ${HDF5_SRC_DIR}/H5Obtreek.c + ${HDF5_SRC_DIR}/H5Ocache.c + ${HDF5_SRC_DIR}/H5Ochunk.c + ${HDF5_SRC_DIR}/H5Ocont.c + ${HDF5_SRC_DIR}/H5Ocopy.c + ${HDF5_SRC_DIR}/H5Odbg.c + ${HDF5_SRC_DIR}/H5Odrvinfo.c + ${HDF5_SRC_DIR}/H5Odtype.c + ${HDF5_SRC_DIR}/H5Oefl.c + ${HDF5_SRC_DIR}/H5Ofill.c + ${HDF5_SRC_DIR}/H5Ofsinfo.c + ${HDF5_SRC_DIR}/H5Oginfo.c + ${HDF5_SRC_DIR}/H5Olayout.c + ${HDF5_SRC_DIR}/H5Olinfo.c + ${HDF5_SRC_DIR}/H5Olink.c + ${HDF5_SRC_DIR}/H5Omessage.c + ${HDF5_SRC_DIR}/H5Omtime.c + ${HDF5_SRC_DIR}/H5Oname.c + ${HDF5_SRC_DIR}/H5Onull.c + ${HDF5_SRC_DIR}/H5Opline.c + ${HDF5_SRC_DIR}/H5Orefcount.c + ${HDF5_SRC_DIR}/H5Osdspace.c + ${HDF5_SRC_DIR}/H5Oshared.c + ${HDF5_SRC_DIR}/H5Oshmesg.c + ${HDF5_SRC_DIR}/H5Ostab.c + ${HDF5_SRC_DIR}/H5Otest.c + ${HDF5_SRC_DIR}/H5Ounknown.c +) + +SET (H5O_HDRS + ${HDF5_SRC_DIR}/H5Opkg.h + ${HDF5_SRC_DIR}/H5Opublic.h + ${HDF5_SRC_DIR}/H5Oshared.h +) +IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" ) + +SET (H5P_SRCS + ${HDF5_SRC_DIR}/H5P.c + ${HDF5_SRC_DIR}/H5Pacpl.c + ${HDF5_SRC_DIR}/H5Pdapl.c + ${HDF5_SRC_DIR}/H5Pdcpl.c + ${HDF5_SRC_DIR}/H5Pdeprec.c + ${HDF5_SRC_DIR}/H5Pdxpl.c + ${HDF5_SRC_DIR}/H5Pfapl.c + ${HDF5_SRC_DIR}/H5Pfcpl.c + ${HDF5_SRC_DIR}/H5Pfmpl.c + ${HDF5_SRC_DIR}/H5Pgcpl.c + ${HDF5_SRC_DIR}/H5Pint.c + ${HDF5_SRC_DIR}/H5Plapl.c + ${HDF5_SRC_DIR}/H5Plcpl.c + ${HDF5_SRC_DIR}/H5Pocpl.c + ${HDF5_SRC_DIR}/H5Pocpypl.c + ${HDF5_SRC_DIR}/H5Pstrcpl.c + ${HDF5_SRC_DIR}/H5Ptest.c +) + +SET (H5P_HDRS + ${HDF5_SRC_DIR}/H5Ppkg.h + ${HDF5_SRC_DIR}/H5Ppublic.h +) +IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) + +SET (H5S_SRCS + ${HDF5_SRC_DIR}/H5S.c + ${HDF5_SRC_DIR}/H5Sall.c + ${HDF5_SRC_DIR}/H5Sdbg.c + ${HDF5_SRC_DIR}/H5Shyper.c + ${HDF5_SRC_DIR}/H5Smpio.c + ${HDF5_SRC_DIR}/H5Snone.c + ${HDF5_SRC_DIR}/H5Spoint.c + ${HDF5_SRC_DIR}/H5Sselect.c + ${HDF5_SRC_DIR}/H5Stest.c +) + +SET (H5S_HDRS + ${HDF5_SRC_DIR}/H5Spkg.h + ${HDF5_SRC_DIR}/H5Spublic.h +) +IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" ) + +SET (H5SM_SRCS + ${HDF5_SRC_DIR}/H5SM.c + ${HDF5_SRC_DIR}/H5SMbtree2.c + ${HDF5_SRC_DIR}/H5SMcache.c + ${HDF5_SRC_DIR}/H5SMmessage.c + ${HDF5_SRC_DIR}/H5SMtest.c +) + +SET (H5SM_HDRS + ${HDF5_SRC_DIR}/H5SMpkg.h +) +IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" ) + +SET (H5T_SRCS + ${HDF5_SRC_DIR}/H5T.c + ${HDF5_SRC_DIR}/H5Tarray.c + ${HDF5_SRC_DIR}/H5Tbit.c + ${HDF5_SRC_DIR}/H5Tcommit.c + ${HDF5_SRC_DIR}/H5Tcompound.c + ${HDF5_SRC_DIR}/H5Tconv.c + ${HDF5_SRC_DIR}/H5Tcset.c + ${HDF5_SRC_DIR}/H5Tdbg.c + ${HDF5_SRC_DIR}/H5Tdeprec.c + ${HDF5_SRC_DIR}/H5Tenum.c + ${HDF5_SRC_DIR}/H5Tfields.c + ${HDF5_SRC_DIR}/H5Tfixed.c + ${HDF5_SRC_DIR}/H5Tfloat.c + ${HDF5_SRC_DIR}/H5Tnative.c + ${HDF5_SRC_DIR}/H5Toffset.c + ${HDF5_SRC_DIR}/H5Toh.c + ${HDF5_SRC_DIR}/H5Topaque.c + ${HDF5_SRC_DIR}/H5Torder.c + ${HDF5_SRC_DIR}/H5Tpad.c + ${HDF5_SRC_DIR}/H5Tprecis.c + ${HDF5_SRC_DIR}/H5Tstrpad.c + ${HDF5_SRC_DIR}/H5Tvisit.c + ${HDF5_SRC_DIR}/H5Tvlen.c +) + +SET (H5T_HDRS + ${HDF5_SRC_DIR}/H5Tpkg.h + ${HDF5_SRC_DIR}/H5Tpublic.h +) +IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" ) + +SET (H5Z_SRCS + ${HDF5_SRC_DIR}/H5Z.c + ${HDF5_SRC_DIR}/H5Zdeflate.c + ${HDF5_SRC_DIR}/H5Zfletcher32.c + ${HDF5_SRC_DIR}/H5Znbit.c + ${HDF5_SRC_DIR}/H5Zscaleoffset.c + ${HDF5_SRC_DIR}/H5Zshuffle.c + ${HDF5_SRC_DIR}/H5Zszip.c + ${HDF5_SRC_DIR}/H5Ztrans.c +) + +SET (H5Z_HDRS + ${HDF5_SRC_DIR}/H5Zpkg.h + ${HDF5_SRC_DIR}/H5Zpublic.h +) +IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) + +SET (common_SRCS + ${H5_SRCS} + ${H5A_SRCS} + ${H5AC_SRCS} + ${H5B_SRCS} + ${H5C_SRCS} + ${H5D_SRCS} + ${H5E_SRCS} + ${H5EA_SRCS} + ${H5F_SRCS} + ${H5FA_SRCS} + ${H5FD_SRCS} + ${H5FS_SRCS} + ${H5G_SRCS} + ${H5HF_SRCS} + ${H5HG_SRCS} + ${H5HL_SRCS} + ${H5MF_SRCS} + ${H5MP_SRCS} + ${H5O_SRCS} + ${H5P_SRCS} + ${H5S_SRCS} + ${H5SM_SRCS} + ${H5T_SRCS} + ${H5Z_SRCS} + ${HDF5_SRC_DIR}/H5FL.c + ${HDF5_SRC_DIR}/H5FO.c + ${HDF5_SRC_DIR}/H5HP.c + ${HDF5_SRC_DIR}/H5I.c + ${HDF5_SRC_DIR}/H5L.c + ${HDF5_SRC_DIR}/H5Lexternal.c + ${HDF5_SRC_DIR}/H5MM.c + ${HDF5_SRC_DIR}/H5R.c + ${HDF5_SRC_DIR}/H5RC.c + ${HDF5_SRC_DIR}/H5Rdeprec.c + ${HDF5_SRC_DIR}/H5RS.c + ${HDF5_SRC_DIR}/H5SL.c + ${HDF5_SRC_DIR}/H5ST.c + ${HDF5_SRC_DIR}/H5TS.c + ${HDF5_SRC_DIR}/H5V.c + ${HDF5_SRC_DIR}/H5WB.c +) + +SET (H5_PUBLIC_HEADERS + ${H5_HDRS} + ${H5A_HDRS} + ${H5AC_HDRS} + ${H5B_HDRS} + ${H5C_HDRS} + ${H5D_HDRS} + ${H5E_HDRS} + ${H5EA_HDRS} + ${H5F_HDRS} + ${H5FA_HDRS} + ${H5FD_HDRS} + ${H5FS_HDRS} + ${H5G_HDRS} + ${H5HF_HDRS} + ${H5HG_HDRS} + ${H5HL_HDRS} + ${H5MF_HDRS} + ${H5MP_HDRS} + ${H5O_HDRS} + ${H5P_HDRS} + ${H5S_HDRS} + ${H5SM_HDRS} + ${H5T_HDRS} + ${H5Z_HDRS} + ${HDF5_SRC_DIR}/H5Ipkg.h + ${HDF5_SRC_DIR}/H5Ipublic.h + ${HDF5_SRC_DIR}/H5Lpkg.h + ${HDF5_SRC_DIR}/H5Lpublic.h + ${HDF5_SRC_DIR}/H5MMpublic.h + ${HDF5_SRC_DIR}/H5Rpkg.h + ${HDF5_SRC_DIR}/H5Rpublic.h +) + +# -------------------------------------------------------------------- +# If we are compiling on Windows then add the windows specific files +# -------------------------------------------------------------------- +IF (WIN32) + SET (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5FDwindows.c) + SET (H5_PUBLIC_HEADERS ${H5_PUBLIC_HEADERS} ${HDF5_SRC_DIR}/H5FDwindows.h) +ENDIF (WIN32) + +SET (H5_PRIVATE_HEADERS + ${HDF5_SRC_DIR}/H5private.h + ${HDF5_SRC_DIR}/H5Aprivate.h + ${HDF5_SRC_DIR}/H5ACprivate.h + ${HDF5_SRC_DIR}/H5B2private.h + ${HDF5_SRC_DIR}/H5Bprivate.h + ${HDF5_SRC_DIR}/H5Cprivate.h + ${HDF5_SRC_DIR}/H5CSprivate.h + ${HDF5_SRC_DIR}/H5Dprivate.h + ${HDF5_SRC_DIR}/H5Eprivate.h + ${HDF5_SRC_DIR}/H5EAprivate.h + ${HDF5_SRC_DIR}/H5FAprivate.h + ${HDF5_SRC_DIR}/H5FDprivate.h + ${HDF5_SRC_DIR}/H5Fprivate.h + ${HDF5_SRC_DIR}/H5FLprivate.h + ${HDF5_SRC_DIR}/H5FOprivate.h + ${HDF5_SRC_DIR}/H5MFprivate.h + ${HDF5_SRC_DIR}/H5MMprivate.h + ${HDF5_SRC_DIR}/H5Cprivate.h + ${HDF5_SRC_DIR}/H5FSprivate.h + ${HDF5_SRC_DIR}/H5Gprivate.h + ${HDF5_SRC_DIR}/H5HFprivate.h + ${HDF5_SRC_DIR}/H5HGprivate.h + ${HDF5_SRC_DIR}/H5HLprivate.h + ${HDF5_SRC_DIR}/H5HPprivate.h + ${HDF5_SRC_DIR}/H5Iprivate.h + ${HDF5_SRC_DIR}/H5Lprivate.h + ${HDF5_SRC_DIR}/H5MPprivate.h + ${HDF5_SRC_DIR}/H5Oprivate.h + ${HDF5_SRC_DIR}/H5Pprivate.h + ${HDF5_SRC_DIR}/H5RCprivate.h + ${HDF5_SRC_DIR}/H5Rprivate.h + ${HDF5_SRC_DIR}/H5RSprivate.h + ${HDF5_SRC_DIR}/H5SLprivate.h + ${HDF5_SRC_DIR}/H5SMprivate.h + ${HDF5_SRC_DIR}/H5Sprivate.h + ${HDF5_SRC_DIR}/H5STprivate.h + ${HDF5_SRC_DIR}/H5Tprivate.h + ${HDF5_SRC_DIR}/H5TSprivate.h + ${HDF5_SRC_DIR}/H5Vprivate.h + ${HDF5_SRC_DIR}/H5WBprivate.h + ${HDF5_SRC_DIR}/H5Zprivate.h + ${HDF5_SRC_DIR}/H5win32defs.h +) + +INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR}) +INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) + +#----------------------------------------------------------------------------- +# When building utility executables that generate other (source) files : +# we make use of the following variables defined in the root CMakeLists. +# Certain systems may add /Debug or /Release to output paths +# and we need to call the executable from inside the CMake configuration +#----------------------------------------------------------------------------- +#inherit EXE_EXT from parent HDF5 cmake project +#inherit CFG_INIT from parent HDF5 cmake project + +#----------------------------------------------------------------------------- +# Setup the H5Detect utility which generates H5Tinit with platform +# specific type checks inside +#----------------------------------------------------------------------------- +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5detect${EXE_EXT}) +IF (XCODE) + SET (CMD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5detect") +ENDIF (XCODE) +ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +IF (MSVC) + TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") +ENDIF (MSVC) + +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c + COMMAND ${CMD} + ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c + DEPENDS H5detect +) + +SET (CMDL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5make_libsettings${EXE_EXT}) +IF (XCODE) + SET (CMDL "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5make_libsettings") +ENDIF (XCODE) +ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +IF (MSVC) + TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") +ENDIF (MSVC) + +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c + COMMAND ${CMDL} + ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c + DEPENDS H5make_libsettings +) + +ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_BINARY_DIR}/H5Edefin.h + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt + COMMENT " Creating err headers" +) + +ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_BINARY_DIR}/H5version.h + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt + COMMENT " Creating API version macro" +) + +ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_BINARY_DIR}/H5overflow.h + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt + COMMENT " Creating Assignment overflow macro" +) + +#----------------------------------------------------------------------------- +# Add H5Tinit source to build - generated by H5Detect/CMake at configure time +#----------------------------------------------------------------------------- +SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) +SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) +SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) +SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) +SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) +SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) +SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) +SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5version.h GENERATED) +SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) +SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) + +ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) +SET_TARGET_PROPERTIES(${HDF5_LIB_TARGET} PROPERTIES DEFINE_SYMBOL ${HDF5_LIB_CORENAME}_EXPORTS) +TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${H5_PUBLIC_HEADERS} + ${H5_PRIVATE_HEADERS} + DESTINATION + include + COMPONENT + headers +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib COMPONENT libraries + ARCHIVE DESTINATION lib COMPONENT libraries + RUNTIME DESTINATION bin COMPONENT libraries + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/src/H5AC.c b/src/H5AC.c index d5d7589..76e43dd 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -24,22 +24,6 @@ * with a particular HDF file share the same cache; each * HDF file has it's own cache. * - * Modifications: - * - * Robb Matzke, 4 Aug 1997 - * Added calls to H5E. - * - * Quincey Koziol, 22 Apr 2000 - * Turned on "H5AC_SORT_BY_ADDR" - * - * John Mainzer, 5/19/04 - * Complete redesign and rewrite. See the header comments for - * H5AC_t for an overview of what is going on. - * - * John Mainzer, 6/4/04 - * Factored the new cache code into a separate file (H5C.c) to - * facilitate re-use. Re-worked this file again to use H5C. - * *------------------------------------------------------------------------- */ @@ -91,7 +75,7 @@ H5FL_DEFINE_STATIC(H5AC_aux_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 renamed. They are + * dirty in an unprotect, inserted, or moved. They are * removed when they appear in a clean entries broadcast. * ****************************************************************************/ @@ -155,9 +139,7 @@ static herr_t H5AC_log_deleted_entry(H5AC_t * cache_ptr, unsigned int flags); static herr_t H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, - haddr_t addr, - hbool_t size_changed, - size_t new_size); + haddr_t addr); static herr_t H5AC_log_flushed_entry(H5C_t * cache_ptr, haddr_t addr, @@ -175,9 +157,7 @@ static herr_t H5AC_log_flushed_entry_dummy(H5C_t * cache_ptr, static herr_t H5AC_log_inserted_entry(H5F_t * f, H5AC_t * cache_ptr, - H5AC_info_t * entry_ptr, - const H5AC_class_t * type, - haddr_t addr); + H5AC_info_t * entry_ptr); static herr_t H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, hid_t dxpl_id, @@ -189,7 +169,7 @@ static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, hid_t secondary_dxpl_id, H5AC_t * cache_ptr); -static herr_t H5AC_log_renamed_entry(const H5F_t * f, +static herr_t H5AC_log_moved_entry(const H5F_t * f, haddr_t old_addr, haddr_t new_addr); @@ -209,8 +189,6 @@ static herr_t H5AC_flush_entries(H5F_t *f); * Programmer: Quincey Koziol * Saturday, January 18, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -236,8 +214,6 @@ done: * Programmer: Quincey Koziol * Thursday, July 18, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -357,8 +333,6 @@ done: * Programmer: Quincey Koziol * Thursday, July 18, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -420,57 +394,6 @@ H5AC_term_interface(void) * matzke@llnl.gov * Jul 9 1997 * - * Modifications: - * - * Complete re-design and re-write to support the re-designed - * metadata cache. - * - * At present, the size_hint is ignored, and the - * max_cache_size and min_clean_size fields are hard - * coded. This should be fixed, but a parameter - * list change will be required, so I will leave it - * for now. - * - * Since no-one seems to care, the function now returns - * one on success. - * JRM - 4/28/04 - * - * Reworked the function again after abstracting its guts to - * the similar function in H5C.c. The function is now a - * wrapper for H5C_create(). - * JRM - 6/4/04 - * - * Deleted the old size_hint parameter and added the - * max_cache_size, and min_clean_size parameters. - * - * JRM - 3/10/05 - * - * Deleted the max_cache_size, and min_clean_size parameters, - * and added the config_ptr parameter. Added code to - * validate the resize configuration before we do anything. - * - * JRM - 3/24/05 - * - * Changed the type of config_ptr from H5AC_auto_size_ctl_t * - * to H5AC_cache_config_t *. Propagated associated changes - * through the function. - * JRM - 4/7/05 - * - * Added code allocating and initializing the auxilary - * structure (an instance of H5AC_aux_t), and linking it - * to the instance of H5C_t created by H5C_create(). At - * present, the auxilary structure is only used in PHDF5. - * - * JRM - 6/28/05 - * - * Added code to set the prefix if required. - * - * JRM - 1/20/06 - * - * Added code to initialize the new write_done field. - * - * JRM - 5/11/06 - * *------------------------------------------------------------------------- */ @@ -581,8 +504,8 @@ H5AC_create(const H5F_t *f, aux_ptr->unprotect_dirty_bytes_updates = 0; aux_ptr->insert_dirty_bytes = 0; aux_ptr->insert_dirty_bytes_updates = 0; - aux_ptr->rename_dirty_bytes = 0; - aux_ptr->rename_dirty_bytes_updates = 0; + aux_ptr->move_dirty_bytes = 0; + 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; @@ -815,12 +738,6 @@ done: * Programmer: John Mainzer * 6/30/06 * - * Modifications: - * - * Added 'flags' paramater, to allow freeing file space - * - * QAK - 2/5/08 - * *------------------------------------------------------------------------- */ herr_t @@ -867,7 +784,7 @@ H5AC_expunge_entry(H5F_t *f, #endif /* H5AC__TRACE_FILE_ENABLED */ result = H5C_expunge_entry(f, - dxpl_id, + dxpl_id, H5AC_noblock_dxpl_id, type, addr, @@ -979,10 +896,6 @@ done: * Programmer: John Mainzer * 4/27/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1064,60 +977,12 @@ done: * matzke@llnl.gov * Jul 9 1997 * - * Modifications: - * Robb Matzke, 1999-07-27 - * The ADDR argument is passed by value. - * - * Bill Wendling, 2003-09-16 - * Added automatic "flush" if the FPHDF5 driver is being - * used. This'll write the metadata to the SAP where other, - * lesser processes can grab it. - * - * JRM - 5/13/04 - * Complete re-write for the new metadata cache. The new - * code is functionally almost identical to the old, although - * the sanity check for a protected entry is now an assert - * at the beginning of the function. - * - * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_insert_entry() - * in H5C.c, and then re-wrote the function as a wrapper for - * H5C_insert_entry(). - * - * JRM - 1/6/05 - * Added the flags parameter. At present, this parameter is - * only used to set the new flush_marker field on the new - * entry. Since this doesn't apply to the SAP code, no change - * is needed there. Thus the only change to the body of the - * code is to pass the flags parameter through to - * H5C_insert_entry(). - * - * JRM - 6/6/05 - * Added code to force newly inserted entries to be dirty - * in the flexible parallel case. The normal case is handled - * in H5C.c. This is part of a series of changes directed at - * moving management of the dirty flag on cache entries into - * the cache code. - * - * JRM - 7/5/05 - * Added code to track dirty byte generation, and to trigger - * clean entry list propagation when it exceeds a user - * specified threshold. Note that this code only applies in - * the PHDF5 case. It should have no effect on either the - * serial or FPHSD5 cases. - * - * JRM - 6/6/06 - * Added trace file support. - * *------------------------------------------------------------------------- */ - herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags) { - herr_t result; - H5AC_info_t *info; #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ @@ -1164,74 +1029,43 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, } #endif /* H5AC__TRACE_FILE_ENABLED */ - /* Get local copy of this information */ - info = (H5AC_info_t *)thing; - - info->addr = addr; - info->type = type; - info->is_protected = FALSE; - -#ifdef H5_HAVE_PARALLEL - if ( NULL != (aux_ptr = f->shared->cache->aux_ptr) ) { - - result = H5AC_log_inserted_entry(f, - f->shared->cache, - (H5AC_info_t *)thing, - type, - addr); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \ - "H5AC_log_inserted_entry() failed.") - } - } -#endif /* H5_HAVE_PARALLEL */ - - result = H5C_insert_entry(f, - dxpl_id, - H5AC_noblock_dxpl_id, - type, - addr, - thing, - flags); - - if ( result < 0 ) { - + /* Insert entry into metadata cache */ + if(H5C_insert_entry(f, dxpl_id, H5AC_noblock_dxpl_id, type, addr, thing, flags) < 0) 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 - /* Check if we should try to flush */ - if(aux_ptr && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) { - hbool_t evictions_enabled; - - /* Query if evictions are allowed */ - if(H5C_get_evictions_enabled((const H5C_t *)f->shared->cache, &evictions_enabled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_get_evictions_enabled() failed.") - - /* Flush if evictions are allowed */ - if(evictions_enabled) { - if(H5AC_propagate_flushed_and_still_clean_entries_list(f, - H5AC_noblock_dxpl_id, f->shared->cache, TRUE) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") + if(NULL != (aux_ptr = f->shared->cache->aux_ptr)) { + if(H5AC_log_inserted_entry(f, f->shared->cache, (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) { + hbool_t evictions_enabled; + + /* Query if evictions are allowed */ + if(H5C_get_evictions_enabled((const H5C_t *)f->shared->cache, &evictions_enabled) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_get_evictions_enabled() failed.") + + /* Flush if evictions are allowed */ + if(evictions_enabled) { + if(H5AC_propagate_flushed_and_still_clean_entries_list(f, + H5AC_noblock_dxpl_id, f->shared->cache, TRUE) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") + } /* end if */ } /* end if */ } /* end if */ #endif /* H5_HAVE_PARALLEL */ done: - #if H5AC__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + if(trace_file_ptr != NULL) { HDfprintf(trace_file_ptr, "%s %d %d\n", trace, (int)trace_entry_size, (int)ret_value); @@ -1239,96 +1073,15 @@ done: #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_set() */ /*------------------------------------------------------------------------- - * Function: H5AC_mark_pinned_entry_dirty - * - * Purpose: Mark a pinned entry as dirty. The target entry MUST be - * be pinned, and MUST be unprotected. - * - * If the entry has changed size, the function updates - * data structures for the size change. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 4/11/06 - * - *------------------------------------------------------------------------- - */ -herr_t -H5AC_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) -{ -#if H5AC__TRACE_FILE_ENABLED - char trace[128] = ""; - FILE * trace_file_ptr = NULL; -#endif /* H5AC__TRACE_FILE_ENABLED */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5AC_mark_pinned_entry_dirty, FAIL) - - /* Sanity check */ - HDassert(thing); - -#if H5AC__TRACE_FILE_ENABLED - /* For the mark pinned entry dirty call, only the addr, size_changed, - * and new_size are really necessary in the trace file. Write the result - * to catch occult errors. - */ - if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) - sprintf(trace, "%s 0x%lx %d %d", FUNC, - (unsigned long)(((H5C_cache_entry_t *)thing)->addr), - (int)size_changed, - (int)new_size); -#endif /* H5AC__TRACE_FILE_ENABLED */ - -#ifdef H5_HAVE_PARALLEL -{ - H5AC_info_t *entry_ptr = (H5AC_info_t *)thing; - H5C_t *cache_ptr = entry_ptr->cache_ptr; - - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - - if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) { - /* Check for usage errors */ - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry isn't pinned??") - if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry is protected??") - - if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr, size_changed, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") - } /* end if */ -} -#endif /* H5_HAVE_PARALLEL */ - - if(H5C_mark_pinned_entry_dirty(thing, size_changed, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned entry dirty") - -done: -#if H5AC__TRACE_FILE_ENABLED - if(trace_file_ptr) - HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); -#endif /* H5AC__TRACE_FILE_ENABLED */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_mark_pinned_entry_dirty() */ - - -/*------------------------------------------------------------------------- - * Function: H5AC_mark_pinned_or_protected_entry_dirty + * Function: H5AC_mark_entry_dirty * * Purpose: Mark a pinned or protected entry as dirty. The target * entry MUST be either pinned, protected, or both. * - * Unlike H5AC_mark_pinned_entry_dirty(), this function does - * not support size changes. - * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -1337,7 +1090,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_mark_pinned_or_protected_entry_dirty(void *thing) +H5AC_mark_entry_dirty(void *thing) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1345,7 +1098,7 @@ H5AC_mark_pinned_or_protected_entry_dirty(void *thing) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_mark_pinned_or_protected_entry_dirty, FAIL) + FUNC_ENTER_NOAPI(H5AC_mark_entry_dirty, FAIL) /* Sanity check */ HDassert(thing); @@ -1371,13 +1124,13 @@ H5AC_mark_pinned_or_protected_entry_dirty(void *thing) 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, FALSE, 0) < 0) + if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") } /* end if */ } #endif /* H5_HAVE_PARALLEL */ - if(H5C_mark_pinned_or_protected_entry_dirty(thing) < 0) + if(H5C_mark_entry_dirty(thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned or protected entry dirty") done: @@ -1387,11 +1140,11 @@ done: #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_mark_pinned_or_protected_entry_dirty() */ +} /* H5AC_mark_entry_dirty() */ /*------------------------------------------------------------------------- - * Function: H5AC_rename + * Function: H5AC_move_entry * * Purpose: Use this function to notify the cache that an object's * file address changed. @@ -1402,37 +1155,10 @@ done: * matzke@llnl.gov * Jul 9 1997 * - * Modifications: - * Robb Matzke, 1999-07-27 - * The OLD_ADDR and NEW_ADDR arguments are passed by value. - * - * JRM 5/17/04 - * Complete rewrite for the new meta-data cache. - * - * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_rename_entry() - * in H5C.c, and then re-wrote the function as a wrapper for - * H5C_rename_entry(). - * - * JRM - 7/5/05 - * Added code to track dirty byte generation, and to trigger - * clean entry list propagation when it exceeds a user - * specified threshold. Note that this code only applies in - * the PHDF5 case. It should have no effect on either the - * serial or FPHSD5 cases. - * - * Note that this code presumes that the renamed entry will - * be present in all caches -- which it must be at present. - * To maintain this invarient, only rename entries immediately - * after you unprotect them. - * - * JRM - 6/6/06 - * Added trace file support. - * *------------------------------------------------------------------------- */ herr_t -H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr) +H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr) { herr_t result; herr_t ret_value=SUCCEED; /* Return value */ @@ -1444,7 +1170,7 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ - FUNC_ENTER_NOAPI(H5AC_rename, FAIL) + FUNC_ENTER_NOAPI(H5AC_move_entry, FAIL) HDassert(f); HDassert(f->shared->cache); @@ -1454,7 +1180,7 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad HDassert(H5F_addr_ne(old_addr, new_addr)); #if H5AC__TRACE_FILE_ENABLED - /* For the rename call, only the old addr and new addr are really + /* For the move call, only the old addr and new addr are really * 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. */ @@ -1464,7 +1190,7 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && ( trace_file_ptr != NULL ) ) { - sprintf(trace, "H5AC_rename 0x%lx 0x%lx %d", + sprintf(trace, "H5AC_move_entry 0x%lx 0x%lx %d", (unsigned long)old_addr, (unsigned long)new_addr, (int)(type->id)); @@ -1473,20 +1199,20 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad #ifdef H5_HAVE_PARALLEL if ( NULL != (aux_ptr = f->shared->cache->aux_ptr) ) { - if(H5AC_log_renamed_entry(f, old_addr, new_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log renamed entry") + if(H5AC_log_moved_entry(f, old_addr, new_addr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log moved entry") } #endif /* H5_HAVE_PARALLEL */ - result = H5C_rename_entry(f->shared->cache, + result = H5C_move_entry(f->shared->cache, type, old_addr, new_addr); if ( result < 0 ) { - HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \ - "H5C_rename_entry() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \ + "H5C_move_entry() failed.") } #ifdef H5_HAVE_PARALLEL @@ -1518,7 +1244,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_rename() */ +} /* H5AC_move_entry() */ /*------------------------------------------------------------------------- @@ -1637,56 +1363,13 @@ done: * or flushed -- nor may it be accessed by another call to * H5AC_protect. Any attempt to do so will result in a failure. * - * This comment is a re-write of the original Purpose: section. - * For historical interest, the original version is reproduced - * below: - * - * Original Purpose section: - * - * Similar to H5AC_find() except the object is removed from - * the cache and given to the caller, preventing other parts - * of the program from modifying the protected object or - * preempting it from the cache. - * - * The caller must call H5AC_unprotect() when finished with - * the pointer. - * * Return: Success: Ptr to the object. - * * Failure: NULL * * Programmer: Robb Matzke * matzke@llnl.gov * Sep 2 1997 * - * Modifications: - * Robb Matzke, 1999-07-27 - * The ADDR argument is passed by value. - * - * Bill Wendling, 2003-09-10 - * Added parameter to indicate whether this is a READ or - * WRITE type of protect. - * - * JRM -- 5/17/04 - * Complete re-write for the new client cache. See revised - * Purpose section above. - * - * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_protect() - * in H5C.c, and then re-wrote the function as a wrapper for - * H5C_protect(). - * - * JRM - 6/6/06 - * Added trace file support. - * - * JRM - 3/18/07 - * Modified code to support the new flags parameter for - * H5C_protect(). For now, that means passing in the - * H5C_READ_ONLY_FLAG if rw == H5AC_READ. - * - * Also updated the trace file output to save the - * rw parameter, since we are now doing something with it. - * *------------------------------------------------------------------------- */ void * @@ -1697,7 +1380,6 @@ H5AC_protect(H5F_t *f, void *udata, H5AC_protect_t rw) { - /* char * fcn_name = "H5AC_protect"; */ unsigned protect_flags = H5C__NO_FLAGS_SET; void * thing = (void *)NULL; void * ret_value; /* Return value */ @@ -1762,11 +1444,11 @@ H5AC_protect(H5F_t *f, } thing = H5C_protect(f, - dxpl_id, + dxpl_id, H5AC_noblock_dxpl_id, - type, - addr, - udata, + type, + addr, + udata, protect_flags); if ( thing == NULL ) { @@ -1802,10 +1484,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5AC_resize_pinned_entry + * Function: H5AC_resize_entry * - * Purpose: Resize a pinned entry. The target entry MUST be - * be pinned, and MUST not be unprotected. + * Purpose: Resize a pinned or protected entry. * * Return: Non-negative on success/Negative on failure * @@ -1815,7 +1496,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_resize_pinned_entry(void *thing, size_t new_size) +H5AC_resize_entry(void *thing, size_t new_size) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1823,7 +1504,7 @@ H5AC_resize_pinned_entry(void *thing, size_t new_size) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_resize_pinned_entry, FAIL) + FUNC_ENTER_NOAPI(H5AC_resize_entry, FAIL) /* Sanity check */ HDassert(thing); @@ -1840,6 +1521,9 @@ H5AC_resize_pinned_entry(void *thing, size_t new_size) (int)new_size); #endif /* H5AC__TRACE_FILE_ENABLED */ + if(H5C_resize_entry(thing, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "can't resize entry") + #ifdef H5_HAVE_PARALLEL { H5AC_info_t * entry_ptr = (H5AC_info_t *)thing; @@ -1849,21 +1533,12 @@ H5AC_resize_pinned_entry(void *thing, size_t new_size) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) { - /* Check for usage errors */ - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned??") - if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry is protected??") - - if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr, TRUE, new_size) < 0) + if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") } /* end if */ } #endif /* H5_HAVE_PARALLEL */ - if(H5C_resize_pinned_entry(thing, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "can't resize entry") - done: #if H5AC__TRACE_FILE_ENABLED if(trace_file_ptr) @@ -1871,7 +1546,7 @@ done: #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_resize_pinned_entry() */ +} /* H5AC_resize_entry() */ /*------------------------------------------------------------------------- @@ -2010,57 +1685,6 @@ done: * matzke@llnl.gov * Sep 2 1997 * - * Modifications: - * Robb Matzke, 1999-07-27 - * The ADDR argument is passed by value. - * - * Quincey Koziol, 2003-03-19 - * Added "deleted" argument - * - * Bill Wendling, 2003-09-18 - * If this is an FPHDF5 driver and the data is dirty, - * perform a "flush" that writes the data to the SAP. - * - * John Mainzer 5/19/04 - * Complete re-write for the new metadata cache. - * - * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_unprotect() - * in H5C.c, and then re-wrote the function as a wrapper for - * H5C_unprotect(). - * - * JRM - 1/6/05 - * Replaced the deleted parameter with the new flags parameter. - * Since the deleted parameter is not used by the FPHDF5 code, - * the only change in the body is to replace the deleted - * parameter with the flags parameter in the call to - * H5C_unprotect(). - * - * JRM - 6/6/05 - * Added the dirtied flag and supporting code. This is - * part of a collection of changes directed at moving - * management of cache entry dirty flags into the H5C code. - * - * JRM - 7/5/05 - * Added code to track dirty byte generation, and to trigger - * clean entry list propagation when it exceeds a user - * specified threshold. Note that this code only applies in - * the PHDF5 case. It should have no effect on either the - * serial or FPHSD5 cases. - * - * JRM - 9/8/05 - * Added code to track entry size changes. This is necessary - * as it can effect dirty byte creation counts, thereby - * throwing the caches out of sync in the PHDF5 case. - * - * JRM - 5/16/06 - * Added code to use the new dirtied field in - * H5C_cache_entry_t in the test to see if the entry has - * been dirtied. - * - * JRM - 6/7/06 - * Added support for the trace file. - * *------------------------------------------------------------------------- */ herr_t @@ -2069,15 +1693,13 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, { herr_t result; hbool_t dirtied; - size_t new_size = 0; + hbool_t deleted; #ifdef H5_HAVE_PARALLEL hbool_t size_changed = FALSE; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; - size_t trace_new_size = 0; - unsigned trace_flags = 0; FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value=SUCCEED; /* Return value */ @@ -2109,39 +1731,33 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, sprintf(trace, "H5AC_unprotect 0x%lx %d", (unsigned long)addr, (int)(type->id)); - - trace_flags = flags; } #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 ); - if ( dirtied ) { + /* Check if the size changed out from underneath us, if we're not deleting + * the entry. + */ + if ( dirtied && !deleted ) { + size_t curr_size = 0; - if ( (type->size)(f, thing, &new_size) < 0 ) { + if ( (type->size)(f, thing, &curr_size) < 0 ) { HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, \ "Can't get size of thing") } - if ( ((H5AC_info_t *)thing)->size != new_size ) { - -#ifdef H5_HAVE_PARALLEL - size_changed = TRUE; -#endif /* H5_HAVE_PARALLEL */ - flags = flags | H5AC__SIZE_CHANGED_FLAG; -#if H5AC__TRACE_FILE_ENABLED - trace_flags = flags; - trace_new_size = new_size; -#endif /* H5AC__TRACE_FILE_ENABLED */ - } + if(((H5AC_info_t *)thing)->size != curr_size) + HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, FAIL, "size of entry changed") } #ifdef H5_HAVE_PARALLEL if ( ( dirtied ) && ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) && ( NULL != (aux_ptr = f->shared->cache->aux_ptr) ) ) { - if(H5AC_log_dirtied_entry((H5AC_info_t *)thing, addr, size_changed, new_size) < 0) + if(H5AC_log_dirtied_entry((H5AC_info_t *)thing, addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log dirtied entry") } @@ -2163,13 +1779,12 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5_HAVE_PARALLEL */ result = H5C_unprotect(f, - dxpl_id, + dxpl_id, H5AC_noblock_dxpl_id, - type, - addr, - thing, - flags, - new_size); + type, + addr, + thing, + flags); if ( result < 0 ) { @@ -2200,10 +1815,9 @@ done: #if H5AC__TRACE_FILE_ENABLED if ( trace_file_ptr != NULL ) { - HDfprintf(trace_file_ptr, "%s %d %x %d\n", + HDfprintf(trace_file_ptr, "%s %x %d\n", trace, - (int)trace_new_size, - (unsigned)trace_flags, + (unsigned)flags, (int)ret_value); } #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -2225,11 +1839,8 @@ done: * Programmer: John Mainzer * 5/11/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr, @@ -2272,15 +1883,6 @@ done: * Programmer: Robb Matzke * Thursday, October 30, 1997 * - * Modifications: - * John Mainzer 5/19/04 - * Re-write to support the new metadata cache. - * - * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_stats() - * in H5C.c, and then re-wrote the function as a wrapper for - * H5C_stats(). - * *------------------------------------------------------------------------- */ herr_t @@ -2313,34 +1915,8 @@ done: * Programmer: John Mainzer * 3/10/05 * - * Modifications: - * - * JRM - 4/6/05 - * Reworked for the addition of struct H5AC_cache_config_t. - * - * JRM - 10/25/05 - * Added support for the new dirty_bytes_threshold field of - * both H5AC_cache_config_t and H5AC_aux_t. - * - * JRM - 6/8/06 - * Added support for the new trace file related fields. - * - * JRM - 7/28/07 - * Added support for the new evictions enabled related fields. - * - * Observe that H5AC_get_cache_auto_resize_config() and - * H5AC_set_cache_auto_resize_config() are becoming generic - * metadata cache configuration routines as they gain - * switches for functions that are only tenuously related - * to auto resize configuration. - * - * JRM - 1/2/08 - * Added support for the new flash cache increment related - * fields. - * *------------------------------------------------------------------------- */ - herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr) @@ -2460,10 +2036,6 @@ done: * Programmer: John Mainzer * 3/11/05 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -2507,10 +2079,6 @@ done: * Programmer: John Mainzer * 3/10/05 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -2538,13 +2106,8 @@ done: * * Programmer: John Mainzer, 3/10/05 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr) { @@ -2578,31 +2141,6 @@ done: * Programmer: John Mainzer * 3/10/05 * - * Modifications: - * - * John Mainzer -- 4/6/05 - * Updated for the addition of H5AC_cache_config_t. - * - * John Mainzer -- 10/25/05 - * Added support for the new dirty_bytes_threshold field of - * both H5AC_cache_config_t and H5AC_aux_t. - * - * John Mainzer -- 6/7/06 - * Added trace file support. - * - * John Mainzer -- 7/28/07 - * Added support for the new evictions enabled related fields. - * - * Observe that H5AC_get_cache_auto_resize_config() and - * H5AC_set_cache_auto_resize_config() are becoming generic - * metadata cache configuration routines as they gain - * switches for functions that are only tenuously related - * to auto resize configuration. - * - * John Mainzer -- 1/3/07 - * Updated trace file code to record the new flash cache - * size increase related fields. - * *------------------------------------------------------------------------- */ herr_t @@ -2800,21 +2338,6 @@ done: * Programmer: John Mainzer * 4/6/05 * - * Modifications: - * - * - Added code testing the trace file configuration fields. - * These tests are not comprehensive, as many errors cannot - * be caught until the directives contained in these fields - * are applied. - * JRM - 5/15/06 - * - * - Added code testing the evictions enabled field. At - * present this consists of verifying that if - * evictions_enabled is FALSE, then automatic cache - * resizing in disabled. - * - * JRM - 7/28/07 - * *------------------------------------------------------------------------- */ herr_t @@ -2942,13 +2465,8 @@ done: * Programmer: John Mainzer * 6/2/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - herr_t H5AC_close_trace_file(H5AC_t * cache_ptr) @@ -3005,10 +2523,6 @@ done: * Programmer: John Mainzer * 6/1/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -3128,11 +2642,8 @@ done: * * Programmer: John Mainzer, 7/1/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_broadcast_clean_list(H5AC_t * cache_ptr) @@ -3305,21 +2816,8 @@ done: * * Programmer: John Mainzer, 5/15/04 * - * Modifications: - * - * John Mainzer, 9/23/05 - * Rewrote function to return the value of the - * write_permitted field in aux structure if the structure - * exists and mpi_rank is 0. - * - * If the aux structure exists, but mpi_rank isn't 0, the - * function now returns FALSE. - * - * In all other cases, the function returns TRUE. - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_check_if_write_permitted(const H5F_t *f, @@ -3388,12 +2886,6 @@ done: * Programmer: John Mainzer * 1/26/06 * - * Modifications: - * - * Updated function for flash cache increment fields. - * - * JRM -- 1/2/08 - * *------------------------------------------------------------------------- */ herr_t @@ -3468,11 +2960,8 @@ done: * * Programmer: John Mainzer, 6/29/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_log_deleted_entry(H5AC_t * cache_ptr, @@ -3587,11 +3076,8 @@ done: #ifdef H5_HAVE_PARALLEL static herr_t H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, - haddr_t addr, - hbool_t size_changed, - size_t new_size) + haddr_t addr) { - size_t entry_size; H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -3612,15 +3098,6 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, HDassert( aux_ptr != NULL ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - if ( size_changed ) { - - entry_size = new_size; - - } else { - - entry_size = entry_ptr->size; - } - if ( aux_ptr->mpi_rank == 0 ) { H5AC_slist_entry_t * slist_entry_ptr; @@ -3649,9 +3126,9 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, } aux_ptr->d_slist_len += 1; - aux_ptr->dirty_bytes += entry_size; + 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 += entry_ptr->size; aux_ptr->unprotect_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ } @@ -3686,7 +3163,7 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, } } else { - aux_ptr->dirty_bytes += entry_size; + 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; @@ -3720,11 +3197,8 @@ done: * * Programmer: John Mainzer, 6/29/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL #if 0 /* This is useful debugging code. -- JRM */ static herr_t @@ -3882,21 +3356,15 @@ done: * * Programmer: John Mainzer, 6/30/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_log_inserted_entry(H5F_t * f, H5AC_t * cache_ptr, - H5AC_info_t * entry_ptr, - const H5AC_class_t * type, - haddr_t addr) + H5AC_info_t * entry_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - size_t size; H5AC_aux_t * aux_ptr = NULL; H5AC_slist_entry_t * slist_entry_ptr = NULL; @@ -3911,24 +3379,13 @@ H5AC_log_inserted_entry(H5F_t * f, HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); HDassert( entry_ptr != NULL ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->type == type ); - - /* the size field of the entry will not have been set yet, so we - * have to obtain it directly. - */ - if ( (type->size)(f, (void *)entry_ptr, &size) < 0 ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, \ - "Can't get size of entry to be inserted.") - } if ( aux_ptr->mpi_rank == 0 ) { HDassert( aux_ptr->d_slist_ptr != NULL ); HDassert( aux_ptr->c_slist_ptr != NULL ); - if ( H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr)) == NULL ) { + if ( H5SL_search(aux_ptr->d_slist_ptr, (void *)(&entry_ptr->addr)) == NULL ) { /* insert the address of the entry in the dirty entry list, and * add its size to the dirty_bytes count. @@ -3940,7 +3397,7 @@ H5AC_log_inserted_entry(H5F_t * f, } slist_entry_ptr->magic = H5AC__H5AC_SLIST_ENTRY_T_MAGIC; - slist_entry_ptr->addr = addr; + slist_entry_ptr->addr = entry_ptr->addr; if ( H5SL_insert(aux_ptr->d_slist_ptr, slist_entry_ptr, &(slist_entry_ptr->addr)) < 0 ) { @@ -3957,14 +3414,14 @@ H5AC_log_inserted_entry(H5F_t * f, "Inserted entry already in dirty slist.") } - if ( H5SL_search(aux_ptr->c_slist_ptr, (void *)(&addr)) != NULL ) { + if ( H5SL_search(aux_ptr->c_slist_ptr, (void *)(&entry_ptr->addr)) != NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Inserted entry in clean slist.") } } - aux_ptr->dirty_bytes += size; + aux_ptr->dirty_bytes += entry_ptr->size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION aux_ptr->insert_dirty_bytes += size; @@ -3981,15 +3438,15 @@ done: /*------------------------------------------------------------------------- * - * Function: H5AC_log_renamed_entry() + * Function: H5AC_log_moved_entry() * - * Purpose: Update the dirty_bytes count for a renamed entry. + * Purpose: Update the dirty_bytes count for a moved entry. * * WARNING * - * At present, the way that the rename call is used ensures - * that the renamed entry is present in all caches by - * renaming in a collective operation and immediately after + * At present, the way that the move call is used ensures + * that the moved entry is present in all caches by + * moving in a collective operation and immediately after * unprotecting the target entry. * * This function uses this invarient, and will cause arcane @@ -3997,17 +3454,17 @@ done: * 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 - * rename in the unprotect operation. + * move in the unprotect operation. * * Given that the target entry is in all caches, the function * proceeds as follows: * * For processes with mpi rank other 0, it simply checks to - * see if the entry was dirty prior to the rename, and adds + * see if the entry was dirty prior to the move, and adds * the entries size to the dirty bytes count. * * In the process with mpi rank 0, the function first checks - * to see if the entry was dirty prior to the rename. If it + * to see if the entry was dirty prior to the move. If it * was, and if the entry doesn't appear in the dirtied list * under its old address, it adds the entry's size to the * dirty bytes count. @@ -4023,13 +3480,11 @@ done: * * Programmer: John Mainzer, 6/30/05 * - * Modifications: - * *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL static herr_t -H5AC_log_renamed_entry(const H5F_t *f, +H5AC_log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) { @@ -4041,7 +3496,7 @@ H5AC_log_renamed_entry(const H5F_t *f, H5AC_slist_entry_t * slist_entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_log_renamed_entry, FAIL) + FUNC_ENTER_NOAPI(H5AC_log_moved_entry, FAIL) HDassert( f ); HDassert( f->shared ); @@ -4146,8 +3601,8 @@ H5AC_log_renamed_entry(const H5F_t *f, aux_ptr->dirty_bytes += entry_size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION - aux_ptr->rename_dirty_bytes += entry_size; - aux_ptr->rename_dirty_bytes_updates += 1; + aux_ptr->move_dirty_bytes += entry_size; + aux_ptr->move_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ } @@ -4173,8 +3628,8 @@ H5AC_log_renamed_entry(const H5F_t *f, aux_ptr->dirty_bytes += entry_size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION - aux_ptr->rename_dirty_bytes += entry_size; - aux_ptr->rename_dirty_bytes_updates += 1; + aux_ptr->move_dirty_bytes += entry_size; + aux_ptr->move_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ } @@ -4182,7 +3637,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5AC_log_renamed_entry() */ +} /* H5AC_log_moved_entry() */ #endif /* H5_HAVE_PARALLEL */ @@ -4251,14 +3706,8 @@ done: * Programmer: John Mainzer * July 5, 2005 * - * Modifications: - * - * JRM -- 5/11/06 - * Added code to call the write_done callback. - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL herr_t H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, @@ -4290,8 +3739,8 @@ H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, (int)(aux_ptr->unprotect_dirty_bytes_updates), (int)(aux_ptr->insert_dirty_bytes), (int)(aux_ptr->insert_dirty_bytes_updates), - (int)(aux_ptr->rename_dirty_bytes), - (int)(aux_ptr->rename_dirty_bytes_updates)); + (int)(aux_ptr->move_dirty_bytes), + (int)(aux_ptr->move_dirty_bytes_updates)); #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ if ( do_barrier ) { @@ -4352,8 +3801,8 @@ H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, aux_ptr->unprotect_dirty_bytes_updates = 0; aux_ptr->insert_dirty_bytes = 0; aux_ptr->insert_dirty_bytes_updates = 0; - aux_ptr->rename_dirty_bytes = 0; - aux_ptr->rename_dirty_bytes_updates = 0; + aux_ptr->move_dirty_bytes = 0; + aux_ptr->move_dirty_bytes_updates = 0; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ done: @@ -4380,11 +3829,8 @@ done: * * Programmer: John Mainzer, 7/4/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, @@ -4547,8 +3993,8 @@ H5AC_flush_entries(H5F_t *f) (int)(aux_ptr->unprotect_dirty_bytes_updates), (int)(aux_ptr->insert_dirty_bytes), (int)(aux_ptr->insert_dirty_bytes_updates), - (int)(aux_ptr->rename_dirty_bytes), - (int)(aux_ptr->rename_dirty_bytes_updates)); + (int)(aux_ptr->move_dirty_bytes), + (int)(aux_ptr->move_dirty_bytes_updates)); #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ /* to prevent "messages from the future" we must synchronize all diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 911aceb..d5346f5 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -107,7 +107,7 @@ * * Maintaining this count is easy for all processes not on process 0 -- * all that is necessary is to add the size of the entry to the total - * whenever there is an insertion, a rename of a previously clean entry, + * whenever there is an insertion, a move of a previously clean entry, * or whever a previously clean entry is marked dirty in an unprotect. * * On process 0, we have to be careful not to count dirty bytes twice. @@ -197,18 +197,18 @@ * been created via insert operations since the last time * the cleaned list was propagated. * - * rename_dirty_bytes: This field only exists when the + * move_dirty_bytes: This field only exists when the * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. * * It is used to track the number of dirty bytes created - * via rename operations since the last time the cleaned + * via move operations since the last time the cleaned * list was propagated. * - * rename_dirty_bytes_updates: This field only exists when the + * move_dirty_bytes_updates: This field only exists when the * H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE. * * It is used to track the number of times dirty bytes have - * been created via rename operations since the last time + * been created via move operations since the last time * the cleaned list was propagated. * * d_slist_ptr: Pointer to an instance of H5SL_t used to maintain a list @@ -224,7 +224,7 @@ * * 1) an entry is inserted in the metadata cache, or * - * 2) a previously clean entry is renamed, and it does not + * 2) a previously clean entry is moved, and it does not * already appear in the dirty entry list, or * * 3) a previously clean entry is unprotected with the @@ -234,7 +234,7 @@ * Entries are added to the dirty entry list whever they cause * the dirty bytes count to be increased. They are removed * when they appear in a clean entries broadcast. Note that - * renames must be reflected in the dirty entry list. + * moves must be reflected in the dirty entry list. * * To reitterate, this field is only used on process 0 -- it * should be NULL on all other processes. @@ -303,8 +303,8 @@ typedef struct H5AC_aux_t int32_t insert_dirty_bytes; int32_t insert_dirty_bytes_updates; - int32_t rename_dirty_bytes; - int32_t rename_dirty_bytes_updates; + int32_t move_dirty_bytes; + int32_t move_dirty_bytes_updates; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 8a2f706..221dd41 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -138,7 +138,7 @@ typedef enum { #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__RENAMED_FLAG H5C_CALLBACK__RENAMED_FLAG +#define H5AC_CALLBACK__MOVED_FLAG H5C_CALLBACK__MOVED_FLAG /* Aliases for 'notify action' type & values */ typedef H5C_notify_action_t H5AC_notify_action_t; @@ -218,7 +218,7 @@ extern hid_t H5AC_dxpl_id; /* Dataset transfer property list for independent metadata I/O calls */ /* (just "library internal" set - i.e. independent transfer mode) */ /* (Global variable declaration, definition is in H5AC.c) */ -extern hid_t H5AC_ind_dxpl_id; +H5_DLLVAR hid_t H5AC_ind_dxpl_id; /* Default cache configuration. */ @@ -307,7 +307,6 @@ extern hid_t H5AC_ind_dxpl_id; #define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG #define H5AC__DELETED_FLAG H5C__DELETED_FLAG #define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG -#define H5AC__SIZE_CHANGED_FLAG H5C__SIZE_CHANGED_FLAG #define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG #define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG #define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG @@ -343,17 +342,15 @@ 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); -H5_DLL herr_t H5AC_resize_pinned_entry(void *thing, size_t new_size); +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); H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, - size_t new_size); -H5_DLL herr_t H5AC_mark_pinned_or_protected_entry_dirty(void *thing); -H5_DLL herr_t H5AC_rename(H5F_t *f, const H5AC_class_t *type, +H5_DLL herr_t H5AC_mark_entry_dirty(void *thing); +H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id); diff --git a/src/H5B.c b/src/H5B.c index 50eea4c..37d40bf 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -668,7 +668,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, bt = NULL; /* Make certain future references will be caught */ /* Move the location of the old root on the disk */ - if(H5AC_rename(f, H5AC_BT, addr, old_root) < 0) + if(H5AC_move_entry(f, H5AC_BT, addr, old_root) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node") /* clear the old root info at the old address (we already copied it) */ @@ -680,12 +680,11 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, new_bt->nchildren = 2; new_bt->child[0] = old_root; - HDmemcpy(H5B_NKEY(new_bt,shared,0), lt_key, shared->type->sizeof_nkey); + HDmemcpy(H5B_NKEY(new_bt, shared, 0), lt_key, shared->type->sizeof_nkey); new_bt->child[1] = child; - HDmemcpy(H5B_NKEY(new_bt,shared,1), md_key, shared->type->sizeof_nkey); - - HDmemcpy(H5B_NKEY(new_bt,shared,2), rt_key, shared->type->sizeof_nkey); + HDmemcpy(H5B_NKEY(new_bt, shared, 1), md_key, shared->type->sizeof_nkey); + HDmemcpy(H5B_NKEY(new_bt, shared, 2), rt_key, shared->type->sizeof_nkey); /* Insert the modified copy of the old root into the file again */ if(H5AC_set(f, dxpl_id, H5AC_BT, addr, new_bt, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5B2cache.c b/src/H5B2cache.c index a28811a..6a3b5da 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -157,7 +157,6 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5B2_create_t cparam; /* B-tree creation parameters */ H5B2_subid_t id; /* ID of B-tree class, as found in file */ uint16_t depth; /* Depth of B-tree */ - size_t size; /* Header size */ 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 */ @@ -174,22 +173,19 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(udata); /* Allocate new B-tree header and reset cache info */ - if(NULL == (hdr = H5B2_hdr_alloc(f))) + 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") - /* Compute the size of the serialized B-tree header on disk */ - size = H5B2_HEADER_SIZE(hdr); - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) + 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, size, dxpl_id, buf) < 0) + 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 */ @@ -231,10 +227,10 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) UINT32DECODE(p, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == size); + HDassert((size_t)(p - (const uint8_t *)buf) == hdr->hdr_size); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, (size - H5B2_SIZEOF_CHKSUM), 0); + computed_chksum = H5_checksum_metadata(buf, (hdr->hdr_size - H5B2_SIZEOF_CHKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -242,7 +238,7 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Initialize B-tree header info */ cparam.cls = H5B2_client_class_g[id]; - if(H5B2_hdr_init(udata->f, hdr, &cparam, udata->ctx_udata, depth) < 0) + if(H5B2_hdr_init(hdr, &cparam, udata->ctx_udata, depth) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't initialize B-tree header info") /* Set the B-tree header's address */ @@ -294,7 +290,6 @@ H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, if(hdr->cache_info.is_dirty) { uint8_t *buf; /* Pointer to header 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 B-tree header's file context for this operation */ @@ -304,11 +299,8 @@ H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't wrap buffer") - /* Compute the size of the serialized B-tree header on disk */ - size = H5B2_HEADER_SIZE(hdr); - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) + 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 */ @@ -345,14 +337,14 @@ H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5F_ENCODE_LENGTH(f, p, hdr->root.all_nrec); /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size - H5B2_SIZEOF_CHKSUM), 0); + 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) == size); - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf) < 0) + 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; @@ -402,7 +394,7 @@ H5B2_cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr) 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)H5B2_HEADER_SIZE(hdr)) < 0) + 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 */ @@ -477,7 +469,7 @@ H5B2_cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_p HDassert(size_ptr); /* Set size value */ - *size_ptr = H5B2_HEADER_SIZE(hdr); + *size_ptr = hdr->hdr_size; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5B2_cache_hdr_size() */ diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index a219859..94e2c54 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -107,8 +107,8 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_init(H5F_t *f, H5B2_hdr_t *hdr, const H5B2_create_t *cparam, - void *ctx_udata, uint16_t depth) +H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, + uint16_t depth) { size_t sz_max_nrec; /* Temporary variable for range checking */ unsigned u_max_nrec_size; /* Temporary variable for range checking */ @@ -120,7 +120,6 @@ H5B2_hdr_init(H5F_t *f, H5B2_hdr_t *hdr, const H5B2_create_t *cparam, /* * Check arguments. */ - HDassert(f); HDassert(hdr); HDassert(cparam); HDassert(cparam->cls); @@ -133,7 +132,6 @@ H5B2_hdr_init(H5F_t *f, H5B2_hdr_t *hdr, const H5B2_create_t *cparam, HDassert(cparam->merge_percent < (cparam->split_percent / 2)); /* Initialize basic information */ - hdr->f = f; hdr->rc = 0; hdr->pending_delete = FALSE; @@ -258,6 +256,7 @@ H5B2_hdr_alloc(H5F_t *f) hdr->f = f; hdr->sizeof_addr = H5F_SIZEOF_ADDR(f); hdr->sizeof_size = H5F_SIZEOF_SIZE(f); + hdr->hdr_size = H5B2_HEADER_SIZE(hdr); hdr->root.addr = HADDR_UNDEF; /* Set return value */ @@ -302,11 +301,11 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed for B-tree header") /* Initialize shared B-tree info */ - if(H5B2_hdr_init(f, hdr, cparam, ctx_udata, (uint16_t)0) < 0) + if(H5B2_hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)H5B2_HEADER_SIZE(hdr)))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->hdr_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "file allocation failed for B-tree header") /* Cache the new B-tree node */ @@ -479,7 +478,7 @@ H5B2_hdr_dirty(H5B2_hdr_t *hdr) HDassert(hdr); /* Mark B-tree header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) + if(H5AC_mark_entry_dirty(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark v2 B-tree header as dirty") done: diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 35c2eb1..543fa3f 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -161,6 +161,7 @@ typedef struct H5B2_hdr_t { /* Shared internal data structures (not stored) */ H5F_t *f; /* Pointer to the file that the B-tree is in */ haddr_t addr; /* Address of B-tree header in the file */ + size_t hdr_size; /* Size of the B-tree header on disk */ size_t rc; /* Reference count of nodes using this header */ size_t file_rc; /* Reference count of files using this header */ hbool_t pending_delete; /* B-tree is pending deletion */ @@ -273,8 +274,8 @@ extern const H5B2_class_t *const H5B2_client_class_g[H5B2_NUM_BTREE_ID]; H5_DLL H5B2_hdr_t *H5B2_hdr_alloc(H5F_t *f); H5_DLL haddr_t H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata); -H5_DLL herr_t H5B2_hdr_init(H5F_t *f, H5B2_hdr_t *hdr, - const H5B2_create_t *cparam, void *ctx_udata, uint16_t depth); +H5_DLL herr_t H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, + void *ctx_udata, uint16_t depth); H5_DLL herr_t H5B2_hdr_incr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2_hdr_decr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr); diff --git a/src/H5B2stat.c b/src/H5B2stat.c index a15ff11..afd1e33 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -131,7 +131,7 @@ H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) hdr = bt2->hdr; /* Add size of header to B-tree metadata total */ - *btree_size += H5B2_HEADER_SIZE(hdr); + *btree_size += hdr->hdr_size; /* Iterate through records */ if(hdr->root.node_nrec > 0) { diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 3212416..55d9617 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -189,7 +189,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void struct child_t *next; } *head = NULL, *tail = NULL, *prev = NULL, *cur = NULL, *tmp = NULL; - FUNC_ENTER_NOAPI_NOFUNC(H5B_assert) + FUNC_ENTER_NOAPI_NOINIT(H5B_assert) if(0 == ncalls++) { if(H5DEBUG(B)) @@ -281,6 +281,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void head = tmp; } /* end while */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5B_assert() */ #endif /* H5B_DEBUG */ diff --git a/src/H5C.c b/src/H5C.c index a3a857a..bfb7e05 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -32,24 +32,6 @@ * For a detailed overview of the cache, please see the * header comment for H5C_t in H5Cpkg.h. * - * Modifications: - * - * QAK - 11/27/2004 - * Switched over to using skip list routines instead of TBBT - * routines. - * - * JRM - 12/15/04 - * Added code supporting manual and automatic cache resizing. - * See the header for H5C_auto_size_ctl_t in H5Cprivate.h for - * an overview. - * - * Some elements of the automatic cache resize code depend on - * the LRU list. Thus if we ever choose to support a new - * replacement policy, we will either have to disable those - * elements of the auto resize code when running the new - * policy, or modify them to make use of similar information - * maintained by the new policy code. - * *------------------------------------------------------------------------- */ @@ -63,13 +45,6 @@ * * - Change protect/unprotect to lock/unlock. * - * - Change the way the dirty flag is set. Probably pass it in - * as a parameter in unprotect & insert. - * - * - Size should also be passed in as a parameter in insert and - * unprotect -- or some other way should be found to advise the - * cache of changes in entry size. - * * - Flush entries in increasing address order in * H5C_make_space_in_cache(). * @@ -358,7 +333,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - /*------------------------------------------------------------------------- * Function: H5C_create @@ -382,70 +356,12 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/20/04 - * Updated for the addition of the hash table. - * - * JRM -- 10/5/04 - * Added call to H5C_reset_cache_hit_rate_stats(). Also - * added initialization for cache_is_full flag and for - * resize_ctl. - * - * JRM -- 11/12/04 - * Added initialization for the new size_decreased field. - * - * JRM -- 11/17/04 - * Added/updated initialization for the automatic cache - * size control data structures. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of - * the H5C_t structure. - * - * JRM -- 7/5/05 - * Added the new log_flush parameter and supporting code. - * - * JRM -- 9/21/05 - * Added the new aux_ptr parameter and supporting code. - * - * JRM -- 1/20/06 - * Added initialization of the new prefix field in H5C_t. - * - * JRM -- 3/16/06 - * Added initialization for the pinned entry related fields. - * - * JRM -- 5/31/06 - * Added initialization for the trace_file_ptr field. - * - * JRM -- 8/19/06 - * Added initialization for the flush_in_progress field. - * - * JRM -- 8/25/06 - * Added initialization for the slist_len_increase and - * slist_size_increase fields. These fields are used - * for sanity checking in the flush process, and are not - * compiled in unless H5C_DO_SANITY_CHECKS is TRUE. - * - * JRM -- 3/28/07 - * Added initialization for the new is_read_only and - * ro_ref_count fields. - * - * JRM -- 7/27/07 - * Added initialization for the new evictions_enabled - * field of H5C_t. - * - * JRM -- 12/31/07 - * Added initialization for the new flash cache size increase - * related fields of H5C_t. - * * JRM -- 11/5/08 * Added initialization for the new clean_index_size and * dirty_index_size fields of H5C_t. * *------------------------------------------------------------------------- */ - H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, @@ -669,19 +585,6 @@ done: * Programmer: John Mainzer * 10/27/04 * - * Modifications: - * - * JRM -- 11/22/04 - * Reworked function to adapt it to the addition of the - * ageout method of cache size reduction. - * - * JRM -- 1/19/06 - * Updated function for display the new prefix field of - * H5C_t in output. - * - * JRM 12/31/07 - * Updated function to handle flash size increases. - * *------------------------------------------------------------------------- */ void @@ -926,10 +829,6 @@ done: * Programmer: John Mainzer * 6/29/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1052,77 +951,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/20/04 - * Modified the function for the addition of the hash table. - * - * JRM -- 11/22/04 - * Added code to remove all epoch markers (if any) from the - * LRU list before a destroy. Strictly speaking, this isn't - * necessary, as the marker entries reside only in the LRU - * list, never in the index or in the tree. However, it - * never hurts to tidy up. - * - * JRM -- 1/6/05 - * Reworked code to support the new - * H5C__FLUSH_MARKED_ENTRIES_FLAG, and for the replacement of - * H5F_FLUSH_INVALIDATE flag with H5C__FLUSH_INVALIDATE_FLAG. - * - * Note that the H5C__FLUSH_INVALIDATE_FLAG takes precidence - * over the H5C__FLUSH_MARKED_ENTRIES_FLAG. Thus if both are - * set, the functions behaves as if just the - * H5C__FLUSH_INVALIDATE_FLAG was set. - * - * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with - * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the - * H5C__FLUSH_INVALIDATE_FLAG. In all cases, it is simply - * passed along to H5C_flush_single_entry(). In the case of - * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to - * the marked entries. - * - * JRM -- 10/15/05 - * Added code supporting the new - * H5C__FLUSH_IGNORE_PROTECTED_FLAG. We need this flag, as - * we now use this function to flush large number of entries - * in increasing address order. We do this by marking the - * entries to be flushed, calling this function to flush them, - * and then restoring LRU order. - * - * However, it is possible that the cache will contain other, - * unmarked protected entries, when we make this call. This - * new flag allows us to ignore them. - * - * Note that even with this flag set, it is still an error - * to try to flush a protected entry. - * - * JRM -- 3/25/06 - * Updated function to handle pinned entries. - * - * JRM -- 8/19/06 - * Added code managing the new flush_in_progress field of - * H5C_t. - * - * Also reworked function to allow for the possibility that - * entries will be dirtied, resized, or renamed during flush - * callbacks. As a result, we may have to make multiple - * passes through the skip list before the cache is flushed. - * - * JRM -- 10/13/07 - * Added code to detect and manage the case in which a - * flush callback changes the s-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * *------------------------------------------------------------------------- */ herr_t @@ -1235,7 +1063,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign * * 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 renamed. + * to be dirtied, resized, and/or moved. * * To deal with this, we first make note of the initial * skip list length and size: @@ -1505,34 +1333,6 @@ done: * Programmer: John Mainzer * 9/16/05 * - * Modifications: - * - * Re-wrote function to flush dirty entries in increasing - * address order, while maintaining LRU order in the LRU list - * upon return. - * - * Do this by scanning up the dirty LRU list for entries to - * flush to reach min clean size, setting their flush_marker - * flags, and recording their addresses in the order - * encountered. - * - * Then call H5C_flush_cache() to flush the marked entries. - * - * Finally, use the list of marked entries to force the - * correct LRU list order after the flush. - * - * JRM - 10/13/05 - * - * This change had the oposite of the desired effect. Lets - * leave it in (albeit commented out for now). If we can't - * find a case where it helps, lets get rid of it. - * - * - * Added some sanity checks to the change which verify the - * expected values of the new is_read_only and ro_ref_count - * fields. - * JRM - 3/29/07 - * *------------------------------------------------------------------------- */ herr_t @@ -1720,10 +1520,6 @@ done: * Programmer: John Mainzer * 10/8/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1770,10 +1566,6 @@ done: * Programmer: John Mainzer * 10/8/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1833,10 +1625,6 @@ done: * Programmer: John Mainzer * 10/7/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1898,11 +1686,6 @@ done: * Programmer: John Mainzer * 7/1/05 * - * Modifications: - * - * JRM -- 4/26/06 - * Added the is_pinned_ptr parameter and supporting code. - * *------------------------------------------------------------------------- */ herr_t @@ -2002,10 +1785,6 @@ done: * Programmer: John Mainzer * 7/27/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -2124,59 +1903,6 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM -- 10/28/04 - * Added code to set the cache_full flag to TRUE when ever - * we need to make space in the cache. - * - * JRM -- 11/22/04 - * Updated function for the addition of the first_flush_ptr - * parameter to H5C_make_space_in_cache(). - * - * JRM -- 1/6/05 - * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is - * ignored unless the new entry is dirty. - * - * JRM -- 6/6/05 - * Added code to force all inserted entries to be dirty. - * This is part of a set of changes moving management of the - * is_dirty field of H5C_cache_entry_t into the H5C code. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of - * the H5C_t structure. - * - * JRM -- 3/16/06 - * Added initialization for the new is_pinned field of the - * H5C_cache_entry_t structure. - * - * JRM -- 5/3/06 - * Added initialization for the new dirtied field of the - * H5C_cache_entry_t structure. - * - * JRM -- 8/9/06 - * Added code supporting insertion of pinned entries. - * - * JRM -- 8/21/06 - * Added initialization for the new flush_in_progress and - * destroy_in_progress fields. - * - * JRM -- 3/29/07 - * Added initialization for the new is_read_only and - * ro_ref_count fields. - * - * JRM -- 8/1/07 - * Added code to disable evictions when the new - * evictions_enabled field is FALSE. - * - * JRM -- 12/31/07 - * Added code supporting flash cache size increases. - * * QAK -- 1/31/08 * Added initialization for the new free_file_space_on_destroy * field. @@ -2307,13 +2033,10 @@ H5C_insert_entry(H5F_t * f, /* not protected, so can't be dirtied */ entry_ptr->dirtied = FALSE; - if ( (type->size)(f, thing, &(entry_ptr->size)) < 0 ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, \ - "Can't get size of thing") - } - - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + /* Retrieve the size of the thing */ + if((type->size)(f, thing, &(entry_ptr->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); entry_ptr->in_slist = FALSE; @@ -2527,20 +2250,6 @@ done: * Programmer: John Mainzer * 7/5/05 * - * Modifications: - * - * Reworked function to flush entries in LRU order instead - * of increasing address order. The hope is that this will - * improve the hit rate on the slave caches. - * - * JRM - 10/13/05 - * - * Leave the old code in place for now (commented out) for - * benchmarking. - * - * JRM -- 4/13/06 - * Updated function to deal with pinned entries. - * *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL @@ -2806,120 +2515,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_mark_pinned_entry_dirty - * - * Purpose: Mark a pinned entry as dirty. The target entry MUST be - * be pinned, and MUST be unprotected. - * - * If the entry has changed size, the function updates - * data structures for the size change. - * - * If the entry is not already dirty, the function places - * the entry on the skip list. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 3/22/06 - * - *------------------------------------------------------------------------- - */ -herr_t -H5C_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) -{ - H5C_t * cache_ptr; - H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; - hbool_t was_clean; - size_t size_increase; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5C_mark_pinned_entry_dirty, FAIL) - - /* Sanity checks */ - HDassert(entry_ptr); - HDassert(H5F_addr_defined(entry_ptr->addr)); - cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - - /* Check for usage errors */ - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry isn't pinned??") - if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry is protected??") - - /* make note of whether the entry was dirty to begin with */ - was_clean = ! ( entry_ptr->is_dirty ); - - /* mark the entry as dirty if it isn't already */ - entry_ptr->is_dirty = TRUE; - - /* update for change in entry size if necessary */ - if ( ( size_changed ) && ( entry_ptr->size != new_size ) ) { - - /* do a flash cache size increase if appropriate */ - if ( cache_ptr->flash_size_increase_possible ) { - - if ( new_size > entry_ptr->size ) { - - size_increase = new_size - entry_ptr->size; - - if ( size_increase >= - cache_ptr->flash_size_increase_threshold ) { - if(H5C__flash_increase_cache_size(cache_ptr, entry_ptr->size, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "flash cache increase failed") - } - } - } - - /* update the pinned entry list */ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \ - (cache_ptr->pel_size), \ - (entry_ptr->size), (new_size)); - - /* update the hash table */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size), \ - (new_size), (entry_ptr), (was_clean)); - - /* if the entry is in the skip list, update that too */ - if ( entry_ptr->in_slist ) { - - H5C__UPDATE_SLIST_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\ - (new_size)); - } - - /* update statistics just before changing the entry size */ - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \ - (new_size)); - - /* finally, update the entry size proper */ - entry_ptr->size = new_size; - - } else if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) { - - H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) - } - - if ( ! (entry_ptr->in_slist) ) { - - H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) - } - - H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_mark_pinned_entry_dirty() */ - - -/*------------------------------------------------------------------------- - * Function: H5C_mark_pinned_or_protected_entry_dirty + * Function: H5C_mark_entry_dirty * * Purpose: Mark a pinned or protected entry as dirty. The target entry * MUST be either pinned or protected, and MAY be both. * - * At present, this funtion does not support size change. - * * In the protected case, this call is the functional * equivalent of setting the H5C__DIRTIED_FLAG on an unprotect * call. @@ -2942,13 +2542,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_mark_pinned_or_protected_entry_dirty(void *thing) +H5C_mark_entry_dirty(void *thing) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_mark_pinned_or_protected_entry_dirty, FAIL) + FUNC_ENTER_NOAPI(H5C_mark_entry_dirty, FAIL) /* Sanity checks */ HDassert(entry_ptr); @@ -2958,9 +2558,8 @@ H5C_mark_pinned_or_protected_entry_dirty(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); if ( entry_ptr->is_protected ) { -#if 0 /* JRM - uncomment this when possible */ HDassert( ! ((entry_ptr)->is_read_only) ); -#endif + /* set the dirtied flag */ entry_ptr->dirtied = TRUE; @@ -2992,12 +2591,12 @@ H5C_mark_pinned_or_protected_entry_dirty(void *thing) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_mark_pinned_or_protected_entry_dirty() */ +} /* H5C_mark_entry_dirty() */ /*------------------------------------------------------------------------- * - * Function: H5C_rename_entry + * Function: H5C_move_entry * * Purpose: Use this function to notify the cache that an entry's * file address changed. @@ -3007,32 +2606,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM -- 6/6/05 - * Updated function to force all renamed entries to be - * dirty. This is part of a series of code modifications - * moving management of the is_dirty field of - * H5C_cache_entry_t into the H5C code. - * - * JRM -- 4/3/06 - * Updated function to disallow renaming of pinned entries. - * - * JRM -- 4/27/06 - * Updated function to support renaming of pinned entries. - * - * JRM -- 8/24/06 - * Updated function to refrain from altering the index, the - * replacement policy data structures, and skip list when - * the function is called within the flush callback for the - * target entry and the target entry is being destroyed. - * - * Note that in this case H5C_flush_single_entry() will handle - * all these details for us. - * * JRM -- 11/5/08 * On review this function looks like no change is needed to * support the new clean_index_size and dirty_index_size @@ -3041,7 +2614,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_rename_entry(H5C_t * cache_ptr, +H5C_move_entry(H5C_t * cache_ptr, const H5C_class_t * type, haddr_t old_addr, haddr_t new_addr) @@ -3054,7 +2627,7 @@ H5C_rename_entry(H5C_t * cache_ptr, #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_rename_entry, FAIL) + FUNC_ENTER_NOAPI(H5C_move_entry, FAIL) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -3084,7 +2657,7 @@ H5C_rename_entry(H5C_t * cache_ptr, if ( entry_ptr->is_protected ) { - HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \ + HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \ "Target entry is protected.") } @@ -3094,12 +2667,12 @@ H5C_rename_entry(H5C_t * cache_ptr, if ( test_entry_ptr->type == type ) { - HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \ - "Target already renamed & reinserted???.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \ + "Target already moved & reinserted???.") } else { - HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \ + HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, \ "New address already in use?.") } @@ -3110,7 +2683,7 @@ H5C_rename_entry(H5C_t * cache_ptr, * new address, mark it as dirty (if it isn't already) and then re-insert. * * Update the replacement policy for a hit to avoid an eviction before - * the renamed entry is touched. Update stats for a rename. + * the moved entry is touched. Update stats for a move. * * Note that we do not check the size of the cache, or evict anything. * Since this is a simple re-name, cache size should be unaffected. @@ -3174,11 +2747,11 @@ H5C_rename_entry(H5C_t * cache_ptr, #endif /* H5C_DO_SANITY_CHECKS */ - H5C__UPDATE_RP_FOR_RENAME(cache_ptr, entry_ptr, was_dirty, FAIL) + H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, FAIL) } } - H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) + H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) done: @@ -3192,14 +2765,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_rename_entry() */ +} /* H5C_move_entry() */ /*------------------------------------------------------------------------- - * Function: H5C_resize_pinned_entry + * Function: H5C_resize_entry * - * Purpose: Resize a pinned entry. The target entry MUST be - * be pinned, and MUST be unprotected. + * Purpose: Resize a pinned or protected entry. * * Resizing an entry dirties it, so if the entry is not * already dirty, the function places the entry on the @@ -3213,15 +2785,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_resize_pinned_entry(void *thing, size_t new_size) +H5C_resize_entry(void *thing, size_t new_size) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; - size_t size_increase; - hbool_t was_clean; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_resize_pinned_entry, FAIL) + FUNC_ENTER_NOAPI(H5C_resize_entry, FAIL) /* Sanity checks */ HDassert(entry_ptr); @@ -3232,41 +2802,46 @@ H5C_resize_pinned_entry(void *thing, size_t new_size) /* Check for usage errors */ if(new_size <= 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "New size is non-positive.") - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned??") - if(entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry is protected??") - - /* make note of whether the entry was clean to begin with */ - was_clean = ! ( entry_ptr->is_dirty ); - - /* resizing dirties entries -- mark the entry as dirty if it - * isn't already - */ - entry_ptr->is_dirty = TRUE; + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "New size is non-positive.") + if(!(entry_ptr->is_pinned || entry_ptr->is_protected)) + HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??") /* update for change in entry size if necessary */ if ( entry_ptr->size != new_size ) { + hbool_t was_clean; + + /* make note of whether the entry was clean to begin with */ + was_clean = ! ( entry_ptr->is_dirty ); + + /* mark the entry as dirty if it isn't already */ + entry_ptr->is_dirty = TRUE; /* do a flash cache size increase if appropriate */ if ( cache_ptr->flash_size_increase_possible ) { if ( new_size > entry_ptr->size ) { + size_t size_increase; size_increase = new_size - entry_ptr->size; if(size_increase >= cache_ptr->flash_size_increase_threshold) { if(H5C__flash_increase_cache_size(cache_ptr, entry_ptr->size, new_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "flash cache increase failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "flash cache increase failed") } } } - /* update the protected entry list */ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \ - (cache_ptr->pel_size), \ - (entry_ptr->size), (new_size)); + /* update the pinned and/or protected entry list */ + if(entry_ptr->is_pinned) { + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \ + (cache_ptr->pel_size), \ + (entry_ptr->size), (new_size)) + } /* end if */ + if(entry_ptr->is_protected) { + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pl_len), \ + (cache_ptr->pl_size), \ + (entry_ptr->size), (new_size)) + } /* end if */ /* update the hash table */ H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\ @@ -3274,10 +2849,9 @@ H5C_resize_pinned_entry(void *thing, size_t new_size) /* if the entry is in the skip list, update that too */ if ( entry_ptr->in_slist ) { - H5C__UPDATE_SLIST_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size),\ (new_size)); - } + } /* end if */ /* update statistics just before changing the entry size */ H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \ @@ -3286,22 +2860,18 @@ H5C_resize_pinned_entry(void *thing, size_t new_size) /* finally, update the entry size proper */ entry_ptr->size = new_size; - } else if ( was_clean ) { - - H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) - } - - - if ( ! (entry_ptr->in_slist) ) { - - H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) - } + if(!entry_ptr->in_slist) { + H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) + } /* end if */ - H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) + if(entry_ptr->is_pinned) { + H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) + } /* end if */ + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_resize_pinned_entry() */ +} /* H5C_resize_entry() */ /*------------------------------------------------------------------------- @@ -3424,62 +2994,10 @@ done: * check_write_permitted function if it is called. * * Return: Success: Ptr to the desired entry - * * Failure: NULL * * Programmer: John Mainzer - 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated for the addition of the hash table. - * - * JRM -- 10/28/04 - * Added code to set cache_full to TRUE whenever we try to - * make space in the cache. - * - * JRM -- 11/12/04 - * Added code to call to H5C_make_space_in_cache() - * after the call to H5C__auto_adjust_cache_size() if that - * function sets the size_decreased flag is TRUE. - * - * JRM -- 4/25/05 - * The size_decreased flag can also be set to TRUE in - * H5C_set_cache_auto_resize_config() if a new configuration - * forces an immediate reduction in cache size. Modified - * the code to deal with this eventuallity. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of H5C_t. - * - * JRM -- 10/22/05 - * Hand optimizations. - * - * JRM -- 5/3/06 - * Added code to set the new dirtied field in - * H5C_cache_entry_t to FALSE prior to return. - * - * JRM -- 6/23/06 - * Modified code to allow dirty entries to be loaded from - * disk. This is necessary as a bug fix in the object - * header code requires us to modify a header as it is read. - * - * JRM -- 3/28/07 - * Added the flags parameter and supporting code. At least - * for now, this parameter is used to allow the entry to - * be protected read only, thus allowing multiple protects. - * - * Also added code to allow multiple read only protects - * of cache entries. - * - * JRM -- 7/27/07 - * Added code supporting the new evictions_enabled field - * in H5C_t. - * - * JRM -- 1/3/08 - * Added to do a flash cache size increase if appropriate - * when a large entry is loaded. - * * JRM -- 11/13/08 * Modified function to call H5C_make_space_in_cache() when * the min_clean_size is violated, not just when there isn't @@ -3919,13 +3437,8 @@ done: * * Programmer: John Mainzer, 10/5/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr) { @@ -3965,21 +3478,6 @@ done: * Programmer: John Mainzer * 10/8/04 * - * Modifications: - * - * JRM -- 11/18/04 - * Reworked function to match major changes in - * H5C_auto_size_ctl_t. - * - * JRM -- 4/25/05 - * Added code to set cache_ptr->size_decreased to TRUE - * if the new configuration forces an immediate reduction - * in cache size. - * - * JRM -- 12/31/07 - * Added code supporting the new flash cache size increase - * code. - * *------------------------------------------------------------------------- */ herr_t @@ -4257,10 +3755,6 @@ done: * Programmer: John Mainzer * 7/27/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -4316,11 +3810,8 @@ done: * Programmer: John Mainzer * 1/20/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix) @@ -4362,11 +3853,8 @@ done: * Programmer: John Mainzer * 6/11/04 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5C_set_skip_flags(H5C_t * cache_ptr, hbool_t skip_file_checks, @@ -4407,11 +3895,8 @@ done: * Programmer: John Mainzer * 1/20/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5C_set_trace_file_ptr(H5C_t * cache_ptr, FILE * trace_file_ptr) @@ -4446,32 +3931,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM -- 9/8/05 - * Updated function for the addition of cache entry size - * change statistics. - * - * JRM -- 1/13/06 - * Added code to use the prefix field of H5C_t to allow - * tagging of statistics output. - * - * JRM -- 3/21/06 - * Added code supporting the pinned entry related stats. - * - * JRM -- 8/9/06 - * More code supporting pinned entry related stats. - * - * JRM -- 8/23/06 - * Added code supporting new flush related statistics. - * - * JRM -- 3/31/07 - * Added code supporting the new write_protects, - * read_protects, and max_read_protects fields. - * * JRM -- 11/13/08 * Added code displaying the max_clean_index_size and * max_dirty_index_size. @@ -4483,7 +3942,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_stats(H5C_t * cache_ptr, const char * cache_name, @@ -4507,9 +3965,9 @@ H5C_stats(H5C_t * cache_ptr, int64_t total_clears = 0; int64_t total_flushes = 0; int64_t total_evictions = 0; - int64_t total_renames = 0; - int64_t total_entry_flush_renames = 0; - int64_t total_cache_flush_renames = 0; + int64_t total_moves = 0; + int64_t total_entry_flush_moves = 0; + int64_t total_cache_flush_moves = 0; int64_t total_size_increases = 0; int64_t total_size_decreases = 0; int64_t total_entry_flush_size_changes = 0; @@ -4560,11 +4018,11 @@ 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_renames += cache_ptr->renames[i]; - total_entry_flush_renames - += cache_ptr->entry_flush_renames[i]; - total_cache_flush_renames - += cache_ptr->cache_flush_renames[i]; + total_moves += cache_ptr->moves[i]; + total_entry_flush_moves + += cache_ptr->entry_flush_moves[i]; + total_cache_flush_moves + += cache_ptr->cache_flush_moves[i]; total_size_increases += cache_ptr->size_increases[i]; total_size_decreases += cache_ptr->size_decreases[i]; total_entry_flush_size_changes @@ -4720,17 +4178,17 @@ H5C_stats(H5C_t * cache_ptr, (long)total_evictions); HDfprintf(stdout, - "%s Total insertions(pinned) / renames = %ld(%ld) / %ld\n", + "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, (long)total_insertions, (long)total_pinned_insertions, - (long)total_renames); + (long)total_moves); HDfprintf(stdout, - "%s Total entry / cache flush renames = %ld / %ld\n", + "%s Total entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, - (long)total_entry_flush_renames, - (long)total_cache_flush_renames); + (long)total_entry_flush_moves, + (long)total_cache_flush_moves); HDfprintf(stdout, "%s Total entry size incrs / decrs = %ld / %ld\n", cache_ptr->prefix, @@ -4849,17 +4307,17 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->evictions[i])); HDfprintf(stdout, - "%s insertions(pinned) / renames = %ld(%ld) / %ld\n", + "%s insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix, (long)(cache_ptr->insertions[i]), (long)(cache_ptr->pinned_insertions[i]), - (long)(cache_ptr->renames[i])); + (long)(cache_ptr->moves[i])); HDfprintf(stdout, - "%s entry / cache flush renames = %ld / %ld\n", + "%s entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix, - (long)(cache_ptr->entry_flush_renames[i]), - (long)(cache_ptr->cache_flush_renames[i])); + (long)(cache_ptr->entry_flush_moves[i]), + (long)(cache_ptr->cache_flush_moves[i])); HDfprintf(stdout, "%s size increases / decreases = %ld / %ld\n", @@ -4932,31 +4390,6 @@ done: * * Programmer: John Mainzer, 4/28/04 * - * Modifications: - * - * JRM - 7/21/04 - * Updated for hash table related statistics. - * - * JRM - 9/8/05 - * Updated for size increase / decrease statistics. - * - * JRM - 3/20/06 - * Updated for pin / unpin related statistics. - * - * JRM - 8/9/06 - * Further updates for pin related statistics. - * - * JRM 8/23/06 - * Added initialization code for new flush related statistics. - * - * JRM 2/16/07 - * Added conditional compile code to avoid unused parameter - * warning in the production build. - * - * JRM 3/31/07 - * Added initialization for the new write_protects, - * read_protects, and max_read_protects fields. - * * JRM 11/13/08 * Added initialization for the new max_clean_index_size and * max_dirty_index_size fields. @@ -4968,7 +4401,6 @@ done: * *------------------------------------------------------------------------- */ - void #ifndef NDEBUG H5C_stats__reset(H5C_t * cache_ptr) @@ -5000,9 +4432,9 @@ H5C_stats__reset(H5C_t UNUSED * cache_ptr) cache_ptr->clears[i] = 0; cache_ptr->flushes[i] = 0; cache_ptr->evictions[i] = 0; - cache_ptr->renames[i] = 0; - cache_ptr->entry_flush_renames[i] = 0; - cache_ptr->cache_flush_renames[i] = 0; + cache_ptr->moves[i] = 0; + cache_ptr->entry_flush_moves[i] = 0; + cache_ptr->cache_flush_moves[i] = 0; cache_ptr->pins[i] = 0; cache_ptr->unpins[i] = 0; cache_ptr->dirty_pins[i] = 0; @@ -5186,85 +4618,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated the function for the addition of the hash table. - * In particular, we now add dirty entries to the tree if - * they aren't in the tree already. - * - * JRM -- 1/6/05 - * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is - * ignored unless the new entry is dirty. Also note that - * once the flush_marker field of an entry is set, the - * only way it can be reset is by being flushed. - * - * JRM -- 6/3/05 - * Added the dirtied parameter and supporting code. This - * is part of an effort to move management of the is_dirty - * field into the cache code. This has become necessary - * to repair a cache coherency bug in PHDF5. - * - * JRM -- 7/5/05 - * Added code supporting the new clear_on_unprotect field - * of H5C_cache_entry_t. This change is also part of the - * above mentioned cache coherency bug fix in PHDF5. - * - * JRM -- 9/8/05 - * Added the size_changed and new_size parameters and the - * supporting code. Since the metadata cache synchronizes - * on dirty bytes creation in the PHDF5 case, we must now - * track changes in entry size. - * - * Note that the new_size parameter is ignored unless the - * size_changed parameter is TRUE. In this case, the new_size - * must be positive. - * - * Also observe that if size_changed is TRUE, dirtied must be - * TRUE. - * - * JRM -- 9/23/05 - * Moved the size_changed parameter into flags. - * - * JRM -- 3/21/06 - * Unpdated function to pin and unpin entries as directed via - * the new H5C__PIN_ENTRY_FLAG and H5C__UNPIN_ENTRY_FLAG flags. - * - * JRM -- 5/3/06 - * Added code to make use of the new dirtied field in - * H5C_cache_entry_t. If this field is TRUE, it is the - * equivalent of setting the H5C__DIRTIED_FLAG. - * - * JRM -- 3/29/07 - * Modified function to allow a entry to be protected - * more than once if the entry is protected read only. - * - * Also added sanity checks using the new is_read_only and - * ro_ref_count parameters. - * - * JRM -- 12/31/07 - * Modified function to support flash cache resizes. - * - * QAK -- 1/31/08 - * Modified function to support freeing file space in client's - * 'dest' callback routine. - * - * QAK -- 2/07/08 - * Separated "destroy entry" concept from "remove entry from - * cache" concept, by adding the 'take_ownership' flag. - * - * JRM -- 11/5/08 - * Added code to update the clean_index_size and - * dirty_index_size fields of H5C_t in cases where the - * the entry was clean on protect, was marked dirty on - * unprotect, and did not change its size. Do this via - * a call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(). - * - * If the size changed, this case is already dealt with by - * by the pre-existing call to - * H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(). - * *------------------------------------------------------------------------- */ herr_t @@ -5274,14 +4627,12 @@ H5C_unprotect(H5F_t * f, const H5C_class_t * type, haddr_t addr, void * thing, - unsigned int flags, - size_t new_size) + unsigned int flags) { H5C_t * cache_ptr; hbool_t deleted; hbool_t dirtied; hbool_t set_flush_marker; - hbool_t size_changed; hbool_t pin_entry; hbool_t unpin_entry; hbool_t free_file_space; @@ -5290,8 +4641,6 @@ H5C_unprotect(H5F_t * f, #ifdef H5_HAVE_PARALLEL hbool_t clear_entry = FALSE; #endif /* H5_HAVE_PARALLEL */ - herr_t result; - size_t size_increase = 0; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * test_entry_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -5301,18 +4650,11 @@ H5C_unprotect(H5F_t * f, deleted = ( (flags & H5C__DELETED_FLAG) != 0 ); dirtied = ( (flags & H5C__DIRTIED_FLAG) != 0 ); set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); - size_changed = ( (flags & H5C__SIZE_CHANGED_FLAG) != 0 ); pin_entry = ( (flags & H5C__PIN_ENTRY_FLAG) != 0 ); unpin_entry = ( (flags & H5C__UNPIN_ENTRY_FLAG) != 0 ); free_file_space = ( (flags & H5C__FREE_FILE_SPACE_FLAG) != 0 ); take_ownership = ( (flags & H5C__TAKE_OWNERSHIP_FLAG) != 0 ); - /* Changing the size of an entry dirties it. Thus, set the - * dirtied flag if the size_changed flag is set. - */ - - dirtied |= size_changed; - HDassert( f ); HDassert( f->shared ); @@ -5326,9 +4668,6 @@ H5C_unprotect(H5F_t * f, HDassert( type->flush ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); - HDassert( ( size_changed == TRUE ) || ( size_changed == FALSE ) ); - HDassert( ( ! size_changed ) || ( dirtied ) ); - HDassert( ( ! size_changed ) || ( new_size > 0 ) ); HDassert( ! ( pin_entry && unpin_entry ) ); HDassert( ( ! free_file_space ) || ( deleted ) ); /* deleted flag must accompany free_file_space */ HDassert( ( ! take_ownership ) || ( deleted ) ); /* deleted flag must accompany take_ownership */ @@ -5440,58 +4779,7 @@ H5C_unprotect(H5F_t * f, /* mark the entry as dirty if appropriate */ entry_ptr->is_dirty = ( (entry_ptr->is_dirty) || dirtied ); - /* update for change in entry size if necessary */ - if ( ( size_changed ) && ( entry_ptr->size != new_size ) ) { - - /* do a flash cache size increase if appropriate */ - if ( cache_ptr->flash_size_increase_possible ) { - - if ( new_size > entry_ptr->size ) { - - size_increase = new_size - entry_ptr->size; - - if ( size_increase >= - cache_ptr->flash_size_increase_threshold ) { - - result = H5C__flash_increase_cache_size(cache_ptr, - entry_ptr->size, - new_size); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "H5C__flash_increase_cache_size failed.") - } - } - } - } - - /* update the protected list */ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pl_len), \ - (cache_ptr->pl_size), \ - (entry_ptr->size), (new_size)); - - /* update the hash table */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), (entry_ptr->size), \ - (new_size), (entry_ptr), \ - (was_clean)); - - /* if the entry is in the skip list, update that too */ - if ( entry_ptr->in_slist ) { - - H5C__UPDATE_SLIST_FOR_SIZE_CHANGE((cache_ptr), \ - (entry_ptr->size),\ - (new_size)); - } - - /* update statistics just before changing the entry size */ - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE((cache_ptr), (entry_ptr), \ - (new_size)); - - /* finally, update the entry size proper */ - entry_ptr->size = new_size; - - } else if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) { + if ( ( was_clean ) && ( entry_ptr->is_dirty ) ) { H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) } @@ -5511,8 +4799,8 @@ H5C_unprotect(H5F_t * f, } - /* H5C__UPDATE_RP_FOR_UNPROTECT will places the unprotected entry on - * the pinned entry list if entry_ptr->is_pined is TRUE. + /* H5C__UPDATE_RP_FOR_UNPROTECT will place the unprotected entry on + * the pinned entry list if entry_ptr->is_pinned is TRUE. */ H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, FAIL) @@ -5663,15 +4951,8 @@ done: * Programmer: John Mainzer * 3/23/05 * - * Modifications: - * - * Added validation for the flash increment fields. - * - * JRM -- 12/31/07 - * *------------------------------------------------------------------------- */ - herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, unsigned int tests) @@ -6281,16 +5562,6 @@ done: * * Programmer: John Mainzer, 10/7/04 * - * Modifications: - * - * JRM -- 11/18/04 - * Major re-write to support ageout method of cache size - * reduction, and to adjust to changes in the - * H5C_auto_size_ctl_t structure. - * - * JRM -- 1/5/08 - * Added support for flash cache size increases. - * *------------------------------------------------------------------------- */ static herr_t @@ -6644,10 +5915,6 @@ done: * * Programmer: John Mainzer, 11/18/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ static herr_t @@ -6770,13 +6037,8 @@ done: * * Programmer: John Mainzer, 11/22/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) { @@ -6902,23 +6164,6 @@ done: * * Programmer: John Mainzer, 11/22/04 * - * Modifications: - * - * JRM -- 10/13/07 - * Added code to detect and manage the case in which a - * flush callback changes the LRU-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * *------------------------------------------------------------------------- */ static herr_t @@ -7137,13 +6382,8 @@ done: * * Programmer: John Mainzer, 11/19/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) { @@ -7219,13 +6459,8 @@ done: * * Programmer: John Mainzer, 11/22/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) { @@ -7305,13 +6540,8 @@ done: * * Programmer: John Mainzer, 11/19/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) { @@ -7399,10 +6629,6 @@ done: * * Programmer: John Mainzer, 12/31/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ static herr_t @@ -7588,30 +6814,6 @@ done: * Programmer: John Mainzer * 3/24/065 * - * Modifications: - * - * To support the fractal heap, the cache must now deal with - * entries being dirtied, resized, and/or renamed inside - * flush callbacks. Updated function to support this. - * - * -- JRM 8/27/06 - * - * Added code to detect and manage the case in which a - * flush callback changes the s-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * - * -- JRM 10/13/07 - * *------------------------------------------------------------------------- */ static herr_t @@ -7672,14 +6874,14 @@ H5C_flush_invalidate_cache(H5F_t * f, * unpin themselves, or until the number of pinned entries stops * declining. In this later case, we scream and die. * - * Since the fractal heap can dirty, resize, and/or rename entries + * Since the fractal heap can dirty, resize, and/or move entries * in is flush callback, it is possible that the cache will still * contain dirty entries at this point. If so, we must make up to * H5C__MAX_PASSES_ON_FLUSH more passes through the skip list * to allow it to empty. If is is not empty at this point, we again * scream and die. * - * Further, since clean entries can be dirtied, resized, and/or renamed + * Further, since clean entries can be dirtied, resized, and/or moved * as the result of a flush call back (either the entries own, or that * for some other cache entry), we can no longer promise to flush * the cache entries in increasing address order. @@ -7748,7 +6950,7 @@ H5C_flush_invalidate_cache(H5F_t * f, initial_slist_size = cache_ptr->slist_size; /* There is also the possibility that entries will be - * dirtied, resized, and/or renamed as the result of + * dirtied, resized, and/or moved as the result of * calls to the flush callbacks. We use the slist_len_increase * and slist_size_increase increase fields in struct H5C_t * to track these changes for purpose of sanity checking. @@ -8167,58 +7369,6 @@ done: * * Programmer: John Mainzer, 5/5/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * QAK -- 11/26/04 - * Updated function for the switch from TBBTs to skip lists. - * - * JRM -- 1/6/05 - * Updated function to reset the flush_marker field. - * Also replace references to H5F_FLUSH_INVALIDATE and - * H5F_FLUSH_CLEAR_ONLY with references to - * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG - * respectively. - * - * JRM -- 6/24/05 - * Added code to remove dirty entries from the slist after - * they have been flushed. Also added a sanity check that - * will scream if we attempt a write when writes are - * completely disabled. - * - * JRM -- 7/5/05 - * Added code to call the new log_flush callback whenever - * a dirty entry is written to disk. Note that the callback - * is not called if the H5C__FLUSH_CLEAR_ONLY_FLAG is set, - * as there is no write to file in this case. - * - * JRM -- 8/21/06 - * Added code maintaining the flush_in_progress and - * destroy_in_progress fields in H5C_cache_entry_t. - * - * Also added flush_flags parameter to the call to - * type_ptr->flush() so that the flush routine can report - * whether the entry has been resized or renamed. Added - * code using the flush_flags variable to detect the case - * in which the target entry is resized during flush, and - * update the caches data structures accordingly. - * - * JRM -- 3/29/07 - * Added sanity checks on the new is_read_only and - * ro_ref_count fields. - * - * QAK -- 2/07/08 - * Separated "destroy entry" concept from "remove entry from - * cache" concept, by adding the 'take_ownership' flag and - * the "destroy_entry" variable. - * - * JRM -- 11/5/08 - * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN() to - * maintain the new clean_index_size and clean_index_size - * fields of H5C_t. - * *------------------------------------------------------------------------- */ static herr_t @@ -8397,8 +7547,8 @@ H5C_flush_single_entry(H5F_t * f, * We must do deletions now as the callback routines will free the * entry if destroy is true. * - * Note that it is possible that the entry will be renamed during - * its call to flush. This will upset H5C_rename_entry() if we + * 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. @@ -8641,9 +7791,9 @@ H5C_flush_single_entry(H5F_t * f, * change this test accordingly. * * NB: While this test detects entryies that attempt - * to resize or rename themselves during a flush + * to resize or move themselves during a flush * in the parallel case, it will not detect an - * entry that dirties, resizes, and/or renames + * entry that dirties, resizes, and/or moves * other entries during its flush. * * From what Quincey tells me, this test is @@ -8656,7 +7806,7 @@ H5C_flush_single_entry(H5F_t * f, if ( cache_ptr->aux_ptr != NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "resize/rename in serialize occured in parallel case.") + "resize/move in serialize occured in parallel case.") } } @@ -8741,9 +7891,9 @@ H5C_flush_single_entry(H5F_t * f, } } - if ( (flush_flags & H5C_CALLBACK__RENAMED_FLAG) != 0 ) { + if ( (flush_flags & H5C_CALLBACK__MOVED_FLAG) != 0 ) { - /* The entry was renamed as the result of the flush. + /* 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 @@ -8795,25 +7945,6 @@ done: * * Programmer: John Mainzer, 5/18/04 * - * Modifications: - * - * JRM - 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM - 6/23/06 - * Deleted assertion that verified that a newly loaded - * entry is clean. Due to a bug fix, this need not be - * the case, as our code will attempt to repair errors - * on load. - * - * JRM - 8/21/06 - * Added initialization for the new flush_in_progress and - * destroy in progress fields. - * - * JRM - 3/29/07 - * Added initialization for the new is_read_only and - * ro_ref_count fields. - * * QAK -- 1/31/08 * Added initialization for the new free_file_space_on_destroy * field. @@ -8832,29 +7963,28 @@ H5C_load_entry(H5F_t * f, hbool_t UNUSED skip_file_checks) #endif /* NDEBUG */ { - void * thing = NULL; - H5C_cache_entry_t * entry_ptr = NULL; - unsigned u; /* Local index variable */ - void * ret_value = NULL; /* Return value */ + void * thing = NULL; /* Pointer to thing loaded */ + H5C_cache_entry_t * entry; /* Alias for thing loaded, as cache entry */ + unsigned u; /* Local index variable */ + void * ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C_load_entry) - HDassert( f ); - HDassert( f->shared ); - HDassert( f->shared->cache ); - HDassert( skip_file_checks || f ); - HDassert( type ); - HDassert( type->load ); - HDassert( type->size ); - HDassert( H5F_addr_defined(addr) ); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->cache); + HDassert(skip_file_checks || f); + HDassert(type); + HDassert(type->load); + HDassert(type->size); + HDassert(H5F_addr_defined(addr)); - if ( NULL == (thing = (type->load)(f, dxpl_id, addr, udata)) ) { + if(NULL == (thing = (type->load)(f, dxpl_id, addr, udata))) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "unable to load entry") - } - entry_ptr = (H5C_cache_entry_t *)thing; + entry = (H5C_cache_entry_t *)thing; /* In general, an entry should be clean just after it is loaded. * @@ -8865,11 +7995,11 @@ H5C_load_entry(H5F_t * f, * * To support this bug fix, I have replace the old assert: * - * HDassert( entry_ptr->is_dirty == FALSE ); + * HDassert( entry->is_dirty == FALSE ); * * with: * - * HDassert( ( entry_ptr->is_dirty == FALSE ) || ( type->id == 5 ) ); + * HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); * * Note that type id 5 is associated with object headers in the metadata * cache. @@ -8879,56 +8009,52 @@ H5C_load_entry(H5F_t * f, * metadata cache. */ - HDassert( ( entry_ptr->is_dirty == FALSE ) || ( type->id == 5 ) ); + HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); #ifndef NDEBUG - entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; + entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ - entry_ptr->cache_ptr = f->shared->cache; - entry_ptr->addr = addr; - entry_ptr->type = type; - entry_ptr->is_protected = FALSE; - entry_ptr->is_read_only = FALSE; - entry_ptr->ro_ref_count = 0; - entry_ptr->in_slist = FALSE; - entry_ptr->flush_marker = FALSE; + entry->cache_ptr = f->shared->cache; + entry->addr = addr; + entry->type = type; + entry->is_protected = FALSE; + entry->is_read_only = FALSE; + entry->ro_ref_count = 0; + entry->in_slist = FALSE; + entry->flush_marker = FALSE; #ifdef H5_HAVE_PARALLEL - entry_ptr->clear_on_unprotect = FALSE; + entry->clear_on_unprotect = FALSE; #endif /* H5_HAVE_PARALLEL */ - entry_ptr->flush_in_progress = FALSE; - entry_ptr->destroy_in_progress = FALSE; - entry_ptr->free_file_space_on_destroy = FALSE; + entry->flush_in_progress = FALSE; + entry->destroy_in_progress = FALSE; + entry->free_file_space_on_destroy = FALSE; - if ( (type->size)(f, thing, &(entry_ptr->size)) < 0 ) { + if((type->size)(f, thing, &(entry->size)) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, NULL, \ - "Can't get size of thing") - } + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, NULL, "Can't get size of thing") - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry->size < H5C_MAX_ENTRY_SIZE ); /* Initialize flush dependency height fields */ - entry_ptr->flush_dep_parent = NULL; + entry->flush_dep_parent = NULL; for(u = 0; u < H5C__NUM_FLUSH_DEP_HEIGHTS; u++) - entry_ptr->child_flush_dep_height_rc[u] = 0; - entry_ptr->flush_dep_height = 0; - - entry_ptr->ht_next = NULL; - entry_ptr->ht_prev = NULL; + entry->child_flush_dep_height_rc[u] = 0; + entry->flush_dep_height = 0; + entry->ht_next = NULL; + entry->ht_prev = NULL; - entry_ptr->next = NULL; - entry_ptr->prev = NULL; + entry->next = NULL; + entry->prev = NULL; - entry_ptr->aux_next = NULL; - entry_ptr->aux_prev = NULL; + entry->aux_next = NULL; + entry->aux_prev = NULL; - H5C__RESET_CACHE_ENTRY_STATS(entry_ptr); + H5C__RESET_CACHE_ENTRY_STATS(entry); ret_value = thing; done: FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_load_entry() */ @@ -8965,44 +8091,6 @@ done: * * Programmer: John Mainzer, 5/14/04 * - * Modifications: - * - * JRM --7/21/04 - * Minor modifications in support of the addition of a hash - * table to facilitate lookups. - * - * JRM -- 11/22/04 - * Added the first_flush_ptr parameter, which replaces the - * old first_flush local variable. This allows the function - * to coordinate on the first flush issue with other functions. - * - * JRM -- 12/13/04 - * Added code to skip over epoch markers if present. - * - * JRM -- 1/3/06 - * Modified function to work correctly when the the cache - * is not full. This case occurs when we need to flush to - * min clean size before the cache has filled. - * - * JRM -- 3/29/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields. - * - * JRM -- 10/13/07 - * Added code to detect and manage the case in which a - * flush callback changes the LRU-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * * JRM -- 11/13/08 * Modified function to always observe the min_clean_size * whether we are maintaining the clean and dirt LRU lists @@ -9335,11 +8423,8 @@ done: * * Programmer: John Mainzer, 7/14/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #if H5C_DO_EXTREME_SANITY_CHECKS static herr_t @@ -9458,11 +8543,8 @@ done: * * Programmer: John Mainzer, 7/14/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #if H5C_DO_EXTREME_SANITY_CHECKS static herr_t diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 21151d0..e1dffa4 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -44,7 +44,7 @@ #include "H5SLprivate.h" /* Skip lists */ /* With the introduction of the fractal heap, it is now possible for - * entries to be dirtied, resized, and/or renamed in the flush callbacks. + * 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 * through the slist before it is empty. The H5C__MAX_PASSES_ON_FLUSH * #define is used to set an upper limit on the number of passes. @@ -283,7 +283,7 @@ * some optimizations when I get to it. * * With the addition of the fractal heap, the cache must now deal with - * the case in which entries may be dirtied, renamed, or have their sizes + * 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. @@ -669,19 +669,19 @@ * equal to the array index has been evicted from the cache in * the current epoch. * - * renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * 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 renamed in the current + * id equal to the array index has been moved in the current * epoch. * - * entry_flush_renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * 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 renamed + * with type id equal to the array index has been moved * during its flush callback in the current epoch. * - * cache_flush_renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * 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 renamed + * 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 @@ -960,9 +960,9 @@ 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 renames[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t entry_flush_renames[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t cache_flush_renames[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]; @@ -1493,14 +1493,14 @@ if ( ( (entry_ptr) == NULL ) || \ if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; -#define H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) \ +#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \ if ( cache_ptr->flush_in_progress ) { \ - ((cache_ptr)->cache_flush_renames[(entry_ptr)->type->id])++; \ + ((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \ } \ if ( entry_ptr->flush_in_progress ) { \ - ((cache_ptr)->entry_flush_renames[(entry_ptr)->type->id])++; \ + ((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \ } \ - (((cache_ptr)->renames)[(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 ) { \ @@ -1728,7 +1728,7 @@ if ( ( (entry_ptr) == NULL ) || \ #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_RENAME(cache_ptr, entry_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) @@ -2173,7 +2173,7 @@ if ( (cache_ptr)->index_size != \ * checks in the flush routines. * * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or rename entries during the + * able to dirty, resize and/or move entries during the * flush. * *------------------------------------------------------------------------- @@ -2312,7 +2312,7 @@ if ( (cache_ptr)->index_size != \ * that are used in sanity checks in the flush routines. * * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or rename entries during the + * able to dirty, resize and/or move entries during the * flush. * *------------------------------------------------------------------------- @@ -3057,10 +3057,10 @@ if ( (cache_ptr)->index_size != \ /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_RENAME + * Macro: H5C__UPDATE_RP_FOR_MOVE * * Purpose: Update the replacement policy data structures for a - * rename of the specified cache entry. + * move of the specified cache entry. * * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If @@ -3071,49 +3071,12 @@ if ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/17/04 * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_rename() to the - * macro H5C__UPDATE_RP_FOR_RENAME 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 - 6/23/05 - * Added the was_dirty parameter. It is possible that - * the entry was clean when it was renamed -- if so it - * it is in the clean LRU regardless of the current - * value of the is_dirty field. - * - * At present, all renamed entries are forced to be - * dirty. This macro is a bit more general that that, - * to allow it to function correctly should that policy - * be relaxed in the future. - * - * JRM - 3/17/06 - * Modified macro to do nothing if the entry is pinned. - * In this case, the entry is on the pinned entry list, not - * in the replacement policy data structures, so there is - * nothing to be done. - * - * 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__UPDATE_RP_FOR_RENAME(cache_ptr, entry_ptr, was_dirty, fail_val) \ +#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 ); \ @@ -3187,11 +3150,11 @@ if ( (cache_ptr)->index_size != \ \ /* End modified LRU specific code. */ \ } \ -} /* H5C__UPDATE_RP_FOR_RENAME */ +} /* H5C__UPDATE_RP_FOR_MOVE */ #else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__UPDATE_RP_FOR_RENAME(cache_ptr, entry_ptr, was_dirty, fail_val) \ +#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 ); \ @@ -3220,7 +3183,7 @@ if ( (cache_ptr)->index_size != \ \ /* End modified LRU specific code. */ \ } \ -} /* H5C__UPDATE_RP_FOR_RENAME */ +} /* H5C__UPDATE_RP_FOR_MOVE */ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 2cdfbee..3f38500 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -123,7 +123,7 @@ typedef struct H5C_t H5C_t; #define H5C_CALLBACK__NO_FLAGS_SET 0x0 #define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1 -#define H5C_CALLBACK__RENAMED_FLAG 0x2 +#define H5C_CALLBACK__MOVED_FLAG 0x2 /* Actions that can be reported to 'notify' client callback */ typedef enum H5C_notify_action_t { @@ -293,10 +293,10 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * * This field is set to FALSE in the protect call, and may * be set to TRUE by the - * H5C_mark_pinned_or_protected_entry_dirty() + * H5C_mark_entry_dirty() * call at an time prior to the unprotect call. * - * The H5C_mark_pinned_or_protected_entry_dirty() call exists + * The H5C_mark_entry_dirty() call exists * as a convenience function for the fractal heap code which * may not know if an entry is protected or pinned, but knows * that is either protected or pinned. The dirtied field was @@ -995,7 +995,6 @@ typedef struct H5C_auto_size_ctl_t * H5C__SET_FLUSH_MARKER_FLAG * H5C__DELETED_FLAG * H5C__DIRTIED_FLAG - * H5C__SIZE_CHANGED_FLAG * H5C__PIN_ENTRY_FLAG * H5C__UNPIN_ENTRY_FLAG * H5C__FREE_FILE_SPACE_FLAG @@ -1025,14 +1024,13 @@ typedef struct H5C_auto_size_ctl_t #define H5C__SET_FLUSH_MARKER_FLAG 0x0001 #define H5C__DELETED_FLAG 0x0002 #define H5C__DIRTIED_FLAG 0x0004 -#define H5C__SIZE_CHANGED_FLAG 0x0008 -#define H5C__PIN_ENTRY_FLAG 0x0010 -#define H5C__UNPIN_ENTRY_FLAG 0x0020 -#define H5C__FLUSH_INVALIDATE_FLAG 0x0040 -#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0080 -#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0100 -#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0200 -#define H5C__READ_ONLY_FLAG 0x0400 +#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 @@ -1118,13 +1116,9 @@ H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f, int32_t ce_array_len, haddr_t *ce_array_ptr); -H5_DLL herr_t H5C_mark_pinned_entry_dirty(void * thing, - hbool_t size_changed, - size_t new_size); +H5_DLL herr_t H5C_mark_entry_dirty(void *thing); -H5_DLL herr_t H5C_mark_pinned_or_protected_entry_dirty(void *thing); - -H5_DLL herr_t H5C_rename_entry(H5C_t * cache_ptr, +H5_DLL herr_t H5C_move_entry(H5C_t * cache_ptr, const H5C_class_t * type, haddr_t old_addr, haddr_t new_addr); @@ -1143,7 +1137,7 @@ H5_DLL void * H5C_protect(H5F_t * f, H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr); -H5_DLL herr_t H5C_resize_pinned_entry(void *thing, size_t new_size); +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); @@ -1176,8 +1170,7 @@ H5_DLL herr_t H5C_unprotect(H5F_t * f, const H5C_class_t * type, haddr_t addr, void * thing, - unsigned int flags, - size_t new_size); + unsigned int flags); H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, unsigned int tests); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 4651d74..bd2bd7e 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -51,6 +51,9 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#ifdef H5_HAVE_PARALLEL +#include "H5ACprivate.h" /* Metadata cache */ +#endif /* H5_HAVE_PARALLEL */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -99,20 +102,13 @@ /* Local Typedefs */ /******************/ -/* Stack of chunks to remove during a "prune" iteration */ -typedef struct H5D_chunk_prune_stack_t { - H5D_chunk_rec_t rec; /* Chunk record */ - struct H5D_chunk_prune_stack_t *next; /* Next chunk in stack */ -} H5D_chunk_prune_stack_t; - /* Callback info for iteration to prune chunks */ typedef struct H5D_chunk_it_ud1_t { H5D_chunk_common_ud_t common; /* Common info for B-tree user data (must be first) */ const H5D_chk_idx_info_t *idx_info; /* Chunked index info */ const H5D_io_info_t *io_info; /* I/O info for dataset operation */ - const hsize_t *dims; /* New dataset dimensions */ - const hbool_t *shrunk_dims; /* Dimensions which have been shrunk */ - H5D_chunk_prune_stack_t *rm_stack; /* Stack of chunks outside the new dimensions */ + const hsize_t *space_dim; /* New dataset dimensions */ + const hbool_t *shrunk_dim; /* Dimensions which have been shrunk */ H5S_t *chunk_space; /* Dataspace for a chunk */ uint32_t elmts_per_chunk;/* Elements in chunk */ hsize_t *hyper_start; /* Starting location of hyperslab */ @@ -195,6 +191,8 @@ static herr_t H5D_chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims const hsize_t *curr_dims); static void *H5D_chunk_alloc(size_t size, const H5O_pline_t *pline); static void *H5D_chunk_xfree(void *chk, const H5O_pline_t *pline); +static void *H5D_chunk_realloc(void *chk, size_t size, + const H5O_pline_t *pline); static herr_t H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata); static herr_t H5D_free_chunk_info(void *item, void *key, void *opdata); @@ -268,9 +266,6 @@ H5FL_DEFINE(H5D_chunk_info_t); /* Declare a free list to manage the chunk sequence information */ H5FL_BLK_DEFINE_STATIC(chunk); -/* Declare a free list to manage H5D_chunk_sl_ck_t objects */ -H5FL_DEFINE_STATIC(H5D_chunk_prune_stack_t); - /*------------------------------------------------------------------------- @@ -909,6 +904,39 @@ H5D_chunk_xfree(void *chk, const H5O_pline_t *pline) } /* H5D_chunk_xfree() */ +/*------------------------------------------------------------------------- + * Function: H5D_chunk_realloc + * + * Purpose: Reallocate space for a chunk in memory. This routine allocates + * memory space for non-filtered chunks from a block free list + * and uses malloc()/free() for filtered chunks. + * + * Return: Pointer to memory for chunk on success/NULL on failure + * + * Programmer: Neil Fortner + * May 3, 2010 + * + *------------------------------------------------------------------------- + */ +static void * +H5D_chunk_realloc(void *chk, size_t size, const H5O_pline_t *pline) +{ + void *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_realloc) + + HDassert(size); + HDassert(pline); + + if(pline->nused > 0) + ret_value = H5MM_realloc(chk, size); + else + ret_value = H5FL_BLK_REALLOC(chunk, chk, size); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_chunk_realloc() */ + + /*-------------------------------------------------------------------------- NAME H5D_free_chunk_info @@ -1589,53 +1617,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_in_cache - * - * Purpose: Check if a chunk is in the cache. - * - * Return: TRUE or FALSE - * - * Programmer: Quincey Koziol - * 1 April 2008 - * - *------------------------------------------------------------------------- - */ -static hbool_t -H5D_chunk_in_cache(const H5D_t *dset, const hsize_t *chunk_offset, - hsize_t chunk_idx) -{ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);/*raw data chunk cache*/ - hbool_t found = FALSE; /*already in cache? */ - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_in_cache) - - /* Sanity checks */ - HDassert(dset); - HDassert(chunk_offset); - - /* Check if the chunk is in the cache (but hasn't been written to disk yet) */ - if(rdcc->nslots > 0) { - unsigned idx = H5D_CHUNK_HASH(dset->shared, chunk_idx); /* Cache entry index */ - H5D_rdcc_ent_t *ent = rdcc->slot[idx]; /* Cache entry */ - - /* Potential match... */ - if(ent) { - size_t u; /* Local index variable */ - - for(u = 0, found = TRUE; u < dset->shared->layout.u.chunk.ndims; u++) { - if(chunk_offset[u] != ent->offset[u]) { - found = FALSE; - break; - } /* end if */ - } /* end for */ - } /* end if */ - } /* end if */ - - FUNC_LEAVE_NOAPI(found) -} /* end H5D_chunk_in_cache() */ - - -/*------------------------------------------------------------------------- * Function: H5D_chunk_read * * Purpose: Read from a chunked dataset. @@ -1661,7 +1642,6 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t src_accessed_bytes = 0; /* Total accessed size in a chunk */ hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */ - unsigned idx_hint = 0; /* Cache index hint */ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_read) @@ -1721,11 +1701,12 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Get the info for the chunk in the file */ - if(H5D_chunk_get_info(io_info->dset, io_info->dxpl_id, chunk_info->coords, &udata) < 0) + if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, + chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Check for non-existant chunk & skip it if appropriate */ - if(H5F_addr_defined(udata.addr) || H5D_chunk_in_cache(io_info->dset, chunk_info->coords, chunk_info->index) + if(H5F_addr_defined(udata.addr) || UINT_MAX != udata.idx_hint || !skip_missing_chunks) { /* Load the chunk into cache and lock it. */ if((cacheable = H5D_chunk_cacheable(io_info, udata.addr, FALSE)) < 0) @@ -1740,7 +1721,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, src_accessed_bytes = chunk_info->chunk_points * (uint32_t)type_info->src_type_size; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, FALSE, &idx_hint))) + if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, FALSE))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1773,7 +1754,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, FALSE, idx_hint, chunk, src_accessed_bytes) < 0) + if(chunk && H5D_chunk_unlock(io_info, &udata, FALSE, chunk, src_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ @@ -1816,7 +1797,6 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ - unsigned idx_hint = 0; /* Cache index hint */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_write) @@ -1857,7 +1837,8 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Load the chunk into cache. But if the whole chunk is written, * simply allocate space instead of load the chunk. */ - if(H5D_chunk_get_info(io_info->dset, io_info->dxpl_id, chunk_info->coords, &udata) < 0) + if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, + chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") if((cacheable = H5D_chunk_cacheable(io_info, udata.addr, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") @@ -1878,7 +1859,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, entire_chunk = FALSE; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk, &idx_hint))) + if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1930,7 +1911,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, TRUE, idx_hint, chunk, dst_accessed_bytes) < 0) + if(chunk && H5D_chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") /* Advance to next chunk in list */ @@ -2256,11 +2237,10 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_get_info + * Function: H5D_chunk_lookup * - * Purpose: Get the info about a chunk if file space has been - * assigned. Save the retrieved information in the udata - * supplied. + * Purpose: Loops up a chunk in cache and on disk, and retrieves + * information about that chunk. * * Return: Non-negative on success/Negative on failure * @@ -2270,12 +2250,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_get_info(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, - H5D_chunk_ud_t *udata) +H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, + hsize_t chunk_idx, H5D_chunk_ud_t *udata) { + H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ + hbool_t found = FALSE; /* In cache? */ + unsigned u; /* Counter */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_get_info) + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_lookup) HDassert(dset); HDassert(dset->shared->layout.u.chunk.ndims > 0); @@ -2298,28 +2281,49 @@ H5D_chunk_get_info(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset udata->filter_mask = 0; udata->addr = HADDR_UNDEF; - /* Check for cached information */ - if(!H5D_chunk_cinfo_cache_found(&dset->shared->cache.chunk.last, udata)) { - H5D_chk_idx_info_t idx_info; /* Chunked index info */ + /* Check for chunk in cache */ + if(dset->shared->cache.chunk.nslots > 0) { + udata->idx_hint = H5D_CHUNK_HASH(dset->shared, chunk_idx); + ent = dset->shared->cache.chunk.slot[udata->idx_hint]; - /* Compose chunked index info struct */ - idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; - idx_info.pline = &dset->shared->dcpl_cache.pline; - idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + if(ent) + for(u = 0, found = TRUE; u < dset->shared->layout.u.chunk.ndims; u++) + if(chunk_offset[u] != ent->offset[u]) { + found = FALSE; + break; + } /* end if */ + } /* end if */ - /* Go get the chunk information */ - if((dset->shared->layout.storage.u.chunk.ops->get_addr)(&idx_info, udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query chunk address") + /* Find chunk addr */ + if(found) + udata->addr = ent->chunk_addr; + else { + /* Invalidate idx_hint, to signal that the chunk is not in cache */ + udata->idx_hint = UINT_MAX; - /* Cache the information retrieved */ - H5D_chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, udata); - } /* end if */ + /* Check for cached information */ + if(!H5D_chunk_cinfo_cache_found(&dset->shared->cache.chunk.last, udata)) { + H5D_chk_idx_info_t idx_info; /* Chunked index info */ + + /* Compose chunked index info struct */ + idx_info.f = dset->oloc.file; + idx_info.dxpl_id = dxpl_id; + idx_info.pline = &dset->shared->dcpl_cache.pline; + idx_info.layout = &dset->shared->layout.u.chunk; + idx_info.storage = &dset->shared->layout.storage.u.chunk; + + /* Go get the chunk information */ + if((dset->shared->layout.storage.u.chunk.ops->get_addr)(&idx_info, udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query chunk address") + + /* Cache the information retrieved */ + H5D_chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, udata); + } /* end if */ + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_get_info() */ +} /* H5D_chunk_lookup() */ /*------------------------------------------------------------------------- @@ -2360,7 +2364,7 @@ H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * HDassert(!ent->locked); buf = ent->chunk; - if(ent->dirty) { + if(ent->dirty && !ent->deleted) { H5D_chunk_ud_t udata; /* pass through B-tree */ hbool_t must_insert = FALSE; /* Whether the chunk must go through the "insert" method */ @@ -2699,7 +2703,7 @@ done: */ void * H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, - hbool_t relax, unsigned *idx_hint/*in,out*/) + hbool_t relax) { H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info */ @@ -2709,7 +2713,6 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache*/ H5D_rdcc_ent_t *ent = NULL; /*cache entry */ - unsigned idx = 0; /*hash index number */ hbool_t found = FALSE; /*already in cache? */ haddr_t chunk_addr = HADDR_UNDEF; /* Address of chunk on disk */ size_t chunk_size; /*size of a chunk */ @@ -2730,20 +2733,21 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, HDassert(layout->u.chunk.size > 0); H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); - /* Search for the chunk in the cache */ - if(rdcc->nslots > 0) { - idx = H5D_CHUNK_HASH(dset->shared, io_info->store->chunk.index); - ent = rdcc->slot[idx]; + /* Check if the chunk is in the cache */ + if(UINT_MAX != udata->idx_hint) { + /* Sanity check */ + HDassert(udata->idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata->idx_hint]); - if(ent) - for(u = 0, found = TRUE; u < layout->u.chunk.ndims; u++) - if(io_info->store->chunk.offset[u] != ent->offset[u]) { - found = FALSE; - break; - } /* end if */ - } /* end if */ + /* Get the entry */ + ent = rdcc->slot[udata->idx_hint]; + +#ifndef NDEBUG + /* Make sure this is the right chunk */ + for(u = 0; u < layout->u.chunk.ndims; u++) + HDassert(io_info->store->chunk.offset[u] == ent->offset[u]); +#endif /* NDEBUG */ - if(found) { /* * Already in the cache. Count a hit. */ @@ -2758,6 +2762,9 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, */ rdcc->stats.nhits++; + /* Still save the chunk address so the cache stays consistent */ + chunk_addr = udata->addr; + if(NULL == (chunk = H5D_chunk_alloc(chunk_size, pline))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") @@ -2799,6 +2806,9 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, else { H5D_fill_value_t fill_status; + /* Sanity check */ + HDassert(fill->alloc_time != H5D_ALLOC_TIME_EARLY); + /* Chunk size on disk isn't [likely] the same size as the final chunk * size in memory, so allocate memory big enough. */ if(NULL == (chunk = H5D_chunk_alloc(chunk_size, pline))) @@ -2816,8 +2826,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ - if(H5D_fill_init(&fb_info, chunk, FALSE, - NULL, NULL, NULL, NULL, + if(H5D_fill_init(&fb_info, chunk, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, chunk_size, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't initialize fill buffer info") @@ -2838,75 +2847,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, } /* end else */ HDassert(found || chunk_size > 0); - if(!found && rdcc->nslots > 0 && chunk_size <= rdcc->nbytes_max && - (!ent || !ent->locked)) { - /* - * Add the chunk to the cache only if the slot is not already locked. - * Preempt enough things from the cache to make room. - */ - if(ent) { - if(H5D_chunk_cache_evict(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, ent, TRUE) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache") - } /* end if */ - if(H5D_chunk_cache_prune(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, chunk_size) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache") - - /* Create a new entry */ - if(NULL == (ent = H5FL_MALLOC(H5D_rdcc_ent_t))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't allocate raw data chunk entry") - - ent->locked = 0; - ent->dirty = FALSE; - ent->chunk_addr = chunk_addr; - ent->proxy_addr = HADDR_UNDEF; - ent->proxy = NULL; - for(u = 0; u < layout->u.chunk.ndims; u++) - ent->offset[u] = io_info->store->chunk.offset[u]; - H5_ASSIGN_OVERFLOW(ent->rd_count, chunk_size, size_t, uint32_t); - H5_ASSIGN_OVERFLOW(ent->wr_count, chunk_size, size_t, uint32_t); - ent->chunk = (uint8_t *)chunk; - - /* Add it to the cache */ - HDassert(NULL == rdcc->slot[idx]); - rdcc->slot[idx] = ent; - ent->idx = idx; - rdcc->nbytes_used += chunk_size; - rdcc->nused++; - - /* Add it to the linked list */ - ent->next = NULL; - if(rdcc->tail) { - rdcc->tail->next = ent; - ent->prev = rdcc->tail; - rdcc->tail = ent; - } /* end if */ - else { - rdcc->head = rdcc->tail = ent; - ent->prev = NULL; - } /* end else */ - - /* Check for SWMR writes to the file */ - if(io_info->dset->shared->layout.storage.u.chunk.ops->can_swim - && (H5F_INTENT(io_info->dset->oloc.file) & H5F_ACC_SWMR_WRITE)) { - /* Insert a proxy entry in the cache, to make certain that the - * flush dependencies are maintained in the proper way for SWMR - * access to work. - */ - if(H5D_chunk_proxy_create(io_info->dset, io_info->dxpl_id, (H5D_chunk_common_ud_t *)udata, ent) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, NULL, "can't insert proxy for chunk in metadata cache") - } /* end if */ - - /* Indicate that the chunk is in the cache now */ - found = TRUE; - } else if(!found) { - /* - * The chunk is larger than the entire cache so we don't cache it. - * This is the reason all those arguments have to be repeated for the - * unlock function. - */ - ent = NULL; - idx = UINT_MAX; - } else { + if(ent) { /* * The chunk is not at the beginning of the cache; move it backward * by one slot. This is how we implement the LRU preemption @@ -2927,8 +2868,81 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, ent->next = ent->next->next; ent->prev->next = ent; } /* end if */ + } /* end if */ + else if(rdcc->nslots > 0 && chunk_size <= rdcc->nbytes_max) { + /* Calculate the index */ + udata->idx_hint = H5D_CHUNK_HASH(dset->shared, io_info->store->chunk.index); + + /* Add the chunk to the cache only if the slot is not already locked */ + ent = rdcc->slot[udata->idx_hint]; + if(!ent || !ent->locked) { + /* Preempt enough things from the cache to make room */ + if(ent) { + if(H5D_chunk_cache_evict(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, ent, TRUE) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache") + } /* end if */ + if(H5D_chunk_cache_prune(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, chunk_size) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache") + + /* Create a new entry */ + if(NULL == (ent = H5FL_MALLOC(H5D_rdcc_ent_t))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, NULL, "can't allocate raw data chunk entry") + + ent->locked = 0; + ent->dirty = FALSE; + ent->deleted = FALSE; + ent->chunk_addr = chunk_addr; + ent->proxy_addr = HADDR_UNDEF; + ent->proxy = NULL; + for(u = 0; u < layout->u.chunk.ndims; u++) + ent->offset[u] = io_info->store->chunk.offset[u]; + H5_ASSIGN_OVERFLOW(ent->rd_count, chunk_size, size_t, uint32_t); + H5_ASSIGN_OVERFLOW(ent->wr_count, chunk_size, size_t, uint32_t); + ent->chunk = (uint8_t *)chunk; + + /* Add it to the cache */ + HDassert(NULL == rdcc->slot[udata->idx_hint]); + rdcc->slot[udata->idx_hint] = ent; + ent->idx = udata->idx_hint; + rdcc->nbytes_used += chunk_size; + rdcc->nused++; + + /* Add it to the linked list */ + ent->next = NULL; + if(rdcc->tail) { + rdcc->tail->next = ent; + ent->prev = rdcc->tail; + rdcc->tail = ent; + } /* end if */ + else { + rdcc->head = rdcc->tail = ent; + ent->prev = NULL; + } /* end else */ + + /* Check for SWMR writes to the file */ + if(io_info->dset->shared->layout.storage.u.chunk.ops->can_swim + && (H5F_INTENT(io_info->dset->oloc.file) & H5F_ACC_SWMR_WRITE)) { + /* Insert a proxy entry in the cache, to make certain that the + * flush dependencies are maintained in the proper way for SWMR + * access to work. + */ + if(H5D_chunk_proxy_create(io_info->dset, io_info->dxpl_id, (H5D_chunk_common_ud_t *)udata, ent) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, NULL, "can't insert proxy for chunk in metadata cache") + } /* end if */ + } /* end if */ + else + /* We did not add the chunk to cache */ + ent = NULL; } /* end else */ + if(!ent) + /* + * The chunk cannot be placed in cache so we don't cache it. This is the + * reason all those arguments have to be repeated for the unlock + * function. + */ + udata->idx_hint = UINT_MAX; + /* Lock the chunk into the cache */ if(ent) { HDassert(!ent->locked); @@ -2936,9 +2950,6 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, chunk = ent->chunk; } /* end if */ - if(idx_hint) - *idx_hint = idx; - /* Set return value */ ret_value = chunk; @@ -2980,7 +2991,7 @@ done: */ herr_t H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, - hbool_t dirty, unsigned idx_hint, void *chunk, uint32_t naccessed) + hbool_t dirty, void *chunk, uint32_t naccessed) { const H5O_layout_t *layout = &(io_info->dset->shared->layout); /* Dataset layout */ const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); @@ -2991,7 +3002,7 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, HDassert(io_info); HDassert(udata); - if(UINT_MAX == idx_hint) { + if(UINT_MAX == udata->idx_hint) { /* * It's not in the cache, probably because it's too big. If it's * dirty then flush it to disk. In any case, free the chunk. @@ -3020,14 +3031,14 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */ /* Sanity check */ - HDassert(idx_hint < rdcc->nslots); - HDassert(rdcc->slot[idx_hint]); - HDassert(rdcc->slot[idx_hint]->chunk == chunk); + HDassert(udata->idx_hint < rdcc->nslots); + HDassert(rdcc->slot[udata->idx_hint]); + HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk); /* * It's in the cache so unlock it. */ - ent = rdcc->slot[idx_hint]; + ent = rdcc->slot[udata->idx_hint]; HDassert(ent->locked); if(dirty) { ent->dirty = TRUE; @@ -3211,6 +3222,9 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get simple dataspace info") space_dim[space_ndims] = layout->u.chunk.dim[space_ndims]; + /* The last dimension in chunk_offset is always 0 */ + chunk_offset[space_ndims] = (hsize_t)0; + /* Check if any space dimensions are 0, if so we do not have to do anything */ for(op_dim=0; op_dimnused > 0), - (H5MM_allocate_t)H5D_chunk_alloc, (void *)pline, - (H5MM_free_t)H5D_chunk_xfree, (void *)pline, + if(H5D_fill_init(&fb_info, NULL, (H5MM_allocate_t)H5D_chunk_alloc, + (void *)pline, (H5MM_free_t)H5D_chunk_xfree, (void *)pline, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, orig_chunk_size, data_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; - /* Check if there are filters which need to be applied to the chunk */ - /* (only do this in advance when the chunk info can be re-used (i.e. - * it doesn't contain any non-default VL datatype fill values) - */ - if(!fb_info.has_vlen_fill_type && pline->nused > 0) { - size_t buf_size = orig_chunk_size; + /* Check if there are filters which need to be applied to the chunk */ + /* (only do this in advance when the chunk info can be re-used (i.e. + * it doesn't contain any non-default VL datatype fill values) + */ + if(!fb_info.has_vlen_fill_type && pline->nused > 0) { + size_t buf_size = orig_chunk_size; - /* Push the chunk through the filters */ - if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &orig_chunk_size, &buf_size, &fb_info.fill_buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") + /* Push the chunk through the filters */ + if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &orig_chunk_size, &buf_size, &fb_info.fill_buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ if(orig_chunk_size > ((size_t)0xffffffff)) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ - } /* end if */ + } /* end if */ } /* end if */ /* Compose chunked index info struct */ @@ -3304,15 +3317,14 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; - /* Calculate the minimum and maximum chunk offsets in each dimension */ + /* Calculate the minimum and maximum chunk offsets in each dimension. Note + * that we assume here that all elements of space_dim are > 0. This is + * checked at the top of this function */ for(op_dim=0; op_dim max_unalloc[op_dim]) - carry = TRUE; + continue; else { /* Reset the chunk offset indices */ - HDmemset(chunk_offset, 0, (layout->u.chunk.ndims * sizeof(chunk_offset[0]))); + HDmemset(chunk_offset, 0, ((unsigned)space_ndims + * sizeof(chunk_offset[0]))); chunk_offset[op_dim] = min_unalloc[op_dim]; carry = FALSE; } /* end if */ while(!carry) { - size_t chunk_size; /* Size of chunk in bytes, possibly filtered */ + size_t chunk_size = orig_chunk_size; /* Size of chunk in bytes, possibly filtered */ #ifndef NDEBUG /* None of the chunks should be allocated */ - if(H5D_chunk_get_info(dset, dxpl_id, chunk_offset, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - HDassert(!H5F_addr_defined(udata.addr)); + { + hsize_t chunk_idx; + + /* Calculate the index of this chunk */ + if(H5V_chunk_index((unsigned)space_ndims, chunk_offset, + layout->u.chunk.dim, layout->u.chunk.down_chunks, + &chunk_idx) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") + + if(H5D_chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, + &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + + HDassert(!H5F_addr_defined(udata.addr)); + } /* end block */ + + /* Make sure the chunk is really in the dataset and outside the + * original dimensions */ + { + hbool_t outside_orig = FALSE; + for(i=0; i= old_dim[i]) + outside_orig = TRUE; + } /* end for */ + HDassert(outside_orig); + } /* end block */ #endif /* NDEBUG */ /* Check for VL datatype & non-default fill value */ @@ -3363,17 +3400,26 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, /* Sanity check */ HDassert(should_fill); + /* Check to make sure the buffer is large enough. It is + * possible (though ill-advised) for the filter to shrink the + * buffer. */ + if(fb_info.fill_buf_size < orig_chunk_size) { + if(NULL == (fb_info.fill_buf = H5D_chunk_realloc( + fb_info.fill_buf, orig_chunk_size, pline))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory reallocation failed for raw data chunk") + fb_info.fill_buf_size = orig_chunk_size; + } /* end if */ + /* Fill the buffer with VL datatype fill values */ if(H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, data_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") /* Check if there are filters which need to be applied to the chunk */ if(pline->nused > 0) { - size_t buf_size = orig_chunk_size; - size_t nbytes = fb_info.fill_buf_size; + size_t nbytes = orig_chunk_size; /* Push the chunk through the filters */ - if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &nbytes, &buf_size, &fb_info.fill_buf) < 0) + if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &nbytes, &fb_info.fill_buf_size, &fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 @@ -3385,11 +3431,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, /* Keep the number of bytes the chunk turned in to */ chunk_size = nbytes; } /* end if */ - else - H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); } /* end if */ - else - chunk_size = orig_chunk_size; /* Initialize the chunk information */ udata.common.layout = &layout->u.chunk; @@ -3431,10 +3473,6 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, #endif /* H5_HAVE_PARALLEL */ } /* end if */ - /* Release the fill buffer if we need to re-allocate it each time */ - if(fb_info_init && fb_info.has_vlen_fill_type && pline->nused > 0) - H5D_fill_release(&fb_info); - /* Increment indices */ carry = TRUE; for(i = (int)(space_ndims - 1); i >= 0; --i) { @@ -3452,8 +3490,8 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, } /* end while(!carry) */ /* Adjust max_unalloc_dim_idx so we don't allocate the same chunk twice. - * Also check if this dimension started from 0 (and hence allocated all - * of the chunks. */ + * Also check if this dimension started from 0 (and hence allocated all + * of the chunks. */ if(min_unalloc[op_dim] == 0) break; else @@ -3499,17 +3537,17 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata) +H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) { const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */ H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */ + const hsize_t *chunk_offset = io_info->store->chunk.offset; /* Chunk offset */ H5S_sel_iter_t chunk_iter; /* Memory selection iteration info */ hssize_t sel_nelmts; /* Number of elements in selection */ hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */ void *chunk; /* The file chunk */ - unsigned idx_hint; /* Which chunk we're dealing with */ H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ uint32_t bytes_accessed; /* Bytes accessed in chunk */ unsigned u; /* Local index variable */ @@ -3517,10 +3555,20 @@ H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_prune_fill) + /* Get the info for the chunk in the file */ + if(H5D_chunk_lookup(dset, io_info->dxpl_id, chunk_offset, + io_info->store->chunk.index, &chk_udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") + + /* If this chunk does not exist in cache or on disk, no need to do anything + */ + if(!H5F_addr_defined(chk_udata.addr) && UINT_MAX == chk_udata.idx_hint) + HGOTO_DONE(SUCCEED) + /* Initialize the fill value buffer, if necessary */ if(!udata->fb_info_init) { H5_CHECK_OVERFLOW(udata->elmts_per_chunk, uint32_t, size_t); - if(H5D_fill_init(&udata->fb_info, NULL, FALSE, NULL, NULL, NULL, NULL, + if(H5D_fill_init(&udata->fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)udata->elmts_per_chunk, io_info->dxpl_cache->max_temp_buf, io_info->dxpl_id) < 0) @@ -3530,7 +3578,8 @@ H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata /* Compute the # of elements to leave with existing value, in each dimension */ for(u = 0; u < rank; u++) { - count[u] = MIN(layout->u.chunk.dim[u], (udata->dims[u] - chunk_rec->offset[u])); + count[u] = MIN(layout->u.chunk.dim[u], (udata->space_dim[u] + - chunk_offset[u])); HDassert(count[u] > 0); } /* end for */ @@ -3542,20 +3591,8 @@ H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata if(H5S_select_hyperslab(udata->chunk_space, H5S_SELECT_NOTB, udata->hyper_start, NULL, count, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to select hyperslab") - /* Calculate the index of this chunk */ - if(H5V_chunk_index(rank, chunk_rec->offset, layout->u.chunk.dim, layout->u.chunk.down_chunks, &io_info->store->chunk.index) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") - /* Lock the chunk into the cache, to get a pointer to the chunk buffer */ - /* (Casting away const OK -QAK) */ - io_info->store->chunk.offset = (hsize_t *)chunk_rec->offset; - chk_udata.common.layout = &layout->u.chunk; - chk_udata.common.storage = &layout->storage.u.chunk; - chk_udata.common.offset = chunk_rec->offset; - chk_udata.nbytes = chunk_rec->nbytes; - chk_udata.filter_mask = chunk_rec->filter_mask; - chk_udata.addr = chunk_rec->chunk_addr; - if(NULL == (chunk = (void *)H5D_chunk_lock(udata->io_info, &chk_udata, FALSE, &idx_hint))) + if(NULL == (chunk = (void *)H5D_chunk_lock(io_info, &chk_udata, FALSE))) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to lock raw data chunk") @@ -3596,7 +3633,7 @@ H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata bytes_accessed = (uint32_t)sel_nelmts * layout->u.chunk.dim[rank]; /* Release lock on chunk */ - if(H5D_chunk_unlock(io_info, &chk_udata, TRUE, idx_hint, chunk, bytes_accessed) < 0) + if(H5D_chunk_unlock(io_info, &chk_udata, TRUE, chunk, bytes_accessed) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk") done: @@ -3605,82 +3642,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_prune_cb - * - * Purpose: Search for chunks that are no longer inside the pruned - * dataset's extent - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * March 26, 2002 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static int -H5D_chunk_prune_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) -{ - H5D_chunk_it_ud1_t *udata = (H5D_chunk_it_ud1_t *)_udata; /* User data */ - H5D_chunk_prune_stack_t *stack_node = NULL; /* Stack node for chunk to remove */ - unsigned rank; /* Current # of dimensions */ - hbool_t should_delete = FALSE; /* Whether the chunk should be deleted */ - hbool_t needs_fill = FALSE; /* Whether the chunk overlaps the new extent and needs fill valiues */ - unsigned u; /* Local index variable */ - int ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_prune_cb) - - /* Figure out what chunks are no longer in use for the specified extent and release them */ - rank = udata->common.layout->ndims - 1; - for(u = 0; u < rank; u++) - /* The chunk record points to a chunk of storage that contains the - * beginning of the logical address space represented by UDATA. - */ - if(udata->shrunk_dims[u]) { - if(chunk_rec->offset[u] >= udata->dims[u]) { - /* Indicate that the chunk will be deleted */ - should_delete = TRUE; - - /* Break out of loop, we know the chunk is outside the current dimensions */ - break; - } /* end if */ - /* Check for chunk that overlaps new extent and will need fill values */ - else if((chunk_rec->offset[u] + udata->common.layout->dim[u]) > udata->dims[u]) - /* Indicate that the chunk needs filling */ - /* (but continue in loop, since it could be outside the extent in - * another dimension -QAK) - */ - needs_fill = TRUE; - } /* end if */ - - /* Check for chunk to delete */ - if(should_delete) { - /* Allocate space for the removal stack node */ - if(NULL == (stack_node = H5FL_MALLOC(H5D_chunk_prune_stack_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for removal stack node") - - /* Store the record for the chunk */ - stack_node->rec = *chunk_rec; - - /* Push the chunk description onto the stack */ - stack_node->next = udata->rm_stack; - udata->rm_stack = stack_node; - } /* end if */ - /* Check for chunk that overlaps the new dataset dimensions and needs filling */ - else if(needs_fill) - /* Write the fill value */ - if(H5D_chunk_prune_fill(chunk_rec, udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write fill value") - -done: - /* It is currently impossible to fail after the stack node has been - * malloc'ed. No need to free it here on failure. */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_prune_cb() */ - - -/*------------------------------------------------------------------------- * Function: H5D_chunk_prune_by_extent * * Purpose: This function searches for chunks that are no longer necessary @@ -3777,11 +3738,26 @@ done: * To release the chunks, we traverse the B-tree to obtain a list of unused * allocated chunks, and then call H5B_remove() for each chunk. * + * Modifications: Neil Fortner + * 4 May 2010 + * Rewrote algorithm to work in a way similar to + * H5D_chunk_allocate: it now iterates over all chunks that need + * to be filled or removed, and does so as appropriate. This + * avoids various issues with coherency of locally cached data + * which could occur with the previous implementation. + * *------------------------------------------------------------------------- */ herr_t -H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) +H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) { + hsize_t min_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of first chunk to modify in each dimension */ + hsize_t max_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of last chunk to modify in each dimension */ + hssize_t max_fill_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of last chunk that might be filled in each dimension */ + hbool_t fill_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension needs to be filled */ + hbool_t dims_outside_fill[H5O_LAYOUT_NDIMS]; /* Dimensions in chunk offset outside fill dimensions */ + int ndims_outside_fill = 0; /* Number of dimensions in chunk offset outside fill dimensions */ + hbool_t has_fill = FALSE; /* Whether there are chunks that must be filled */ H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_io_info_t chk_io_info; /* Chunked I/O info object */ H5D_storage_t chk_store; /* Chunk storage information */ @@ -3789,21 +3765,22 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Cache entries */ - hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Current dataspace dimensions */ - hbool_t shrunk_dims[H5O_LAYOUT_NDIMS]; /* Dimensions which have shrunk */ + H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ + int space_ndims; /* Dataset's space rank */ + hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Current dataspace dimensions */ + int op_dim; /* Current operationg dimension */ + hbool_t shrunk_dim[H5O_LAYOUT_NDIMS]; /* Dimensions which have shrunk */ H5D_chunk_it_ud1_t udata; /* Chunk index iterator user data */ hbool_t udata_init = FALSE; /* Whether the chunk index iterator user data has been initialized */ - hbool_t needs_fill; /* Whether we need to write the fill value */ - H5D_chunk_prune_stack_t *fill_stack = NULL; /* Stack of chunks to fill */ - H5D_chunk_prune_stack_t *tmp_stack; /* Temporary stack node pointer */ H5D_chunk_common_ud_t idx_udata; /* User data for index removal routine */ + H5D_chunk_ud_t chk_udata; /* User data for getting chunk info */ H5S_t *chunk_space = NULL; /* Dataspace for a chunk */ - hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; /* Chunk dimensions */ + hsize_t chunk_dim[H5O_LAYOUT_NDIMS]; /* Chunk dimensions */ + hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */ hsize_t hyper_start[H5O_LAYOUT_NDIMS]; /* Starting location of hyperslab */ uint32_t elmts_per_chunk; /* Elements in chunk */ - unsigned rank; /* Current # of dimensions */ - unsigned u; /* Local index variable */ + hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ + int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5D_chunk_prune_by_extent, FAIL) @@ -3819,19 +3796,26 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) H5D_COPS_BTREE == layout->storage.u.chunk.ops)); HDassert(dxpl_cache); - /* set the removal stack pointer in udata to NULL, so if the function fails - * early it will not try to free the nonexistent stack */ - udata.rm_stack = NULL; - /* Fill the DXPL cache values for later use */ if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Go get the rank & dimensions (including the element size) */ - rank = layout->u.chunk.ndims - 1; - if(H5S_get_simple_extent_dims(dset->shared->space, curr_dims, NULL) < 0) + if((space_ndims = H5S_get_simple_extent_dims(dset->shared->space, space_dim, + NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") - curr_dims[rank] = layout->u.chunk.dim[rank]; + space_dim[space_ndims] = layout->u.chunk.dim[space_ndims]; + + /* The last dimension in chunk_offset is always 0 */ + chunk_offset[space_ndims] = (hsize_t)0; + + /* Check if any old dimensions are 0, if so we do not have to do anything */ + for(op_dim=0; op_dimshared->cache.chunk.last); + HGOTO_DONE(SUCCEED) + } /* end if */ /* Round up to the next integer # of chunks, to accomodate partial chunks */ /* Use current dims because the indices have already been updated! -NAF */ @@ -3839,22 +3823,25 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) /* (also copy the chunk dimensions into 'hsize_t' array for creating dataspace) */ /* (also compute the dimensions which have been shrunk) */ elmts_per_chunk = 1; - for(u = 0; u < rank; u++) { - elmts_per_chunk *= layout->u.chunk.dim[u]; - chunk_dims[u] = layout->u.chunk.dim[u]; - shrunk_dims[u] = curr_dims[u] < old_dims[u]; + for(i = 0; i < space_ndims; i++) { + elmts_per_chunk *= layout->u.chunk.dim[i]; + chunk_dim[i] = layout->u.chunk.dim[i]; + shrunk_dim[i] = space_dim[i] < old_dim[i]; } /* end for */ /* Create a dataspace for a chunk & set the extent */ - if(NULL == (chunk_space = H5S_create_simple(rank, chunk_dims, NULL))) + if(NULL == (chunk_space = H5S_create_simple((unsigned)space_ndims, + chunk_dim, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Reset hyperslab start array */ /* (hyperslabs will always start from origin) */ HDmemset(hyper_start, 0, sizeof(hyper_start)); - /* Set up chunked I/O info object, for operations on chunks (in callback) */ - /* (Casting away const OK -QAK) */ + /* Set up chunked I/O info object, for operations on chunks (in callback) + * Note that we only need to set chunk_offset once, as the array's address + * will never change. */ + chk_store.chunk.offset = chunk_offset; H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, dxpl_cache, dxpl_id, &chk_store, NULL); /* Compose chunked index info struct */ @@ -3870,91 +3857,197 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dims) udata.common.storage = &layout->storage.u.chunk; udata.io_info = &chk_io_info; udata.idx_info = &idx_info; - udata.dims = curr_dims; - udata.shrunk_dims = shrunk_dims; + udata.space_dim = space_dim; + udata.shrunk_dim = shrunk_dim; udata.elmts_per_chunk = elmts_per_chunk; udata.chunk_space = chunk_space; udata.hyper_start = hyper_start; udata_init = TRUE; - /*------------------------------------------------------------------------- - * Figure out what chunks are no longer in use for the specified extent - * and release them from the linked list raw data cache - *------------------------------------------------------------------------- - */ - for(ent = rdcc->head; ent; ent = next) { - /* Get pointer to next extry in cache, in case this one is evicted */ - next = ent->next; - - needs_fill = FALSE; - - /* Check for chunk offset outside of new dimensions */ - for(u = 0; u < rank; u++) { - if((hsize_t)ent->offset[u] >= curr_dims[u]) { - /* Evict the entry from the cache, but do not flush it to disk */ - if(H5D_chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + /* Initialize user data for removal */ + idx_udata.layout = &layout->u.chunk; + idx_udata.storage = &layout->storage.u.chunk; - /* We don't need to write the fill value */ - needs_fill = FALSE; + /* + * Determine the chunks which need to be filled or removed + */ + for(op_dim=0; op_dimchunk_addr) && shrunk_dims[u] - && (ent->offset[u] + chunk_dims[u]) > curr_dims[u]) - /* We need to write the fill value to the unused parts of chunk */ - needs_fill = TRUE; - } /* end for */ + /* Check the cache for any entries that are outside the bounds. Mark these + * entries as deleted so they are not flushed to disk accidentally. This is + * only necessary if there are chunks that need to be filled. */ + if(has_fill) + for(ent = rdcc->head; ent; ent = ent->next) + /* Check for chunk offset outside of new dimensions */ + for(i = 0; ioffset[i] >= space_dim[i]) { + /* Mark the entry as "deleted" */ + ent->deleted = TRUE; + break; + } /* end if */ - if(needs_fill) { - /* Allocate space for the stack node */ - if(NULL == (tmp_stack = H5FL_MALLOC(H5D_chunk_prune_stack_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for stack node") + /* Main loop: fill or remove chunks */ + for(op_dim=0; op_dim= min_mod_chunk_off[op_dim]); - /* Set up chunk record for fill routine */ - tmp_stack->rec.nbytes = dset->shared->layout.u.chunk.size; - HDmemcpy(tmp_stack->rec.offset, ent->offset, sizeof(tmp_stack->rec.offset)); - tmp_stack->rec.filter_mask = 0; /* Since the chunk is already in cache this doesn't matter */ - tmp_stack->rec.chunk_addr = ent->chunk_addr; + /* Reset the chunk offset indices */ + HDmemset(chunk_offset, 0, ((unsigned)space_ndims + * sizeof(chunk_offset[0]))); + chunk_offset[op_dim] = min_mod_chunk_off[op_dim]; + + /* Initialize "dims_outside_fill" array */ + ndims_outside_fill = 0; + for(i=0; i max_fill_chunk_off[i]) { + dims_outside_fill[i] = TRUE; + ndims_outside_fill++; + } /* end if */ + else + dims_outside_fill[i] = FALSE; - /* Push the chunk description onto the stack */ - tmp_stack->next = fill_stack; - fill_stack = tmp_stack; + carry = FALSE; } /* end if */ - } /* end for */ - /* Traverse the stack of chunks to be filled, filling each. We will free - * the nodes later in the "done" section. */ - tmp_stack = fill_stack; - while(tmp_stack) { - /* Write the fill value */ - if(H5D_chunk_prune_fill(&(tmp_stack->rec), &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write fill value") + while(!carry) { + /* Calculate the index of this chunk */ + if(H5V_chunk_index((unsigned)space_ndims, chunk_offset, + layout->u.chunk.dim, layout->u.chunk.down_chunks, + &(chk_io_info.store->chunk.index)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") + + if(0 == ndims_outside_fill) { + HDassert(fill_dim[op_dim]); + HDassert(chunk_offset[op_dim] == min_mod_chunk_off[op_dim]); + + /* Fill the unused parts of the chunk */ + if(H5D_chunk_prune_fill(&udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write fill value") + } /* end if */ + else { +#ifndef NDEBUG + /* Make sure this chunk is really outside the new dimensions */ + { + hbool_t outside_dim = FALSE; + + for(i=0; i= space_dim[i]){ + outside_dim = TRUE; + break; + } /* end if */ + HDassert(outside_dim); + } /* end block */ +#endif /* NDEBUG */ - /* Advance the stack pointer */ - tmp_stack = tmp_stack->next; - } /* end while */ + /* Check if the chunk exists in cache or on disk */ + if(H5D_chunk_lookup(dset, dxpl_id, chunk_offset, + chk_io_info.store->chunk.index, &chk_udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk") + + /* Evict the entry from the cache if present, but do not flush + * it to disk */ + if(UINT_MAX != chk_udata.idx_hint) { + if(H5D_chunk_cache_evict(dset, dxpl_id, dxpl_cache, + rdcc->slot[chk_udata.idx_hint], FALSE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") + } /* end if */ - /* Iterate over the chunks */ - if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D_chunk_prune_cb, &udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve prune chunks from index") + /* Remove the chunk from disk, if present */ + if(H5F_addr_defined(chk_udata.addr)) { + /* Update the offset in idx_udata */ + idx_udata.offset = chunk_offset; - /* Traverse the stack of chunks to be deleted, removing each. We will free - * the nodes later in the "done" section. */ - idx_udata.layout = &layout->u.chunk; - idx_udata.storage = &layout->storage.u.chunk; - tmp_stack = udata.rm_stack; - while(tmp_stack) { - /* Update the offset in idx_udata */ - idx_udata.offset = tmp_stack->rec.offset; + /* Remove the chunk from disk */ + if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) + < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry from index") + } /* end if */ + } /* end else */ - /* Remove the chunk from disk */ - if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry from index") + /* Increment indices */ + carry = TRUE; + for(i = (int)(space_ndims - 1); i >= 0; --i) { + chunk_offset[i] += chunk_dim[i]; + if(chunk_offset[i] > (hsize_t) max_mod_chunk_off[i]) { + /* Left maximum dimensions, "wrap around" and check if this + * dimension is no longer outside the fill dimension */ + if(i == op_dim) { + chunk_offset[i] = min_mod_chunk_off[i]; + if(dims_outside_fill[i] && fill_dim[i]) { + dims_outside_fill[i] = FALSE; + ndims_outside_fill--; + } /* end if */ + } /* end if */ + else { + chunk_offset[i] = 0; + if(dims_outside_fill[i] && max_fill_chunk_off[i] >= 0) { + dims_outside_fill[i] = FALSE; + ndims_outside_fill--; + } /* end if */ + } /* end else */ + } /* end if */ + else { + /* Check if we just went outside the fill dimension */ + if(!dims_outside_fill[i] && (hssize_t)chunk_offset[i] + > max_fill_chunk_off[i]) { + dims_outside_fill[i] = TRUE; + ndims_outside_fill++; + } /* end if */ + + /* We found the next chunk, so leave the loop */ + carry = FALSE; + break; + } /* end else */ + } /* end for */ + } /* end while(!carry) */ - /* Advance the stack pointer */ - tmp_stack = tmp_stack->next; - } /* end while */ + /* Adjust max_mod_chunk_off so we don't modify the same chunk twice. + * Also check if this dimension started from 0 (and hence removed all + * of the chunks). */ + if(min_mod_chunk_off[op_dim] == 0) + break; + else + max_mod_chunk_off[op_dim] = min_mod_chunk_off[op_dim] + - chunk_dim[op_dim]; + } /* end for(op_dim=0...) */ /* Reset any cached chunk info for this dataset */ H5D_chunk_cinfo_cache_reset(&dset->shared->cache.chunk.last); @@ -3968,24 +4061,6 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") } /* end if */ - /* Free stack of filled chunks */ - tmp_stack = fill_stack; - while(tmp_stack) { - /* Free the stack node and advance the stack pointer */ - tmp_stack = tmp_stack->next; - fill_stack = H5FL_FREE(H5D_chunk_prune_stack_t, fill_stack); - fill_stack = tmp_stack; - } /* end while */ - - /* Free stack of removed chunks */ - tmp_stack = udata.rm_stack; - while(tmp_stack) { - /* Free the stack node and advance the stack pointer */ - tmp_stack = tmp_stack->next; - udata.rm_stack = H5FL_FREE(H5D_chunk_prune_stack_t, udata.rm_stack); - udata.rm_stack = tmp_stack; - } /* end while */ - FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_chunk_prune_by_extent() */ @@ -5048,8 +5123,7 @@ H5D_nonexistent_readvv(const H5D_io_info_t *io_info, buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[u]; /* Initialize the fill value buffer */ - if(H5D_fill_init(&fb_info, buf, FALSE, - NULL, NULL, NULL, NULL, + if(H5D_fill_init(&fb_info, buf, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, size, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index b12eb3d..f0929d9 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -134,7 +134,7 @@ H5D_compact_fill(H5D_t *dset, hid_t dxpl_id) /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ - if(H5D_fill_init(&fb_info, dset->shared->layout.storage.u.compact.buf, FALSE, + if(H5D_fill_init(&fb_info, dset->shared->layout.storage.u.compact.buf, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, dset->shared->layout.storage.u.compact.size, dxpl_id) < 0) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 567f4c9..b674f44 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -222,7 +222,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) H5_ASSIGN_OVERFLOW(npoints, snpoints, hssize_t, size_t); /* Initialize the fill value buffer */ - if(H5D_fill_init(&fb_info, NULL, FALSE, NULL, NULL, NULL, NULL, + if(H5D_fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, npoints, dxpl_cache->max_temp_buf, my_dxpl_id) < 0) diff --git a/src/H5Dfill.c b/src/H5Dfill.c index f418a81..1929a5a 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -363,7 +363,6 @@ done: */ herr_t H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, - hbool_t alloc_vl_during_refill, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, @@ -386,7 +385,6 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, fb_info->fill = fill; fb_info->file_type = dset_type; fb_info->file_tid = dset_type_id; - fb_info->alloc_vl_during_refill = alloc_vl_during_refill; fb_info->fill_alloc_func = alloc_func; fb_info->fill_alloc_info = alloc_info; fb_info->fill_free_func = free_func; @@ -434,16 +432,12 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, fb_info->use_caller_fill_buf = TRUE; } /* end if */ else { - if(alloc_vl_during_refill) - fb_info->fill_buf = NULL; - else { - if(alloc_func) - fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); - else - fb_info->fill_buf = H5FL_BLK_MALLOC(non_zero_fill, fb_info->fill_buf_size); - if(NULL == fb_info->fill_buf) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer") - } /* end else */ + if(alloc_func) + fb_info->fill_buf = alloc_func(fb_info->fill_buf_size, alloc_info); + else + fb_info->fill_buf = H5FL_BLK_MALLOC(non_zero_fill, fb_info->fill_buf_size); + if(NULL == fb_info->fill_buf) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer") } /* end else */ /* Get the datatype conversion path for this operation */ @@ -570,22 +564,14 @@ herr_t H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ + void * buf = NULL; /* Temporary fill buffer */ FUNC_ENTER_NOAPI(H5D_fill_refill_vl, FAIL) /* Check args */ HDassert(fb_info); HDassert(fb_info->has_vlen_fill_type); - - /* Check if we should allocate the fill buffer now */ - if(fb_info->alloc_vl_during_refill) { - if(fb_info->fill_alloc_func) - fb_info->fill_buf = fb_info->fill_alloc_func(fb_info->fill_buf_size, fb_info->fill_alloc_info); - else - fb_info->fill_buf = H5FL_BLK_MALLOC(non_zero_fill, fb_info->fill_buf_size); - if(NULL == fb_info->fill_buf) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer") - } /* end if */ + HDassert(fb_info->fill_buf); /* Make a copy of the (disk-based) fill value into the buffer */ HDmemcpy(fb_info->fill_buf, fb_info->fill->buf, fb_info->file_elmt_size); @@ -605,11 +591,32 @@ H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) if(H5T_path_bkg(fb_info->mem_to_dset_tpath)) HDmemset(fb_info->bkg_buf, 0, fb_info->bkg_buf_size); + /* Make a copy of the fill buffer so we can free dynamic elements after conversion */ + if(fb_info->fill_alloc_func) + buf = fb_info->fill_alloc_func(fb_info->fill_buf_size, fb_info->fill_alloc_info); + else + buf = H5FL_BLK_MALLOC(non_zero_fill, fb_info->fill_buf_size); + HDmemcpy(buf, fb_info->fill_buf, fb_info->fill_buf_size); + /* Type convert the dataset buffer, to copy any VL components */ if(H5T_convert(fb_info->mem_to_dset_tpath, fb_info->mem_tid, fb_info->file_tid, nelmts, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") done: + if (buf) { + /* Free dynamically allocated VL elements in fill buffer */ + if (fb_info->fill->type) + H5T_vlen_reclaim_elmt(buf, fb_info->fill->type, dxpl_id); + else + H5T_vlen_reclaim_elmt(buf, fb_info->mem_type, dxpl_id); + + /* Free temporary fill buffer */ + if(fb_info->fill_free_func) + fb_info->fill_free_func(buf, fb_info->fill_free_info); + else + buf = H5FL_BLK_FREE(non_zero_fill, buf); + } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_fill_refill_vl() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 3157e66..032006f 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2308,10 +2308,10 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) */ if(shrink && H5D_CHUNKED == dset->shared->layout.type && (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { - /* Remove excess chunks */ - if(H5D_chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks ") - } /* end if */ + /* Remove excess chunks */ + if(H5D_chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks") + } /* end if */ /* Mark the dataspace as dirty, for later writing to the file */ dset->shared->space_dirty = TRUE; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index fb0c1f4..ad9b737 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -861,7 +861,8 @@ H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type HDmemset(coords, 0, sizeof(coords)); /* Look up address of chunk */ - if(H5D_chunk_get_info(io_info->dset, io_info->dxpl_id, coords, &udata) < 0) + if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, coords, + io_info->store->chunk.index, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") ctg_store.contig.dset_addr = udata.addr; @@ -1212,7 +1213,6 @@ if(H5DEBUG(D)) H5D_chunk_ud_t udata; /* B-tree pass-through */ void *chunk; /* Pointer to the data chunk in cache */ uint32_t accessed_bytes; /* Total accessed size in a chunk */ - unsigned idx_hint = 0; /* Cache index hint */ htri_t cacheable; /* Whether the chunk is cacheable */ /* Switch to independent I/O */ @@ -1225,7 +1225,8 @@ if(H5DEBUG(D)) /* Load the chunk into cache. But if the whole chunk is written, * simply allocate space instead of load the chunk. */ - if(H5D_chunk_get_info(io_info->dset, io_info->dxpl_id, chunk_info->coords, &udata) < 0) + if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, + chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") /* Load the chunk into cache and lock it. */ @@ -1244,7 +1245,7 @@ if(H5DEBUG(D)) entire_chunk = FALSE; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk, &idx_hint))) + if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1276,7 +1277,7 @@ if(H5DEBUG(D)) } /* end else */ /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0) + if(chunk && H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), chunk, accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ #else /* !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) */ @@ -1441,7 +1442,8 @@ if(H5DEBUG(D)) { #endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ /* Retrieve the chunk's address */ - if(H5D_chunk_get_info(io_info->dset, io_info->dxpl_id, chunk_info->coords, &udata) < 0) + if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, + chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") /* Independent I/O */ @@ -1449,7 +1451,6 @@ if(H5DEBUG(D)) { void *chunk; /* Pointer to the data chunk in cache */ H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ uint32_t accessed_bytes = 0; /* Total accessed size in a chunk */ - unsigned idx_hint = 0; /* Cache index hint */ htri_t cacheable; /* Whether the chunk is cacheable */ /* Switch to independent I/O */ @@ -1472,7 +1473,7 @@ if(H5DEBUG(D)) { entire_chunk = FALSE; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk, &idx_hint))) + if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1505,7 +1506,7 @@ if(H5DEBUG(D)) { /* Release the cache lock on the chunk. */ if(chunk) - if(H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0) + if(H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), chunk, accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ else { /*collective I/O */ @@ -1755,7 +1756,8 @@ if(H5DEBUG(D)) H5D_chunk_ud_t udata; /* User data for querying chunk info */ /* Get address of chunk */ - if(H5D_chunk_get_info(io_info->dset, io_info->dxpl_id, chunk_info->coords, &udata) < 0) + if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, + chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") chunk_addr = udata.addr; } /* end if */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 0788637..d5a7e45 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -272,6 +272,7 @@ typedef struct H5D_chunk_ud_t { H5D_chunk_common_ud_t common; /* Common info for B-tree user data (must be first) */ /* Upward */ + unsigned idx_hint; /*index of chunk in cache, if present */ uint32_t nbytes; /*size of stored data */ unsigned filter_mask; /*excluded filters */ haddr_t addr; /*file address of chunk */ @@ -471,7 +472,6 @@ typedef struct { /* Typedef for filling a buffer with a fill value */ typedef struct H5D_fill_buf_info_t { - hbool_t alloc_vl_during_refill; /* Whether to allocate VL-datatype fill buffer during refill */ H5MM_allocate_t fill_alloc_func; /* Routine to call for allocating fill buffer */ void *fill_alloc_info; /* Extra info for allocation routine */ H5MM_free_t fill_free_func; /* Routine to call for freeing fill buffer */ @@ -509,6 +509,7 @@ typedef struct { typedef struct H5D_rdcc_ent_t { hbool_t locked; /*entry is locked in cache */ hbool_t dirty; /*needs to be written to disk? */ + hbool_t deleted; /*chunk about to be deleted (do not flush) */ hsize_t offset[H5O_LAYOUT_NDIMS]; /*chunk name */ uint32_t rd_count; /*bytes remaining to be read */ uint32_t wr_count; /*bytes remaining to be written */ @@ -636,12 +637,12 @@ H5_DLL herr_t H5D_chunk_set_info(const H5D_t *dset); H5_DLL herr_t H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); H5_DLL hbool_t H5D_chunk_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D_chunk_get_info(const H5D_t *dset, hid_t dxpl_id, - const hsize_t *chunk_offset, H5D_chunk_ud_t *udata); +H5_DLL herr_t H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, + const hsize_t *chunk_offset, hsize_t chunk_idx, H5D_chunk_ud_t *udata); H5_DLL void *H5D_chunk_lock(const H5D_io_info_t *io_info, - H5D_chunk_ud_t *udata, hbool_t relax, unsigned *idx_hint/*in,out*/); + H5D_chunk_ud_t *udata, hbool_t relax); H5_DLL herr_t H5D_chunk_unlock(const H5D_io_info_t *io_info, - const H5D_chunk_ud_t *udata, hbool_t dirty, unsigned idx_hint, void *chunk, + const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); H5_DLL herr_t H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset); @@ -649,7 +650,7 @@ H5_DLL herr_t H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); H5_DLL herr_t H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, - const hsize_t *old_dims); + const hsize_t *old_dim); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]); #endif /* H5_HAVE_PARALLEL */ @@ -681,7 +682,6 @@ H5_DLL herr_t H5D_efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, H5_DLL herr_t H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id); H5_DLL herr_t H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, - hbool_t alloc_vl_during_refill, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, diff --git a/src/H5Dproxy.c b/src/H5Dproxy.c index 6d4311c..8a94402 100644 --- a/src/H5Dproxy.c +++ b/src/H5Dproxy.c @@ -486,7 +486,7 @@ HDfprintf(stderr, "%s: ent->proxy_addr = %a, dirty = %t\n", FUNC, ent->proxy_add /* Check whether to mark the proxy as dirty */ if(dirty) { - if(H5AC_mark_pinned_or_protected_entry_dirty(ent->proxy) < 0) + if(H5AC_mark_entry_dirty(ent->proxy) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTMARKDIRTY, FAIL, "can't mark chunk proxy entry in metadata cache as dirty") } /* end if */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 1f6c79c..a7f12a5 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -604,7 +604,7 @@ H5EA__hdr_modified(H5EA_hdr_t *hdr)) HDassert(hdr->f); /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) + if(H5AC_mark_entry_dirty(hdr) < 0) H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark extensible array header as dirty") CATCH diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 753031d..887c2bb 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -108,6 +108,7 @@ hid_t H5E_CANTDELETE_g = FAIL; /* Can't delete message */ hid_t H5E_BADITER_g = FAIL; /* Iteration failed */ hid_t H5E_CANTPACK_g = FAIL; /* Can't pack messages */ hid_t H5E_CANTRESET_g = FAIL; /* Can't reset object */ +hid_t H5E_CANTRENAME_g = FAIL; /* Unable to rename object */ /* System level errors */ hid_t H5E_SYSERRSTR_g = FAIL; /* System error message */ @@ -157,7 +158,6 @@ hid_t H5E_PROTECT_g = FAIL; /* Protected metadata error */ hid_t H5E_NOTCACHED_g = FAIL; /* Metadata not currently cached */ hid_t H5E_SYSTEM_g = FAIL; /* Internal error detected */ hid_t H5E_CANTINS_g = FAIL; /* Unable to insert metadata into cache */ -hid_t H5E_CANTRENAME_g = FAIL; /* Unable to rename metadata */ hid_t H5E_CANTPROTECT_g = FAIL; /* Unable to protect metadata */ hid_t H5E_CANTUNPROTECT_g = FAIL; /* Unable to unprotect metadata */ hid_t H5E_CANTPIN_g = FAIL; /* Unable to pin cache entry */ @@ -174,7 +174,7 @@ hid_t H5E_CANTNOTIFY_g = FAIL; /* Unable to notify object about action hid_t H5E_TRAVERSE_g = FAIL; /* Link traversal failure */ hid_t H5E_NLINKS_g = FAIL; /* Too many soft links in path */ hid_t H5E_NOTREGISTERED_g = FAIL; /* Link class not registered */ -hid_t H5E_CANTMOVE_g = FAIL; /* Move callback returned error */ +hid_t H5E_CANTMOVE_g = FAIL; /* Can't move object */ hid_t H5E_CANTSORT_g = FAIL; /* Can't sort objects */ /* Parallel MPI errors */ diff --git a/src/H5Einit.h b/src/H5Einit.h index a8ccedc..802c94a 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -398,6 +398,11 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't reset object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_CANTRESET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_CANTRENAME_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* System level errors */ assert(H5E_SYSERRSTR_g==(-1)); @@ -587,11 +592,6 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert metadata into cache") HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_CANTINS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -assert(H5E_CANTRENAME_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename metadata"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTPROTECT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to protect metadata"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") @@ -665,7 +665,7 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Link class not registered"))==NULL) if((H5E_NOTREGISTERED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTMOVE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Move callback returned error"))==NULL) +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_CANTMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index d793096..f6a20f2 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -176,6 +176,7 @@ H5_DLLVAR hid_t H5E_CANTSHRINK_g; /* Can't shrink container */ #define H5E_BADITER (H5OPEN H5E_BADITER_g) #define H5E_CANTPACK (H5OPEN H5E_CANTPACK_g) #define H5E_CANTRESET (H5OPEN H5E_CANTRESET_g) +#define H5E_CANTRENAME (H5OPEN H5E_CANTRENAME_g) H5_DLLVAR hid_t H5E_LINKCOUNT_g; /* Bad object header link count */ H5_DLLVAR hid_t H5E_VERSION_g; /* Wrong version number */ H5_DLLVAR hid_t H5E_ALIGNMENT_g; /* Alignment error */ @@ -184,6 +185,7 @@ H5_DLLVAR hid_t H5E_CANTDELETE_g; /* Can't delete message */ H5_DLLVAR hid_t H5E_BADITER_g; /* Iteration failed */ H5_DLLVAR hid_t H5E_CANTPACK_g; /* Can't pack messages */ H5_DLLVAR hid_t H5E_CANTRESET_g; /* Can't reset object */ +H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename object */ /* System level errors */ #define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) @@ -260,7 +262,6 @@ H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ #define H5E_NOTCACHED (H5OPEN H5E_NOTCACHED_g) #define H5E_SYSTEM (H5OPEN H5E_SYSTEM_g) #define H5E_CANTINS (H5OPEN H5E_CANTINS_g) -#define H5E_CANTRENAME (H5OPEN H5E_CANTRENAME_g) #define H5E_CANTPROTECT (H5OPEN H5E_CANTPROTECT_g) #define H5E_CANTUNPROTECT (H5OPEN H5E_CANTUNPROTECT_g) #define H5E_CANTPIN (H5OPEN H5E_CANTPIN_g) @@ -280,7 +281,6 @@ H5_DLLVAR hid_t H5E_PROTECT_g; /* Protected metadata error */ H5_DLLVAR hid_t H5E_NOTCACHED_g; /* Metadata not currently cached */ H5_DLLVAR hid_t H5E_SYSTEM_g; /* Internal error detected */ H5_DLLVAR hid_t H5E_CANTINS_g; /* Unable to insert metadata into cache */ -H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename metadata */ H5_DLLVAR hid_t H5E_CANTPROTECT_g; /* Unable to protect metadata */ H5_DLLVAR hid_t H5E_CANTUNPROTECT_g; /* Unable to unprotect metadata */ H5_DLLVAR hid_t H5E_CANTPIN_g; /* Unable to pin cache entry */ @@ -302,7 +302,7 @@ H5_DLLVAR hid_t H5E_CANTNOTIFY_g; /* Unable to notify object about action */ H5_DLLVAR hid_t H5E_TRAVERSE_g; /* Link traversal failure */ H5_DLLVAR hid_t H5E_NLINKS_g; /* Too many soft links in path */ H5_DLLVAR hid_t H5E_NOTREGISTERED_g; /* Link class not registered */ -H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Move callback returned error */ +H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Can't move object */ H5_DLLVAR hid_t H5E_CANTSORT_g; /* Can't sort objects */ /* Parallel MPI errors */ diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 8f9db90..921b3b6 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -109,7 +109,8 @@ H5E_BADMESG_g= H5E_CANTDELETE_g= H5E_BADITER_g= H5E_CANTPACK_g= -H5E_CANTRESET_g= +H5E_CANTRESET_g= +H5E_CANTRENAME_g= /* System level errors */ H5E_SYSERRSTR_g= @@ -159,7 +160,6 @@ H5E_PROTECT_g= H5E_NOTCACHED_g= H5E_SYSTEM_g= H5E_CANTINS_g= -H5E_CANTRENAME_g= H5E_CANTPROTECT_g= H5E_CANTUNPROTECT_g= H5E_CANTPIN_g= diff --git a/src/H5F.c b/src/H5F.c index e0d1127..a7f6aa8 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -930,7 +930,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) * The cache might be created with a different number of elements and * the access property list should be updated to reflect that. */ - if(SUCCEED != H5AC_create(f, &(f->shared->mdc_initCacheCfg))) + if(H5AC_create(f, &(f->shared->mdc_initCacheCfg)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create metadata cache") /* Create the file's "open object" information */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 644b4c9..5cfba0d 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -384,7 +384,7 @@ H5FA__hdr_modified(H5FA_hdr_t *hdr)) HDassert(hdr); /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) + if(H5AC_mark_entry_dirty(hdr) < 0) H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark fixed array header as dirty") CATCH diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 9928cf9..40befaf 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -1037,6 +1037,9 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) HFILE filehandle; /* Windows file handle */ LARGE_INTEGER li; /* 64-bit integer for SetFilePointer() call */ + /* Reset seek offset to beginning of file, so that file isn't re-extended later */ + rewind(file->fp); + /* Map the posix file handle to a Windows file handle */ filehandle = _get_osfhandle(fd); diff --git a/src/H5FS.c b/src/H5FS.c index 88a17b7..27111a2 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -123,7 +123,7 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl /* * Allocate free space structure */ - if(NULL == (fspace = H5FS_new(nclasses, classes, cls_init_udata))) + if(NULL == (fspace = H5FS_new(f, nclasses, classes, cls_init_udata))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space free list") /* Initialize creation information for free space manager */ @@ -139,7 +139,7 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl /* Check if the free space tracker is supposed to be persistant */ if(fs_addr) { /* Allocate space for the free space header */ - if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)H5FS_HEADER_SIZE(f)))) + if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)fspace->hdr_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "file allocation failed for free space header") /* Cache the new free space header (pinned) */ @@ -213,6 +213,7 @@ HDfprintf(stderr, "%s: Opening free space manager, fs_addr = %a, nclasses = %Zu\ cache_udata.nclasses = nclasses; cache_udata.classes = classes; cache_udata.cls_init_udata = cls_init_udata; + 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))) @@ -281,6 +282,7 @@ HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = %a\n", FUNC, fs_ad cache_udata.nclasses = 0; cache_udata.classes = NULL; cache_udata.cls_init_udata = NULL; + 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_WRITE))) @@ -390,7 +392,7 @@ HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC); fspace->alloc_sect_size = (size_t)fspace->sect_size; /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ } /* end if */ @@ -447,7 +449,7 @@ HDfprintf(stderr, "%s: Section info went 'go away'\n", FUNC); fspace->alloc_sect_size = 0; /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end else */ } /* end if */ @@ -463,7 +465,7 @@ HDfprintf(stderr, "%s: Section info is NOT for file free space\n", FUNC); fspace->alloc_sect_size = 0; /* Mark free space header as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") /* Free previous serialized sections disk space */ @@ -513,7 +515,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_va *------------------------------------------------------------------------- */ H5FS_t * -H5FS_new(size_t nclasses, const H5FS_section_class_t *classes[], +H5FS_new(const H5F_t *f, size_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata) { H5FS_t *fspace = NULL; /* Free space manager */ @@ -558,6 +560,7 @@ H5FS_new(size_t nclasses, const H5FS_section_class_t *classes[], /* Initialize non-zero information for new free space manager */ fspace->addr = HADDR_UNDEF; + fspace->hdr_size = H5FS_HEADER_SIZE(f); fspace->sect_addr = HADDR_UNDEF; /* Set return value */ @@ -604,7 +607,7 @@ H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size) HDassert(meta_size); /* Get the free space size info */ - *meta_size += H5FS_HEADER_SIZE(f) + (fspace->sinfo ? fspace->sect_size : fspace->alloc_sect_size); + *meta_size += fspace->hdr_size + (fspace->sinfo ? fspace->sect_size : fspace->alloc_sect_size); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FS_size() */ @@ -728,7 +731,7 @@ HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC); /* Check if the free space manager is persistant */ if(H5F_addr_defined(fspace->addr)) /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(fspace) < 0) + if(H5AC_mark_entry_dirty(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") done: diff --git a/src/H5FScache.c b/src/H5FScache.c index c0700df..17f8f6a 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -151,7 +151,6 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) { H5FS_t *fspace = NULL; /* Free space header info */ H5FS_hdr_cache_ud_t *udata = (H5FS_hdr_cache_ud_t *)_udata; /* user data for callback */ - size_t size; /* Header size */ 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 */ @@ -165,29 +164,25 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Check arguments */ HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(udata); /* Allocate a new free space manager */ - if(NULL == (fspace = H5FS_new(udata->nclasses, udata->classes, udata->cls_init_udata))) + if(NULL == (fspace = H5FS_new(udata->f, udata->nclasses, udata->classes, udata->cls_init_udata))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set free space manager's internal information */ - fspace->addr = addr; + 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") - /* Compute the size of the free space header on disk */ - size = (size_t)H5FS_HEADER_SIZE(udata->f); - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = (uint8_t *)H5WB_actual(wb, size))) + 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, size, dxpl_id, hdr) < 0) + 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; @@ -251,7 +246,7 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Metadata checksum */ UINT32DECODE(p, stored_chksum); - HDassert((size_t)(p - (const uint8_t *)hdr) == size); + HDassert((size_t)(p - (const uint8_t *)hdr) == fspace->hdr_size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -342,17 +337,13 @@ H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5F uint8_t *hdr; /* Pointer to header buffer */ uint8_t *p; /* Pointer into raw data buffer */ uint32_t metadata_chksum; /* Computed metadata checksum value */ - size_t size; /* Header size on disk */ /* 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") - /* Compute the size of the free space header on disk */ - size = (size_t)H5FS_HEADER_SIZE(f); - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = (uint8_t *)H5WB_actual(wb, size))) + if(NULL == (hdr = (uint8_t *)H5WB_actual(wb, fspace->hdr_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "can't get actual buffer") /* Get temporary pointer to header */ @@ -411,8 +402,8 @@ H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5F UINT32ENCODE(p, metadata_chksum); /* Write the free space header. */ - HDassert((size_t)(p - hdr) == size); - if(H5F_block_write(f, H5FD_MEM_FSPACE_HDR, addr, size, dxpl_id, hdr) < 0) + 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") fspace->cache_info.is_dirty = FALSE; @@ -467,7 +458,7 @@ H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace) /* 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)H5FS_HEADER_SIZE(f)) < 0) + 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 */ @@ -533,7 +524,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_hdr_size(const H5F_t *f, const H5FS_t UNUSED *fspace, size_t *size_ptr) +H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_hdr_size) @@ -543,7 +534,7 @@ H5FS_cache_hdr_size(const H5F_t *f, const H5FS_t UNUSED *fspace, size_t *size_pt HDassert(size_ptr); /* Set size value */ - *size_ptr = (size_t)H5FS_HEADER_SIZE(f); + *size_ptr = fspace->hdr_size; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FS_cache_hdr_size() */ @@ -580,17 +571,12 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Check arguments */ HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(udata); /* 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") - /* Sanity check address */ - if(H5F_addr_ne(addr, udata->fspace->sect_addr)) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "incorrect address for free space sections") - /* Allocate space for the buffer to serialize the sections into */ H5_ASSIGN_OVERFLOW(/* To: */ old_sect_size, /* From: */ udata->fspace->sect_size, /* From: */ hsize_t, /* To: */ size_t); if(NULL == (buf = H5FL_BLK_MALLOC(sect_block, (size_t)udata->fspace->sect_size))) diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index 098c25d..9be363e 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -116,6 +116,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int cache_udata.nclasses = 0; cache_udata.classes = NULL; cache_udata.cls_init_udata = NULL; + cache_udata.addr = addr; /* * Load the free space header. @@ -257,6 +258,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, int cache_udata.nclasses = 0; cache_udata.classes = NULL; cache_udata.cls_init_udata = NULL; + cache_udata.addr = fs_addr; /* * Load the free space header. diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 2b0eab4..e22e411 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -99,6 +99,7 @@ typedef struct H5FS_hdr_cache_ud_t { size_t nclasses; /* Number of section classes */ const H5FS_section_class_t **classes; /* Array of section class info */ void *cls_init_udata; /* Pointer to class init user data */ + haddr_t addr; /* Address of header */ } H5FS_hdr_cache_ud_t; /* Callback info for loading free space section info into the cache */ @@ -176,6 +177,7 @@ struct H5FS_t { /* Computed/cached values */ unsigned rc; /* Count of outstanding references to struct */ haddr_t addr; /* Address of free space header on disk */ + size_t hdr_size; /* Size of free space header on disk */ H5FS_sinfo_t *sinfo; /* Section information */ unsigned sinfo_lock_count; /* # of times the section info has been locked */ hbool_t sinfo_protected; /* Whether the section info was protected when locked */ @@ -219,8 +221,8 @@ H5FL_EXTERN(H5FS_t); /******************************/ /* Free space manager header routines */ -H5_DLL H5FS_t *H5FS_new(size_t nclasses, const H5FS_section_class_t *classes[], - void *cls_init_udata); +H5_DLL H5FS_t *H5FS_new(const H5F_t *f, size_t nclasses, + const H5FS_section_class_t *classes[], void *cls_init_udata); H5_DLL herr_t H5FS_incr(H5FS_t *fspace); H5_DLL herr_t H5FS_decr(H5FS_t *fspace); H5_DLL herr_t H5FS_dirty(H5FS_t *fspace); diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 68f6840..9fb34df 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -368,7 +368,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" /* Check if the section info size in the file has changed */ if(fspace->sect_size != fspace->alloc_sect_size) - cache_flags |= H5AC__SIZE_CHANGED_FLAG | H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG; + cache_flags |= H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG; } /* end if */ /* Sanity check */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 71d9fef..c9e83cc 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -22,7 +22,6 @@ /* Public header files needed by this file */ #include "H5public.h" #include "H5ACpublic.h" -#include "H5Cpublic.h" #include "H5Ipublic.h" /* When this header is included from a private header, don't make calls to H5check() */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 8a81e66..fd8c692 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -588,11 +588,15 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id) /* Check for non-default free space settings */ if(f->shared->fs_strategy != H5F_FILE_SPACE_STRATEGY_DEF || f->shared->fs_threshold != H5F_FREE_SPACE_THRESHOLD_DEF) { - H5O_fsinfo_t fsinfo; /* Free space manager info message */ + H5FD_mem_t type; /* Memory type for iteration */ + H5O_fsinfo_t fsinfo; /* Free space manager info message */ /* Write free-space manager info message to superblock extension object header if needed */ fsinfo.strategy = f->shared->fs_strategy; fsinfo.threshold = f->shared->fs_threshold; + for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) + fsinfo.fs_addr[type-1] = HADDR_UNDEF; + if(H5O_msg_create(&ext_loc, H5O_FSINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &fsinfo, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update free-space info header message") } /* end if */ @@ -657,7 +661,7 @@ H5F_super_dirty(H5F_t *f) HDassert(f->shared->sblock); /* Mark superblock dirty in cache, so change to EOA will get encoded */ - if(H5AC_mark_pinned_or_protected_entry_dirty(f->shared->sblock) < 0) + if(H5AC_mark_entry_dirty(f->shared->sblock) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") done: @@ -821,7 +825,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_ done: /* Mark superblock dirty in cache, if necessary */ if(sblock_dirty) - if(H5AC_mark_pinned_or_protected_entry_dirty(f->shared->sblock) < 0) + if(H5AC_mark_entry_dirty(f->shared->sblock) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 98052e1..ff758c4 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -124,7 +124,6 @@ static H5G_node_t * H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) { H5G_node_t *sym = NULL; - size_t size; 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 */ @@ -144,19 +143,23 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) * Initialize variables. */ + /* Allocate symbol table data structures */ + if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + sym->node_size = H5G_NODE_SIZE(f); + 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") - /* Compute the size of the serialized symbol table node on disk */ - size = H5G_node_size_real(f); - /* Get a pointer to a buffer that's large enough for node */ - if(NULL == (node = (uint8_t *)H5WB_actual(wb, size))) + 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, size, dxpl_id, node) < 0) + 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 */ @@ -174,12 +177,6 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* reserved */ p++; - /* Allocate symbol table data structures */ - if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - 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") - /* number of symbols */ UINT16DECODE(p, sym->nsyms); @@ -237,17 +234,13 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_ if(sym->cache_info.is_dirty) { uint8_t *node; /* Pointer to node buffer */ uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* 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") - /* Compute the size of the serialized symbol table node on disk */ - size = H5G_node_size_real(f); - /* Get a pointer to a buffer that's large enough for node */ - if(NULL == (node = (uint8_t *)H5WB_actual(wb, size))) + 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 */ @@ -269,10 +262,10 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_ /* 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, size - (size_t)(p - node)); + 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, size, dxpl_id, node) < 0) + 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 */ @@ -332,7 +325,7 @@ H5G_node_dest(H5F_t *f, H5G_node_t *sym) 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)H5G_node_size_real(f)) < 0) + 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 */ @@ -401,7 +394,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_size(const H5F_t *f, const H5G_node_t UNUSED *sym, size_t *size_ptr) +H5G_node_size(const H5F_t UNUSED *f, const H5G_node_t *sym, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_size) @@ -411,7 +404,7 @@ H5G_node_size(const H5F_t *f, const H5G_node_t UNUSED *sym, size_t *size_ptr) HDassert(f); HDassert(size_ptr); - *size_ptr = H5G_node_size_real(f); + *size_ptr = sym->node_size; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5G_node_size() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 97353af..ef38380 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -55,8 +55,6 @@ typedef struct H5G_node_key_t { /* Private macros */ -#define H5G_NODE_SIZEOF_HDR(F) (H5_SIZEOF_MAGIC + 4) - /* PRIVATE PROTOTYPES */ /* B-tree callbacks */ @@ -238,31 +236,6 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, /*------------------------------------------------------------------------- - * Function: H5G_node_size_real - * - * Purpose: Returns the total size of a symbol table node. - * - * Return: Success: Total size of the node in bytes. - * - * Failure: Never fails. - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 - * - *------------------------------------------------------------------------- - */ -size_t -H5G_node_size_real(const H5F_t *f) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_size_real); - - FUNC_LEAVE_NOAPI(H5G_NODE_SIZEOF_HDR(f) + - (2 * H5F_SYM_LEAF_K(f)) * H5G_SIZEOF_ENTRY(f)); -} /* end H5G_node_size_real() */ - - -/*------------------------------------------------------------------------- * Function: H5G_node_free * * Purpose: Destroy a symbol table node in memory. @@ -322,7 +295,6 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t UNUSED op, void *_lt_key, H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; H5G_node_t *sym = NULL; - hsize_t size = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5G_node_create) @@ -335,9 +307,8 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t UNUSED op, void *_lt_key, if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - size = H5G_node_size_real(f); - HDassert(size); - if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, size))) + sym->node_size = H5G_NODE_SIZE(f); + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)sym->node_size))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space") if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "memory allocation failed") @@ -1437,7 +1408,7 @@ done: /*------------------------------------------------------------------------- * Function: H5G_node_iterate_size * - * Purpose: This function gets called by H5B_iterate_btree_size() + * Purpose: This function gets called by H5B_iterate_helper() * to gather storage info for SNODs. * * Return: Non-negative on success/Negative on failure @@ -1459,10 +1430,10 @@ H5G_node_iterate_size(H5F_t *f, hid_t UNUSED dxpl_id, const void UNUSED *_lt_key HDassert(f); HDassert(stab_size); - *stab_size += H5G_node_size_real(f); + *stab_size += H5G_NODE_SIZE(f); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_btree_node_iterate() */ +} /* end H5G_node_iterate_size() */ /*------------------------------------------------------------------------- @@ -1522,7 +1493,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, "Dirty:", sn->cache_info.is_dirty ? "Yes" : "No"); fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Size of Node (in bytes):", (unsigned)H5G_node_size_real(f)); + "Size of Node (in bytes):", (unsigned)sn->node_size); fprintf(stream, "%*s%-*s %u of %u\n", indent, "", fwidth, "Number of Symbols:", sn->nsyms, (unsigned)(2 * H5F_SYM_LEAF_K(f))); diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 15e9254..82aa2e0 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -58,6 +58,19 @@ #define H5G_TARGET_EXISTS 0x0008 #define H5G_CRT_INTMD_GROUP 0x0010 +/* Size of a symbol table node on disk */ +#define H5G_NODE_SIZE(f) ( \ + /* General metadata fields */ \ + H5_SIZEOF_MAGIC \ + + 1 /* Version */ \ + + 1 /* Reserved */ \ + + 2 /* Number of symbols */ \ + \ + /* Entries */ \ + + ((2 * H5F_SYM_LEAF_K(f)) * H5G_SIZEOF_ENTRY(f)) \ + ) + + /****************************/ /* Package Private Typedefs */ /****************************/ @@ -117,8 +130,9 @@ struct H5G_entry_t { typedef struct H5G_node_t { H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ /* first field in structure */ - unsigned nsyms; /*number of symbols */ - H5G_entry_t *entry; /*array of symbol table entries */ + size_t node_size; /* Size of node on disk */ + unsigned nsyms; /* Number of symbols */ + H5G_entry_t *entry; /* Array of symbol table entries */ } H5G_node_t; /* @@ -435,7 +449,6 @@ H5_DLL herr_t H5G_ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, /* Functions that understand symbol table nodes */ H5_DLL herr_t H5G_node_init(H5F_t *f); -H5_DLL size_t H5G_node_size_real(const H5F_t *f); H5_DLL int H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); H5_DLL int H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, diff --git a/src/H5Groot.c b/src/H5Groot.c index 7470853..f754f29 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -262,7 +262,7 @@ done: /* Mark superblock dirty in cache, if necessary */ if(sblock_dirty) - if(H5AC_mark_pinned_or_protected_entry_dirty(f->shared->sblock) < 0) + if(H5AC_mark_entry_dirty(f->shared->sblock) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HF.c b/src/H5HF.c index 3d90369..cc38f2a 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -152,7 +152,6 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ haddr_t fh_addr; /* Heap header address */ H5HF_t *ret_value; /* Return value */ @@ -175,13 +174,9 @@ HDfprintf(stderr, "%s: Called\n", FUNC); if(NULL == (fh = H5FL_MALLOC(H5HF_t))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed for fractal heap info") - /* 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, fh_addr, &cache_udata, H5AC_WRITE))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load fractal heap header") + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_WRITE))) + 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 */ fh->hdr = hdr; @@ -228,7 +223,6 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ H5HF_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5HF_open, NULL) @@ -239,16 +233,12 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(f); HDassert(H5F_addr_defined(fh_addr)); - /* Set up userdata for protect call */ - cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; - /* Load the heap header into memory */ #ifdef QAK HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr); #endif /* QAK */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, &cache_udata, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to load fractal heap header") + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") #ifdef QAK HDfprintf(stderr, "%s: hdr->rc = %u, hdr->fspace = %p\n", FUNC, hdr->rc, hdr->fspace); #endif /* QAK */ @@ -793,7 +783,6 @@ done: herr_t H5HF_close(H5HF_t *fh, hid_t dxpl_id) { - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ hbool_t pending_delete = FALSE; /* Whether the heap is pending deletion */ haddr_t heap_addr = HADDR_UNDEF; /* Address of heap (for deletion) */ herr_t ret_value = SUCCEED; /* Return value */ @@ -866,13 +855,9 @@ HDfprintf(stderr, "%s; After iterator reset fh->hdr->rc = %Zu\n", FUNC, fh->hdr- if(pending_delete) { H5HF_hdr_t *hdr; /* Another pointer to fractal heap header */ - /* Set up userdata for protect call */ - cache_udata.f = fh->f; - cache_udata.dxpl_id = dxpl_id; - /* Lock the heap header into memory */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(fh->f, dxpl_id, H5AC_FHEAP_HDR, heap_addr, &cache_udata, H5AC_WRITE))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header") + if(NULL == (hdr = H5HF_hdr_protect(fh->f, dxpl_id, heap_addr, H5AC_WRITE))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Set the shared heap header's file context for this operation */ hdr->f = fh->f; @@ -907,7 +892,6 @@ herr_t H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) { H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5HF_delete, FAIL) @@ -918,16 +902,12 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(f); HDassert(H5F_addr_defined(fh_addr)); - /* Set up userdata for protect call */ - cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; - /* Lock the heap header into memory */ #ifdef QAK HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr); #endif /* QAK */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, &cache_udata, H5AC_WRITE))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header") + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_WRITE))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Check for files using shared heap header */ if(hdr->file_rc) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index f02b28c..f8829f2 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -288,9 +288,6 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == (hdr = H5HF_hdr_alloc(udata->f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Set the heap header's address */ - hdr->heap_addr = addr; - /* 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") @@ -745,7 +742,6 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Set block's internal information */ iblock->rc = 0; iblock->nrows = *udata->nrows; - iblock->addr = addr; iblock->nchildren = 0; /* Wrap the local buffer for serialized indirect block */ @@ -753,7 +749,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't wrap buffer") /* Compute size of indirect block */ - iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock); + 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))) @@ -1024,8 +1020,8 @@ H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, HDassert(!H5F_addr_eq(iblock->addr, addr)); /* Let the metadata cache know the block moved */ - if(H5AC_rename(f, H5AC_FHEAP_IBLOCK, iblock->addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRENAME, FAIL, "unable to move indirect block") + 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; @@ -1498,8 +1494,8 @@ H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, /* Let the metadata cache know, if the block moved */ if(!H5F_addr_eq(hdr->man_dtable.table_addr, addr)) - if(H5AC_rename(f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRENAME, FAIL, "unable to move direct block") + 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") /* Update information about compressed direct block's location & size */ hdr->man_dtable.table_addr = addr; @@ -1549,8 +1545,8 @@ H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, /* Let the metadata cache know, if the block moved */ if(!H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)) - if(H5AC_rename(f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRENAME, FAIL, "unable to move direct block") + 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") /* Update information about compressed direct block's location & size */ par_iblock->ents[par_entry].addr = addr; @@ -1585,8 +1581,8 @@ H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, HDassert(!H5F_addr_eq(hdr->man_dtable.table_addr, addr)); /* Let the metadata cache know the block moved */ - if(H5AC_rename(f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRENAME, FAIL, "unable to move direct block") + 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") /* Update information about direct block's location */ hdr->man_dtable.table_addr = addr; @@ -1614,8 +1610,8 @@ H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, HDassert(!H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); /* Let the metadata cache know the block moved */ - if(H5AC_rename(f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRENAME, FAIL, "unable to move direct block") + 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") /* Update information about direct block's location */ par_iblock->ents[par_entry].addr = addr; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index e2ee20c..68b30d9 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -188,7 +188,6 @@ herr_t H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5HF_hdr_debug, FAIL) @@ -202,15 +201,9 @@ H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(indent >= 0); HDassert(fwidth >= 0); - /* Set up user data for protect call */ - cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; - - /* - * Load the fractal heap header. - */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, addr, &cache_udata, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header") + /* Load the fractal heap header */ + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Print opening message */ HDfprintf(stream, "%*sFractal Heap Header...\n", indent, ""); @@ -399,7 +392,6 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ H5HF_direct_t *dblock = NULL; /* Fractal heap direct block info */ - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ size_t blk_prefix_size; /* Size of prefix for block */ size_t amount_free; /* Amount of free space in block */ uint8_t *marker = NULL; /* Track free space for block */ @@ -418,15 +410,9 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(H5F_addr_defined(hdr_addr)); HDassert(block_size > 0); - /* Set up user data for protect call */ - cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; - - /* - * Load the fractal heap header. - */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, &cache_udata, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header") + /* Load the fractal heap header */ + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap direct block @@ -533,7 +519,6 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ hbool_t did_protect; /* Whether we protected the indirect block or not */ char temp_str[64]; /* Temporary string, for formatting */ size_t u, v; /* Local index variable */ @@ -552,15 +537,9 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(H5F_addr_defined(hdr_addr)); HDassert(nrows > 0); - /* Set up user data for protect call */ - cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; - - /* - * Load the fractal heap header. - */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, &cache_udata, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header") + /* Load the fractal heap header */ + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap indirect block @@ -727,7 +706,6 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, FILE *stream, int indent, int fwidth) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ - H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5HF_sects_debug, FAIL) @@ -741,15 +719,9 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, HDassert(indent >= 0); HDassert(fwidth >= 0); - /* Set up user data for protect call */ - cache_udata.f = f; - cache_udata.dxpl_id = dxpl_id; - - /* - * Load the fractal heap header. - */ - if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, &cache_udata, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header") + /* Load the fractal heap header */ + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Initialize the free space information for the heap */ if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index a68cc75..b2b3077 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -466,6 +466,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, */ if(hdr->filter_len > 0) { if(par_iblock == NULL) { + udata.odi_size = hdr->pline_root_direct_size; udata.filter_mask = hdr->pline_root_direct_filter_mask; } /* end if */ else { @@ -473,11 +474,14 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)); /* Set up parameters to read filtered direct block */ + udata.odi_size = par_iblock->filt_ents[par_entry].size; udata.filter_mask = par_iblock->filt_ents[par_entry].filter_mask; } /* end else */ } /* end if */ - else + else { + udata.odi_size = dblock_size; udata.filter_mask = 0; + } /* 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))) diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 54b4ff9..67bb7b0 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -516,6 +516,51 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF_hdr_protect + * + * Purpose: Convenience wrapper around H5AC_protect on an indirect block + * + * Return: Pointer to indirect block on success, NULL on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 5 2010 + * + *------------------------------------------------------------------------- + */ +H5HF_hdr_t * +H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) +{ + H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ + H5HF_hdr_t *hdr; /* Fractal heap header */ + H5HF_hdr_t *ret_value; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_protect) + + /* Check arguments */ + HDassert(f); + HDassert(H5F_addr_defined(addr)); + + /* 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))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") + + /* Set the header's address */ + hdr->heap_addr = addr; + + /* Set the return value */ + ret_value = hdr; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_hdr_protect() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_hdr_incr * * Purpose: Increment component reference count on shared heap header @@ -672,12 +717,12 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr) /* Resize pinned header in cache if I/O filter is present. */ if(hdr->filter_len > 0) { - if(H5AC_resize_pinned_entry(hdr, (size_t)hdr->heap_size) < 0) + if(H5AC_resize_entry(hdr, (size_t)hdr->heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize fractal heap header") } /* end if */ /* Mark header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(hdr) < 0) + if(H5AC_mark_entry_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark fractal heap header as dirty") done: diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index d50dee2..7958075 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -332,7 +332,7 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock) HDassert(iblock); /* Mark indirect block as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(iblock) < 0) + if(H5AC_mark_entry_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark fractal heap indirect block as dirty") done: @@ -545,14 +545,14 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si * QAK - 3/14/2006 */ /* Free previous indirect block disk space */ - old_iblock_size = iblock->size; if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") } /* end if */ /* Compute size of buffer needed for new indirect block */ iblock->nrows = new_nrows; - iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock); + old_iblock_size = iblock->size; + iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); /* Allocate [temporary] space for the new indirect block on disk */ if(H5F_USE_TMP_SPACE(hdr->f)) { @@ -566,14 +566,14 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si /* Resize pinned indirect block in the cache, if its changed size */ if(old_iblock_size != iblock->size) { - if(H5AC_resize_pinned_entry(iblock, (size_t)iblock->size) < 0) + if(H5AC_resize_entry(iblock, (size_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize fractal heap indirect block") } /* end if */ /* Move object in cache, if it actually was relocated */ if(H5F_addr_ne(iblock->addr, new_addr)) { - if(H5AC_rename(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRENAME, FAIL, "unable to move fractal heap root indirect block") + if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move fractal heap root indirect block") iblock->addr = new_addr; } /* end if */ @@ -708,7 +708,6 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) * QAK - 6/12/2006 */ /* Free previous indirect block disk space */ - old_size = iblock->size; if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") } /* end if */ @@ -721,7 +720,8 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) /* Compute size of buffer needed for new indirect block */ old_nrows = iblock->nrows; iblock->nrows = new_nrows; - iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock); + old_size = iblock->size; + iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); /* Allocate [temporary] space for the new indirect block on disk */ if(H5F_USE_TMP_SPACE(hdr->f)) { @@ -735,13 +735,13 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) /* Resize pinned indirect block in the cache, if it has changed size */ if(old_size != iblock->size) { - if(H5AC_resize_pinned_entry(iblock, (size_t)iblock->size) < 0) + if(H5AC_resize_entry(iblock, (size_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize fractal heap indirect block") } /* end if */ /* Move object in cache, if it actually was relocated */ if(H5F_addr_ne(iblock->addr, new_addr)) { - if(H5AC_rename(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) + if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSPLIT, FAIL, "unable to move fractal heap root indirect block") iblock->addr = new_addr; } /* end if */ @@ -985,7 +985,7 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo iblock->max_rows = max_rows; /* Compute size of buffer needed for indirect block */ - iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock); + iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); /* Allocate child block entry array */ if(NULL == (iblock->ents = H5FL_SEQ_MALLOC(H5HF_indirect_ent_t, (size_t)(iblock->nrows * hdr->man_dtable.cparam.width)))) @@ -1154,9 +1154,15 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, /* Protect the indirect block */ if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, &cache_udata, rw))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap indirect block") + + /* Set the indirect block's address */ + iblock->addr = iblock_addr; + + /* Indicate that the indirect block was protected */ *did_protect = TRUE; } /* end if */ else + /* Indicate that the indirect block was _not_ protected */ *did_protect = FALSE; /* Set the return value */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index f862fe0..2746302 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -123,18 +123,17 @@ ) /* Size of managed indirect block */ -#define H5HF_MAN_INDIRECT_SIZE(h, i) ( \ +#define H5HF_MAN_INDIRECT_SIZE(h, r) ( \ /* General metadata fields */ \ H5HF_METADATA_PREFIX_SIZE(TRUE) \ \ /* Fractal heap managed, absolutely mapped indirect block specific fields */ \ + (h)->sizeof_addr /* File address of heap owning the block */ \ + (h)->heap_off_size /* Offset of the block in the heap */ \ - + (MIN((i)->nrows, (h)->man_dtable.max_direct_rows) * (h)->man_dtable.cparam.width * H5HF_MAN_INDIRECT_CHILD_DIR_ENTRY_SIZE(h)) /* Size of entries for direct blocks */ \ - + ((((i)->nrows > (h)->man_dtable.max_direct_rows) ? ((i)->nrows - (h)->man_dtable.max_direct_rows) : 0) * (h)->man_dtable.cparam.width * (h)->sizeof_addr) /* Size of entries for indirect blocks */ \ + + (MIN(r, (h)->man_dtable.max_direct_rows) * (h)->man_dtable.cparam.width * H5HF_MAN_INDIRECT_CHILD_DIR_ENTRY_SIZE(h)) /* Size of entries for direct blocks */ \ + + (((r > (h)->man_dtable.max_direct_rows) ? (r - (h)->man_dtable.max_direct_rows) : 0) * (h)->man_dtable.cparam.width * (h)->sizeof_addr) /* Size of entries for indirect blocks */ \ ) - /* Compute the # of bytes required to store an offset into a given buffer size */ #define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) #define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5V_log2_of2((unsigned)(l))) @@ -484,6 +483,13 @@ typedef struct H5HF_iblock_cache_ud_t { typedef struct H5HF_dblock_cache_ud_t { H5HF_parent_t par_info; /* Parent info */ H5F_t * f; /* File pointer */ + size_t odi_size; /* On disk image size of the direct block. + * Note that there is no necessary relation + * between this value, and the actual + * direct block size, as conpression may + * reduce the size of the on disk image, + * and check sums may increase it. + */ size_t dblock_size; /* size of the direct block, which bears * no necessary relation to the block * odi_size -- the size of the on disk @@ -571,6 +577,8 @@ H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start /* Heap header routines */ 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); 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); diff --git a/src/H5HG.c b/src/H5HG.c index e7b21dd..3082618 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -99,7 +99,7 @@ static haddr_t H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size); /* Package Variables */ /*********************/ -/* Declare a free list to manage the H5HG_t struct */ +/* Declare a free list to manage the H5HG_heap_t struct */ H5FL_DEFINE(H5HG_heap_t); /* Declare a free list to manage sequences of H5HG_obj_t's */ @@ -253,6 +253,45 @@ done: /*------------------------------------------------------------------------- + * Function: H5HG_protect + * + * Purpose: Convenience wrapper around H5AC_protect on an indirect block + * + * Return: Pointer to indirect block on success, NULL on failure + * + * Programmer: Quincey Koziol + * Wednesday, May 5, 2010 + * + *------------------------------------------------------------------------- + */ +H5HG_heap_t * +H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) +{ + H5HG_heap_t *heap; /* Global heap */ + H5HG_heap_t *ret_value; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5HG_protect) + + /* Check arguments */ + HDassert(f); + HDassert(H5F_addr_defined(addr)); + + /* Lock the heap into memory */ + if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, f, rw))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") + + /* Set the heap's address */ + heap->addr = addr; + + /* Set the return value */ + ret_value = heap; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5HG_protect() */ + + +/*------------------------------------------------------------------------- * Function: H5HG_alloc * * Purpose: Given a heap with enough free space, this function will split @@ -271,36 +310,36 @@ done: *------------------------------------------------------------------------- */ static size_t -H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) +H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) { size_t idx; - uint8_t *p = NULL; + uint8_t *p; size_t need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size); - size_t ret_value; /* Return value */ + size_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HG_alloc); /* Check args */ - assert (heap); - assert (heap->obj[0].size>=need); - assert (heap_flags_ptr); + HDassert(heap); + HDassert(heap->obj[0].size>=need); + HDassert(heap_flags_ptr); /* * Find an ID for the new object. ID zero is reserved for the free space * object. */ - if(heap->nused<=H5HG_MAXIDX) - idx=heap->nused++; + if(heap->nused <= H5HG_MAXIDX) + idx = heap->nused++; else { - for (idx=1; idxnused; idx++) - if (NULL==heap->obj[idx].begin) + for(idx = 1; idx < heap->nused; idx++) + if(NULL == heap->obj[idx].begin) break; } /* end else */ HDassert(idx < heap->nused); /* Check if we need more room to store heap objects */ - if(idx>=heap->nalloc) { + if(idx >= heap->nalloc) { size_t new_alloc; /* New allocation number */ H5HG_obj_t *new_obj; /* New array of object descriptions */ @@ -310,16 +349,16 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) 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, 0, "memory allocation failed") + if(NULL == (new_obj = H5FL_SEQ_REALLOC(H5HG_obj_t, heap->obj, new_alloc))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, 0, "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); + heap->nalloc = new_alloc; + heap->obj = new_obj; + HDassert(heap->nalloc > heap->nused); } /* end if */ /* Initialize the new object */ @@ -333,14 +372,14 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) H5F_ENCODE_LENGTH (f, p, size); /* Fix the free space object */ - if (need==heap->obj[0].size) { + if(need == heap->obj[0].size) { /* * All free space has been exhausted from this collection. */ heap->obj[0].size = 0; heap->obj[0].begin = NULL; - - } else if (heap->obj[0].size-need >= H5HG_SIZEOF_OBJHDR (f)) { + } /* end if */ + else if(heap->obj[0].size-need >= H5HG_SIZEOF_OBJHDR (f)) { /* * Some free space remains and it's larger than a heap object header, * so write the new free heap object header to the heap. @@ -353,8 +392,8 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH (f, p, heap->obj[0].size); assert(H5HG_ISALIGNED(heap->obj[0].size)); - - } else { + } /* end else-if */ + else { /* * Some free space remains but it's smaller than a heap object header, * so we don't write the header. @@ -368,11 +407,11 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) *heap_flags_ptr |= H5AC__DIRTIED_FLAG; /* Set the return value */ - ret_value=idx; + ret_value = idx; done: FUNC_LEAVE_NOAPI(ret_value); -} +} /* end H5HG_alloc() */ /*------------------------------------------------------------------------- @@ -403,11 +442,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HG_extend(H5F_t *f, H5HG_heap_t *heap, size_t need, unsigned *heap_flags_ptr) +H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) { + H5HG_heap_t *heap = NULL; /* Pointer to heap to extend */ + unsigned heap_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting heap */ size_t old_size; /* Previous size of the heap's chunk */ - uint8_t *new_chunk = NULL; /* Pointer to new chunk information */ - uint8_t *p = NULL; /* Pointer to raw heap info */ + uint8_t *new_chunk; /* Pointer to new chunk information */ + uint8_t *p; /* Pointer to raw heap info */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -415,8 +456,11 @@ H5HG_extend(H5F_t *f, H5HG_heap_t *heap, size_t need, unsigned *heap_flags_ptr) /* Check args */ HDassert(f); - HDassert(heap); - HDassert(heap_flags_ptr); + HDassert(H5F_addr_defined(addr)); + + /* Protect the heap */ + if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC_WRITE))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Re-allocate the heap information in memory */ if(NULL == (new_chunk = H5FL_BLK_REALLOC(gheap_chunk, heap->chunk, (heap->size + need)))) @@ -452,10 +496,17 @@ HDmemset(new_chunk + heap->size, 0, need); H5F_ENCODE_LENGTH(f, p, heap->obj[0].size); assert(H5HG_ISALIGNED(heap->obj[0].size)); + /* Resize the heap in the cache */ + if(H5AC_resize_entry(heap, heap->size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize global heap in cache") + /* Mark the heap as dirty */ - *heap_flags_ptr |= H5AC__DIRTIED_FLAG; + heap_flags |= H5AC__DIRTIED_FLAG; done: + if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to unprotect heap") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5HG_extend() */ @@ -521,14 +572,6 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ * and protecting and unprotecting all the collections in the global * heap on a regular basis will skew the replacement policy. * - * However, there is a bigger issue -- as best I can tell, we only look - * for free space in global heap chunks that are in cache. If we can't - * find any, we allocate a new chunk. This may be a problem in FP mode, - * as the metadata cache is disabled. Do we allocate a new heap - * collection for every entry in this case? - * - * Note that all this comes from a cursory read of the source. Don't - * take any of it as gospel. * JRM - 5/24/04 */ for(cwfsno = 0; cwfsno < f->shared->ncwfs; cwfsno++) @@ -557,8 +600,8 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ if(extended < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap") else if(extended == TRUE) { - if(H5HG_extend(f, f->shared->cwfs[cwfsno], new_need, &heap_flags) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to extend global heap collection") + if(H5HG_extend(f, dxpl_id, f->shared->cwfs[cwfsno]->addr, new_need) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to extend global heap collection") addr = f->shared->cwfs[cwfsno]->addr; found = TRUE; break; @@ -590,11 +633,12 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ } /* end if */ } /* end else */ HDassert(H5F_addr_defined(addr)); - if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, f, H5AC_WRITE))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap") + if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC_WRITE))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Split the free space to make room for the new object */ - idx = H5HG_alloc(f, heap, size, &heap_flags); + if(0 == (idx = H5HG_alloc(f, heap, size, &heap_flags))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "unable to allocate global heap object") /* Copy data into the heap */ if(size > 0) { @@ -613,7 +657,7 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ done: if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) - HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to unprotect heap.") + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to unprotect heap.") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* H5HG_insert() */ @@ -653,8 +697,8 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, HDassert(hobj); /* Load the heap */ - if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, hobj->addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to load heap") + if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); HDassert(heap->obj[hobj->idx].begin); @@ -692,7 +736,7 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, done: if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_HEAP, H5E_PROTECT, NULL, "unable to release object header") + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release object header") if(NULL == ret_value && NULL == orig_object && object) H5MM_free(object); @@ -735,8 +779,8 @@ 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_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, hobj->addr, f, H5AC_WRITE))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap") + if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC_WRITE))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") if(adjust != 0) { HDassert(hobj->idx < heap->nused); @@ -754,7 +798,7 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) done: if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, heap_flags) < 0) - HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header") + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5HG_link() */ @@ -798,8 +842,8 @@ 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_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, hobj->addr, f, H5AC_WRITE))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap") + if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC_WRITE))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); HDassert(heap->obj[hobj->idx].begin); @@ -859,7 +903,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) done: if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, flags) < 0) - HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header") + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL); } /* end H5HG_remove() */ diff --git a/src/H5HGcache.c b/src/H5HGcache.c index e234d41..a3cf5b1 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -131,7 +131,6 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* Read the initial 4k page */ if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - heap->addr = addr; heap->shared = f->shared; if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, (size_t)H5HG_MINSIZE))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 1fc0133..38b7047 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -73,8 +73,8 @@ 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_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load global heap collection"); + if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection"); fprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 7ce18c9..6c60656 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -150,6 +150,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); #endif /* _H5HGpkg_H */ diff --git a/src/H5HL.c b/src/H5HL.c index debec41..61c97e1 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -210,6 +210,7 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) H5HL_dblk_t *dblk; /* Local heap data block */ haddr_t old_addr; /* Old location of heap data block */ haddr_t new_addr; /* New location of heap data block */ + size_t old_heap_size; /* Old size of heap data block */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HL_dblk_realloc) @@ -220,8 +221,9 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) /* Release old space on disk */ old_addr = heap->dblk_addr; - H5_CHECK_OVERFLOW(heap->dblk_size, size_t, hsize_t); - if(H5MF_xfree(f, H5FD_MEM_LHEAP, dxpl_id, old_addr, (hsize_t)heap->dblk_size) < 0) + old_heap_size = heap->dblk_size; + H5_CHECK_OVERFLOW(old_heap_size, size_t, hsize_t); + if(H5MF_xfree(f, H5FD_MEM_LHEAP, dxpl_id, old_addr, (hsize_t)old_heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "can't release old heap data?") /* Allocate new space on disk */ @@ -229,25 +231,29 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) if(HADDR_UNDEF == (new_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, dxpl_id, (hsize_t)new_heap_size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "unable to allocate file space for heap") + /* Update heap info*/ + heap->dblk_addr = new_addr; + heap->dblk_size = new_heap_size; + /* Check if heap data block actually moved in the file */ if(H5F_addr_eq(old_addr, new_addr)) { /* Check if heap data block is contiguous w/prefix */ if(heap->single_cache_obj) { /* Sanity check */ - HDassert(H5F_addr_eq(heap->prfx_addr + heap->prfx_size, heap->dblk_addr)); + HDassert(H5F_addr_eq(heap->prfx_addr + heap->prfx_size, old_addr)); HDassert(heap->prfx); /* Resize the heap prefix in the cache */ - if(H5AC_resize_pinned_entry(heap->prfx, (size_t)(heap->prfx_size + new_heap_size)) < 0) + if(H5AC_resize_entry(heap->prfx, (size_t)(heap->prfx_size + new_heap_size)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap in cache") } /* end if */ else { /* Sanity check */ - HDassert(H5F_addr_ne(heap->prfx_addr + heap->prfx_size, heap->dblk_addr)); + HDassert(H5F_addr_ne(heap->prfx_addr + heap->prfx_size, old_addr)); HDassert(heap->dblk); /* Resize the heap data block in the cache */ - if(H5AC_resize_pinned_entry(heap->dblk, (size_t)new_heap_size) < 0) + if(H5AC_resize_entry(heap->dblk, (size_t)new_heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap in cache") } /* end else */ } /* end if */ @@ -260,7 +266,7 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) /* Resize current heap prefix */ heap->prfx_size = H5HL_SIZEOF_HDR(f); - if(H5AC_resize_pinned_entry(heap->prfx, (size_t)heap->prfx_size) < 0) + if(H5AC_resize_entry(heap->prfx, (size_t)heap->prfx_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap prefix in cache") /* Insert data block into cache (pinned) */ @@ -276,20 +282,22 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) /* (ignore [unlikely] case where heap data block ends up * contiguous w/heap prefix again. */ - if(H5AC_resize_pinned_entry(heap->dblk, (size_t)new_heap_size) < 0) + if(H5AC_resize_entry(heap->dblk, (size_t)new_heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap data block in cache") /* Relocate the heap data block in the cache */ - if(H5AC_rename(f, H5AC_LHEAP_DBLK, old_addr, new_addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRENAME, FAIL, "unable to move heap data block in cache") + if(H5AC_move_entry(f, H5AC_LHEAP_DBLK, old_addr, new_addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move heap data block in cache") } /* end else */ } /* end else */ - /* Update heap info*/ - heap->dblk_addr = new_addr; - heap->dblk_size = new_heap_size; - done: + if(ret_value < 0) { + /* Restore old heap address & size */ + heap->dblk_addr = old_addr; + heap->dblk_size = old_heap_size; + } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /* end H5HL_dblk_realloc() */ @@ -450,6 +458,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) /* Construct the user data for protect callback */ 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; prfx_udata.free_block = H5HL_FREE_NULL; @@ -654,12 +663,12 @@ H5HL_dirty(H5HL_t *heap) /* Sanity check */ HDassert(heap->dblk); - if(H5AC_mark_pinned_or_protected_entry_dirty(heap->dblk) < 0) + if(H5AC_mark_entry_dirty(heap->dblk) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap data block as dirty") } /* end if */ /* Mark heap prefix as dirty */ - if(H5AC_mark_pinned_or_protected_entry_dirty(heap->prfx) < 0) + if(H5AC_mark_entry_dirty(heap->prfx) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap prefix as dirty") done: @@ -783,12 +792,12 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * /* Check for prefix & data block contiguous */ if(heap->single_cache_obj) { /* Resize prefix+data block */ - if(H5AC_resize_pinned_entry(heap->prfx, (size_t)(heap->prfx_size + new_dblk_size)) < 0) + if(H5AC_resize_entry(heap->prfx, (size_t)(heap->prfx_size + new_dblk_size)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, UFAIL, "unable to resize heap prefix in cache") } /* end if */ else { /* Resize 'standalone' data block */ - if(H5AC_resize_pinned_entry(heap->dblk, (size_t)new_dblk_size) < 0) + if(H5AC_resize_entry(heap->dblk, (size_t)new_dblk_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, UFAIL, "unable to resize heap data block in cache") } /* end else */ @@ -1066,6 +1075,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Construct the user data for protect callback */ 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; prfx_udata.free_block = H5HL_FREE_NULL; @@ -1145,6 +1155,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size) /* Construct the user data for protect callback */ 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; prfx_udata.free_block = H5HL_FREE_NULL; @@ -1198,6 +1209,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size) /* Construct the user data for protect callback */ 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; prfx_udata.free_block = H5HL_FREE_NULL; diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 7932651..238dce6 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -303,7 +303,7 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap prefix") /* Store the prefix's address & length */ - heap->prfx_addr = addr; + heap->prfx_addr = udata->prfx_addr; heap->prfx_size = udata->sizeof_prfx; /* Heap data size */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 926ecd3..b7e0ece 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -123,6 +123,7 @@ typedef struct H5HL_cache_prfx_ud_t { /* Downwards */ 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 */ diff --git a/src/H5MF.c b/src/H5MF.c index 480f3bb..a8f12bb 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -905,7 +905,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5MF_can_shrink + * Function: H5MF_try_shrink * * Purpose: Try to shrink the size of a file with a block or absorb it * into a block aggregator. diff --git a/src/H5O.c b/src/H5O.c index c590c50..876174a 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1489,7 +1489,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) oh->nlink += adjust; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") /* Check if the object should be deleted */ @@ -1521,7 +1521,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) oh->nlink += adjust; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ @@ -1660,6 +1660,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) udata.common.mesgs_modified = FALSE; HDmemset(&cont_msg_info, 0, sizeof(cont_msg_info)); udata.common.cont_msg_info = &cont_msg_info; + 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))) @@ -1696,7 +1697,8 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* Bring the chunk into the cache */ /* (which adds to the object header) */ - chk_udata.chunk_size = cont_msg_info.msgs[curr_msg].size; + 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))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") @@ -1762,6 +1764,9 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* Check for any messages that were modified while being read in */ if(udata.common.mesgs_modified && prot != H5AC_WRITE) oh->mesgs_modified = TRUE; + + /* Reset the field that contained chunk 0's size during speculative load */ + oh->chunk0_size = 0; } /* end if */ /* Take care of loose ends for modifications made while bringing in the @@ -1772,7 +1777,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* (usually through updating the # of object header messages) */ if(oh->prefix_modified) { /* Mark the header as dirty now */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, NULL, "unable to mark object header as dirty") /* Reset flag */ @@ -1798,7 +1803,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Unprotect chunk, marking it dirty */ - if(H5O_chunk_unprotect(loc->file, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(loc->file, dxpl_id, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -1962,7 +1967,7 @@ herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ time_t now; /* Current time */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2016,7 +2021,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) /* Mark the message as dirty */ oh->mesg[idx].dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; } /* end if */ else { /* XXX: For now, update access time & change fields in the object header */ @@ -2024,14 +2029,14 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) oh->atime = oh->ctime = now; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end else */ } /* end if */ done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 64d2f03..a06740c 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -59,8 +59,8 @@ /********************/ static herr_t H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, - unsigned *chk_flags, unsigned idx, uint8_t *new_gap_loc, size_t new_gap_size); -static herr_t H5O_eliminate_gap(H5O_t *oh, unsigned *chk_flags, + hbool_t *chk_dirtied, unsigned idx, uint8_t *new_gap_loc, size_t new_gap_size); +static herr_t H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *new_gap_loc, size_t new_gap_size); static herr_t H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size); @@ -108,7 +108,7 @@ H5FL_EXTERN(H5O_cont_t); *------------------------------------------------------------------------- */ static herr_t -H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, unsigned *chk_flags, +H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, unsigned idx, uint8_t *new_gap_loc, size_t new_gap_size) { hbool_t merged_with_null; /* Whether the gap was merged with a null message */ @@ -120,7 +120,7 @@ H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, unsigned *chk_flags, /* check args */ HDassert(oh); HDassert(oh->version > H5O_VERSION_1); - HDassert(chk_flags); + HDassert(chk_dirtied); HDassert(new_gap_loc); HDassert(new_gap_size); @@ -148,7 +148,7 @@ if(chunkno > 0) { HDassert(oh->chunk[chunkno].gap == 0); /* Eliminate the gap in the chunk */ - if(H5O_eliminate_gap(oh, chk_flags, &oh->mesg[u], new_gap_loc, new_gap_size) < 0) + if(H5O_eliminate_gap(oh, chk_dirtied, &oh->mesg[u], new_gap_loc, new_gap_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't eliminate gap in chunk") /* Set flag to indicate that the gap was handled */ @@ -205,7 +205,7 @@ if(chunkno > 0) { oh->chunk[chunkno].gap = new_gap_size; /* Mark the chunk as modified */ - *chk_flags |= H5AC__DIRTIED_FLAG; + *chk_dirtied = TRUE; } /* end if */ done: @@ -234,18 +234,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_eliminate_gap(H5O_t *oh, unsigned *chk_flags, H5O_mesg_t *mesg, +H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *gap_loc, size_t gap_size) { uint8_t *move_start, *move_end; /* Pointers to area of messages to move */ - hbool_t null_before_gap; /* Flag whether the null message is before the gap or not */ + hbool_t null_before_gap; /* Flag whether the null message is before the gap or not */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_eliminate_gap) /* check args */ HDassert(oh); HDassert(oh->version > H5O_VERSION_1); - HDassert(chk_flags); + HDassert(chk_dirtied); HDassert(mesg); HDassert(gap_loc); HDassert(gap_size); @@ -314,7 +314,7 @@ H5O_eliminate_gap(H5O_t *oh, unsigned *chk_flags, H5O_mesg_t *mesg, /* Mark null message as dirty */ mesg->dirty = TRUE; - *chk_flags |= H5AC__DIRTIED_FLAG; + *chk_dirtied = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5O_eliminate_gap() */ @@ -339,7 +339,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ H5O_mesg_t *alloc_msg; /* Pointer to null message to allocate out of */ herr_t ret_value = SUCCEED; /* Return value */ @@ -367,7 +367,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, alloc_msg->raw_size = new_size; /* Add the gap to the chunk */ - if(H5O_add_gap(f, oh, alloc_msg->chunkno, &chk_flags, null_idx, alloc_msg->raw + alloc_msg->raw_size, gap_size) < 0) + if(H5O_add_gap(f, oh, alloc_msg->chunkno, &chk_dirtied, null_idx, alloc_msg->raw + alloc_msg->raw_size, gap_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert gap in chunk") } /* end if */ else { @@ -393,14 +393,14 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, /* Mark the message as dirty */ null_msg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Check for gap in new null message's chunk */ if(oh->chunk[null_msg->chunkno].gap > 0) { unsigned null_chunkno = null_msg->chunkno; /* Chunk w/gap */ /* Eliminate the gap in the chunk */ - if(H5O_eliminate_gap(oh, &chk_flags, null_msg, + if(H5O_eliminate_gap(oh, &chk_dirtied, null_msg, ((oh->chunk[null_chunkno].image + oh->chunk[null_chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[null_chunkno].gap)), oh->chunk[null_chunkno].gap) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREMOVE, FAIL, "can't eliminate gap in chunk") @@ -417,11 +417,11 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, /* Mark the new message as dirty */ alloc_msg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -507,8 +507,8 @@ static htri_t H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, size_t size, int *msg_idx) { - H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ size_t delta; /* Change in chunk's size */ size_t aligned_size = H5O_ALIGN_OH(oh, size); uint8_t *old_image; /* Old address of chunk's image in memory */ @@ -583,6 +583,10 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, } /* end if */ } /* end if */ + /* Protect chunk */ + if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") + /* Determine whether the chunk can be extended */ extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_OHDR, oh->chunk[chunkno].addr, (hsize_t)(oh->chunk[chunkno].size), (hsize_t)(delta + extra_prfx_size)); @@ -591,17 +595,13 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, else if(extended == FALSE) /* can't extend -- we are done */ HGOTO_DONE(FALSE) - /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - /* Adjust object header prefix flags */ if(adjust_size_flags) { oh->flags &= (uint8_t)~H5O_HDR_CHUNK0_SIZE; oh->flags |= new_size_flags; /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ @@ -632,7 +632,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Mark the extended message as dirty */ oh->mesg[extend_msg].dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Allocate more memory space for chunk's image */ old_image = oh->chunk[chunkno].image; @@ -663,7 +663,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, if(chunkno > 0 && (H5O_CONT_ID == oh->mesg[u].type->id) && (((H5O_cont_t *)(oh->mesg[u].native))->chunkno == chunkno)) { H5O_chunk_proxy_t *chk_proxy2 = NULL; /* Chunk that continuation message is in */ - unsigned chk_flags2 = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied2 = FALSE; /* Flag for unprotecting chunk */ unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ /* Protect chunk containing continuation message */ @@ -676,23 +676,24 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Flag continuation message as dirty */ oh->mesg[u].dirty = TRUE; - chk_flags2 |= H5AC__DIRTIED_FLAG; + chk_dirtied2 = TRUE; /* Release chunk containing continuation message */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy2, chk_flags2) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy2, chk_dirtied2) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ - /* Mark the chunk size in the cache as changed */ - chk_flags |= H5AC__SIZE_CHANGED_FLAG; + /* Resize the chunk in the cache */ + if(H5O_chunk_resize(oh, chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize object header chunk") /* Set return value */ *msg_idx = extend_msg; done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -993,7 +994,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size) oh->chunk[chunkno - 1].gap = 0; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } else if(found_null < 0) { /* Move message (that will be replaced with continuation message) @@ -1059,7 +1060,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size) null_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ HDassert(found_null >= 0); @@ -1171,7 +1172,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't split null message") /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") /* Set return value */ @@ -1200,9 +1201,9 @@ herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) { - H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5O_release_mesg, FAIL) @@ -1235,12 +1236,12 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, /* Mark the message as modified */ mesg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Check if chunk has a gap currently */ if(oh->chunk[mesg->chunkno].gap) { /* Eliminate the gap in the chunk */ - if(H5O_eliminate_gap(oh, &chk_flags, mesg, + if(H5O_eliminate_gap(oh, &chk_dirtied, mesg, ((oh->chunk[mesg->chunkno].image + oh->chunk[mesg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[mesg->chunkno].gap)), oh->chunk[mesg->chunkno].gap) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREMOVE, FAIL, "can't eliminate gap in chunk") @@ -1248,7 +1249,7 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1274,7 +1275,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that continuation message is in */ H5O_mesg_t *cont_msg; /* Pointer to the continuation message */ unsigned deleted_chunkno; /* Chunk # to delete */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_move_cont) @@ -1353,7 +1354,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) curr_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); curr_msg->chunkno = cont_chunkno; curr_msg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Adjust location to move messages to */ move_start += move_size; @@ -1370,13 +1371,13 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) cont_msg->raw_size = gap_size - H5O_SIZEOF_MSGHDR_OH(oh); cont_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); cont_msg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; } /* end if */ else { /* Check if there is space that should be a gap */ if(gap_size > 0) { /* Convert remnant into gap in chunk */ - if(H5O_add_gap(f, oh, cont_chunkno, &chk_flags, cont_u, move_start, gap_size) < 0) + if(H5O_add_gap(f, oh, cont_chunkno, &chk_dirtied, cont_u, move_start, gap_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert gap in chunk") } /* end if */ @@ -1396,7 +1397,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) if(curr_msg->type->id == H5O_NULL_ID) { /* Release any information/memory for message */ H5O_msg_free_mesg(curr_msg); - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Remove from message list */ if(v < (oh->nmesgs - 1)) @@ -1417,7 +1418,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1503,7 +1504,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Set the flag to indicate that the null message @@ -1543,10 +1544,10 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) for(v = 0, null_msg = &oh->mesg[0]; v < oh->nmesgs; v++, null_msg++) { if(H5O_NULL_ID == null_msg->type->id && curr_msg->chunkno > null_msg->chunkno && curr_msg->raw_size <= null_msg->raw_size) { - H5O_chunk_proxy_t *null_chk_proxy; /* Chunk that null message is in */ - H5O_chunk_proxy_t *curr_chk_proxy; /* Chunk that message is in */ - unsigned null_chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting null chunk */ - unsigned curr_chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting curr chunk */ + H5O_chunk_proxy_t *null_chk_proxy; /* Chunk that null message is in */ + H5O_chunk_proxy_t *curr_chk_proxy; /* Chunk that message is in */ + unsigned null_chk_dirtied = FALSE; /* Flags for unprotecting null chunk */ + unsigned curr_chk_dirtied = FALSE; /* Flags for unprotecting curr chunk */ unsigned old_chunkno; /* Old message information */ uint8_t *old_raw; @@ -1566,7 +1567,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* Point non-null message at null message's space */ curr_msg->chunkno = null_msg->chunkno; curr_msg->raw = null_msg->raw; - curr_chk_flags |= H5AC__DIRTIED_FLAG; + curr_chk_dirtied = TRUE; /* Change information for null message */ if(curr_msg->raw_size == null_msg->raw_size) { @@ -1577,23 +1578,23 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* Mark null message dirty */ null_msg->dirty = TRUE; - null_chk_flags |= H5AC__DIRTIED_FLAG; + null_chk_dirtied = TRUE; /* Release current chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Check for gap in null message's chunk */ if(oh->chunk[old_chunkno].gap > 0) { /* Eliminate the gap in the chunk */ - if(H5O_eliminate_gap(oh, &null_chk_flags, null_msg, + if(H5O_eliminate_gap(oh, &null_chk_dirtied, null_msg, ((oh->chunk[old_chunkno].image + oh->chunk[old_chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[old_chunkno].gap)), oh->chunk[old_chunkno].gap) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREMOVE, FAIL, "can't eliminate gap in chunk") } /* end if */ /* Release null chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ else { @@ -1608,10 +1609,10 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* Mark null message dirty */ null_msg->dirty = TRUE; - null_chk_flags |= H5AC__DIRTIED_FLAG; + null_chk_dirtied = TRUE; /* Add the gap to the chunk */ - if(H5O_add_gap(f, oh, null_msg->chunkno, &null_chk_flags, v, null_msg->raw + null_msg->raw_size, gap_size) < 0) + if(H5O_add_gap(f, oh, null_msg->chunkno, &null_chk_dirtied, v, null_msg->raw + null_msg->raw_size, gap_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert gap in chunk") /* Re-use message # for new null message taking place of non-null message */ @@ -1624,7 +1625,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* Mark null message dirty */ null_msg->dirty = TRUE; - null_chk_flags |= H5AC__DIRTIED_FLAG; + null_chk_dirtied = TRUE; /* Create new null message for previous location of non-null message */ if(oh->nmesgs >= oh->alloc_nmesgs) { @@ -1640,7 +1641,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end else */ /* Release null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Initialize new null message to take over non-null message's location */ @@ -1652,19 +1653,19 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* Mark new null message dirty */ oh->mesg[new_null_msg].dirty = TRUE; - curr_chk_flags |= H5AC__DIRTIED_FLAG; + curr_chk_dirtied = TRUE; /* Check for gap in new null message's chunk */ if(oh->chunk[old_chunkno].gap > 0) { /* Eliminate the gap in the chunk */ - if(H5O_eliminate_gap(oh, &curr_chk_flags, &oh->mesg[new_null_msg], + if(H5O_eliminate_gap(oh, &curr_chk_dirtied, &oh->mesg[new_null_msg], ((oh->chunk[old_chunkno].image + oh->chunk[old_chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[old_chunkno].gap)), oh->chunk[old_chunkno].gap) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTREMOVE, FAIL, "can't eliminate gap in chunk") } /* end if */ /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end else */ @@ -1790,7 +1791,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Remove second message from list of messages */ @@ -2263,20 +2264,24 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, cont_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, cont_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ HDassert(new_size <= old_size); + /* Resize the chunk in the cache */ + if(H5O_chunk_resize(oh, chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize object header chunk") + /* Free the unused space in the file */ if(H5MF_xfree(f, H5FD_MEM_OHDR, dxpl_id, chunk->addr + new_size, (hsize_t)(old_size - new_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to shrink object header chunk") done: /* Release chunk, marking it dirty */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 8b846c7..9f0f189 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -833,8 +833,8 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, { H5O_iter_wrt_t *udata = (H5O_iter_wrt_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ - herr_t ret_value = H5_ITER_CONT; /* Return value */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_write_cb) @@ -862,10 +862,10 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Mark the message as modified */ mesg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -886,7 +886,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1035,8 +1035,8 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ - herr_t ret_value = H5_ITER_CONT; /* Return value */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ + herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_rename_mod_cb) @@ -1063,10 +1063,10 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Mark the message as modified */ mesg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -1130,7 +1130,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index f2d5907..9e909a6 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -333,7 +333,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) buf = read_buf; /* Parse the first chunk */ - if(H5O_chunk_deserialize(oh, addr, oh->chunk0_size, buf, &(udata->common), &oh->cache_info.is_dirty) < 0) + 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") /* Note that we've loaded the object header from the file */ @@ -618,7 +618,10 @@ H5O_size(const H5F_t UNUSED *f, const H5O_t *oh, size_t *size_ptr) HDassert(size_ptr); /* Report the object header's prefix+first chunk length */ - *size_ptr = (size_t)H5O_SIZEOF_HDR(oh) + oh->chunk0_size; + if(oh->chunk0_size) + *size_ptr = H5O_SIZEOF_HDR(oh) + oh->chunk0_size; + else + *size_ptr = oh->chunk[0].size; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5O_size() */ @@ -665,11 +668,11 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) 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->chunk_size))) + 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->chunk_size, dxpl_id, buf) < 0) + 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") /* Check if we are still decoding the object header */ @@ -680,7 +683,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, addr, udata->chunk_size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) + if(H5O_chunk_deserialize(udata->oh, udata->common.addr, udata->size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize object header chunk") /* Set the fields for the chunk proxy */ @@ -969,6 +972,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, /* Check arguments */ HDassert(oh); + HDassert(H5F_addr_defined(addr)); HDassert(image); HDassert(udata->f); HDassert(udata->cont_msg_info); diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 4cacca3..79c4442 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -181,7 +181,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDmemset(&chk_udata, 0, sizeof(chk_udata)); chk_udata.oh = oh; chk_udata.chunkno = idx; - chk_udata.chunk_size = oh->chunk[idx].size; + 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))) @@ -216,7 +216,7 @@ done: */ herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, - unsigned chk_flags) + hbool_t dirtied) { herr_t ret_value = SUCCEED; /* Return value */ @@ -225,26 +225,15 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, /* check args */ HDassert(f); HDassert(chk_proxy); - HDassert(!(chk_flags & (unsigned)~(H5AC__DIRTIED_FLAG | H5AC__SIZE_CHANGED_FLAG))); /* Check for releasing first chunk */ if(0 == chk_proxy->chunkno) { - /* Check for resizing the first chunk */ - if(chk_flags & H5AC__SIZE_CHANGED_FLAG) { - /* Resize object header in cache */ - if(H5AC_resize_pinned_entry(chk_proxy->oh, chk_proxy->oh->chunk[0].size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize chunk in cache") - } /* end if */ /* Check for dirtying the first chunk */ - else if(chk_flags & H5AC__DIRTIED_FLAG) { + if(dirtied) { /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(chk_proxy->oh) < 0) + if(H5AC_mark_entry_dirty(chk_proxy->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end else/if */ - else { - /* Sanity check */ - HDassert(0 && "Unknown chunk proxy flag(s)?!?"); - } /* end else */ /* Decrement reference count of object header */ if(H5O_dec_rc(chk_proxy->oh) < 0) @@ -254,8 +243,8 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, chk_proxy = H5FL_FREE(H5O_chunk_proxy_t, chk_proxy); } /* end if */ else { - /* Release the chunk proxy from the cache, marking it dirty */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, chk_flags) < 0) + /* Release the chunk proxy from the cache, possibly marking it dirty */ + if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, (dirtied ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") } /* end else */ @@ -265,6 +254,48 @@ done: /*------------------------------------------------------------------------- + * Function: H5O_chunk_resize + * + * Purpose: Resize an object header chunk + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 6 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5O_chunk_resize, FAIL) + + /* check args */ + HDassert(oh); + HDassert(chk_proxy); + + /* Check for resizing first chunk */ + if(0 == chk_proxy->chunkno) { + /* Resize object header in cache */ + if(H5AC_resize_entry(oh, oh->chunk[0].size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize chunk in cache") + } /* end if */ + else { + /* Resize chunk in cache */ + if(H5AC_resize_entry(chk_proxy, oh->chunk[chk_proxy->chunkno].size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize chunk in cache") + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_chunk_resize() */ + + +/*------------------------------------------------------------------------- * Function: H5O_chunk_update_idx * * Purpose: Update the chunk index for a chunk proxy @@ -298,7 +329,7 @@ H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDmemset(&chk_udata, 0, sizeof(chk_udata)); chk_udata.oh = oh; chk_udata.chunkno = idx; - chk_udata.chunk_size = oh->chunk[idx].size; + 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))) @@ -350,7 +381,7 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDmemset(&chk_udata, 0, sizeof(chk_udata)); chk_udata.oh = oh; chk_udata.chunkno = idx; - chk_udata.chunk_size = oh->chunk[idx].size; + 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))) diff --git a/src/H5Ofill.c b/src/H5Ofill.c index ffea9e6..ebe1eb5 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -965,6 +965,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ /* Update the fill message */ if(buf != fill->buf) { + H5T_vlen_reclaim_elmt(fill->buf, fill->type, dxpl_id); H5MM_xfree(fill->buf); fill->buf = buf; } /* end if */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index c39db61..0dd4565 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1328,7 +1328,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_entry_dirty(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ @@ -1956,7 +1956,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ H5O_mesg_t *idx_msg = &oh->mesg[idx]; /* Pointer to message to modify */ - unsigned chk_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_copy_mesg) @@ -1984,10 +1984,10 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, /* Mark the message as modified */ idx_msg->dirty = TRUE; - chk_flags |= H5AC__DIRTIED_FLAG; + chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") chk_proxy = NULL; @@ -1998,7 +1998,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, done: /* Release chunk, if not already released */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 9351f50..6ff20b2 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -350,6 +350,7 @@ typedef struct H5O_common_cache_ud_t { unsigned merged_null_msgs; /* Number of null messages merged together */ hbool_t mesgs_modified; /* Whether any messages were modified when the object header was deserialized */ H5O_cont_msgs_t *cont_msg_info; /* Pointer to continuation messages to work on */ + haddr_t addr; /* Address of the prefix or chunk */ } H5O_common_cache_ud_t; /* Callback information for loading object header prefix from disk */ @@ -373,7 +374,7 @@ typedef struct H5O_chk_cache_ud_t { hbool_t decoding; /* Whether the object header is being decoded */ H5O_t *oh; /* Object header for this chunk */ unsigned chunkno; /* Index of chunk being brought in (for re-loads) */ - size_t chunk_size; /* Chunk size */ + size_t size; /* Size of chunk in the file */ H5O_common_cache_ud_t common; /* Common object header cache callback info */ } H5O_chk_cache_ud_t; @@ -558,8 +559,9 @@ H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); H5_DLL H5O_chunk_proxy_t *H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, - H5O_chunk_proxy_t *chk_proxy, unsigned chk_flags); + H5O_chunk_proxy_t *chk_proxy, hbool_t chk_dirtied); H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy); H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); /* Collect storage info for btree and heap */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 21fbdee..9624989 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1377,7 +1377,7 @@ H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_fac HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") if(scale_factor < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "scale factor must be > 0") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "scale factor must be >= 0") if(scale_type!=H5Z_SO_FLOAT_DSCALE && scale_type!=H5Z_SO_FLOAT_ESCALE && scale_type!=H5Z_SO_INT) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid scale type") diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 07b66e7..10922da 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1330,10 +1330,6 @@ done: * Programmer: J. Mainzer * Thursday, April 7, 2005 * - * Modifications: - * - * Done. - * *------------------------------------------------------------------------- */ herr_t @@ -1382,10 +1378,6 @@ done: * Programmer: J. Mainzer * Thursday, April 7, 2005 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 1c0bb61..09eb796 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -24,7 +24,7 @@ /* Public headers needed by this file */ #include "H5public.h" -#include "H5Cpublic.h" +#include "H5ACpublic.h" #include "H5Dpublic.h" #include "H5Fpublic.h" #include "H5FDpublic.h" diff --git a/src/H5SM.c b/src/H5SM.c index 19e5f8a..53d8b9f 100755 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -124,14 +124,12 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d H5O_shmesg_table_t sohm_table; /* SOHM message for superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table for file */ haddr_t table_addr = HADDR_UNDEF; /* Address of SOHM master table in file */ - unsigned num_indexes; /* Number of SOHM indices */ unsigned list_max, btree_min; /* Phase change limits for SOHM indices */ unsigned index_type_flags[H5O_SHMESG_MAX_NINDEXES]; /* Messages types stored in each index */ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Message size sharing threshhold for each index */ unsigned type_flags_used; /* Message type flags used, for sanity checking */ - hsize_t table_size; /* Size of SOHM master table in file */ unsigned x; /* Local index variable */ - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_TAG(H5SM_init, dxpl_id, H5AC__SOHM_TAG, FAIL) @@ -139,39 +137,38 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d /* File should not already have a SOHM table */ HDassert(f->shared->sohm_addr == HADDR_UNDEF); + /* Initialize master table */ + if(NULL == (table = H5FL_MALLOC(H5SM_master_table_t))) + HGOTO_ERROR(H5E_SOHM, H5E_CANTALLOC, FAIL, "memory allocation failed for SOHM table") + table->num_indexes = f->shared->sohm_nindexes; + table->table_size = H5SM_TABLE_SIZE(f); + /* Get information from fcpl */ - if(H5P_get(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &num_indexes)<0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't get number of indexes") - if(H5P_get(fc_plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, &index_type_flags)<0) + if(H5P_get(fc_plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, &index_type_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't get SOHM type flags") - if(H5P_get(fc_plist, H5F_CRT_SHMSG_LIST_MAX_NAME, &list_max)<0) + if(H5P_get(fc_plist, H5F_CRT_SHMSG_LIST_MAX_NAME, &list_max) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't get SOHM list maximum") - if(H5P_get(fc_plist, H5F_CRT_SHMSG_BTREE_MIN_NAME, &btree_min)<0) + if(H5P_get(fc_plist, H5F_CRT_SHMSG_BTREE_MIN_NAME, &btree_min) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't get SOHM btree minimum") if(H5P_get(fc_plist, H5F_CRT_SHMSG_INDEX_MINSIZE_NAME, &minsizes) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't get SOHM message min sizes") /* Verify that values are valid */ - if(num_indexes > H5O_SHMESG_MAX_NINDEXES) + if(table->num_indexes > H5O_SHMESG_MAX_NINDEXES) HGOTO_ERROR(H5E_SOHM, H5E_BADRANGE, FAIL, "number of indexes in property list is too large") /* Check that type flags weren't duplicated anywhere */ type_flags_used = 0; - for(x = 0; x < num_indexes; ++x) { + for(x = 0; x < table->num_indexes; ++x) { if(index_type_flags[x] & type_flags_used) HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "the same shared message type flag is assigned to more than one index") type_flags_used |= index_type_flags[x]; } /* end for */ - /* Initialize master table */ - if(NULL == (table = H5FL_MALLOC(H5SM_master_table_t))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "memory allocation failed for SOHM table") - - /* Set version and number of indexes in table and in superblock. + /* Check that number of indexes in table and in superblock make sense. * Right now we just use one byte to hold the number of indexes. */ - HDassert(num_indexes < 256); - table->num_indexes = num_indexes; + HDassert(table->num_indexes < 256); /* Check that list and btree cutoffs make sense. There can't be any * values greater than the list max but less than the btree min; the @@ -188,8 +185,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d /* Initialize all of the indexes, but don't allocate space for them to * hold messages until we actually need to write to them. */ - for(x = 0; x < table->num_indexes; x++) - { + for(x = 0; x < table->num_indexes; x++) { table->indexes[x].btree_min = btree_min; table->indexes[x].list_max = list_max; table->indexes[x].mesg_types = index_type_flags[x]; @@ -203,11 +199,13 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d table->indexes[x].index_type = H5SM_LIST; else table->indexes[x].index_type = H5SM_BTREE; + + /* Compute the size of a list index for this SOHM index */ + table->indexes[x].list_size = H5SM_LIST_SIZE(f, list_max); } /* end for */ /* Allocate space for the table on disk */ - table_size = H5SM_TABLE_SIZE(f) + (table->num_indexes * H5SM_INDEX_HEADER_SIZE(f)); - if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_size))) + if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM_TABLE, dxpl_id, (hsize_t)table->table_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "file allocation failed for SOHM table") /* Cache the new table */ @@ -233,7 +231,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d done: if(ret_value < 0) { if(table_addr != HADDR_UNDEF) - H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_addr, (hsize_t)H5SM_TABLE_SIZE(f)); + H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_addr, (hsize_t)table->table_size); if(table != NULL) table = H5FL_FREE(H5SM_master_table_t, table); } /* end if */ @@ -356,7 +354,12 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) /* Look up the master SOHM table */ if(H5F_addr_defined(f->shared->sohm_addr)) { - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ + + /* 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, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ else @@ -396,6 +399,7 @@ herr_t H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_addr) { H5SM_master_table_t *table = NULL; /* Shared object master table */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; /* Which index */ herr_t ret_value = SUCCEED; /* Return value */ @@ -405,8 +409,11 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad HDassert(f); HDassert(fheap_addr); + /* Set up user data for callback */ + 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, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ @@ -619,7 +626,6 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) { H5SM_list_t *list = NULL; /* List of messages */ hsize_t x; /* Counter variable */ - hsize_t size = 0; /* Size of list on disk */ size_t num_entries; /* Number of messages to create in list */ haddr_t addr = HADDR_UNDEF; /* Address of the list on disk */ haddr_t ret_value; @@ -632,22 +638,20 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) num_entries = header->list_max; /* Allocate list in memory */ - if((list = H5FL_MALLOC(H5SM_list_t)) == NULL) + if(NULL == (list = H5FL_MALLOC(H5SM_list_t))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list") - if((list->messages = (H5SM_sohm_t *)H5FL_ARR_MALLOC(H5SM_sohm_t, num_entries)) == NULL) + if(NULL == (list->messages = (H5SM_sohm_t *)H5FL_ARR_CALLOC(H5SM_sohm_t, num_entries))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list") /* Initialize messages in list */ - HDmemset(list->messages, 0, sizeof(H5SM_sohm_t) * num_entries); - for(x=0; xmessages[x].location = H5SM_NO_LOC; /* Point list at header passed in */ list->header = header; /* Allocate space for the list on disk */ - size = H5SM_LIST_SIZE(f, num_entries); - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM_INDEX, dxpl_id, size))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM_INDEX, dxpl_id, (hsize_t)header->list_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list") /* Put the list into the cache */ @@ -665,7 +669,7 @@ done: list = H5FL_FREE(H5SM_list_t, list); } /* end if */ if(addr != HADDR_UNDEF) - H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, dxpl_id, addr, size); + H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, dxpl_id, addr, (hsize_t)header->list_size); } /* end if */ FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF) @@ -931,7 +935,12 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, if(table) my_table = table; else { - if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ + + /* 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, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ @@ -1021,6 +1030,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, void *mesg, unsigned *mesg_flags) { H5SM_master_table_t *table = NULL; + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned cache_flags = H5AC__NO_FLAGS_SET; ssize_t index_num; htri_t tri_ret; @@ -1036,8 +1046,11 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, if(tri_ret == FALSE) HGOTO_DONE(FALSE) + /* Set up user data for callback */ + 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, f->shared->sohm_addr, f, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* "complex" sharing checks */ @@ -1416,6 +1429,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) { H5SM_master_table_t *table = NULL; unsigned cache_flags = H5AC__NO_FLAGS_SET; + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; void *mesg_buf = NULL; void *native_mesg = NULL; @@ -1431,8 +1445,11 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) /* Get message type */ type_id = sh_mesg->msg_type_id; + /* Set up user data for callback */ + 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, f->shared->sohm_addr, f, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ @@ -1846,6 +1863,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID, dxpl_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "unable to read object header") if(status) { + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned index_flags[H5O_SHMESG_MAX_NINDEXES]; /* Message flags for each index */ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Minimum message size for each index */ unsigned sohm_l2b; /* SOHM list-to-btree cutoff */ @@ -1867,8 +1885,11 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) HDassert(H5F_addr_defined(shared->sohm_addr)); HDassert(shared->sohm_nindexes > 0 && shared->sohm_nindexes <= H5O_SHMESG_MAX_NINDEXES); + /* Set up user data for callback */ + 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, shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get index conversion limits */ @@ -2008,6 +2029,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, H5HF_t *fheap = NULL; /* Fractal heap that contains shared messages */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ H5SM_master_table_t *table = NULL; /* SOHM master table */ + H5SM_table_cache_ud_t tbl_cache_udata; /* User-data for callback */ H5SM_list_t *list = NULL; /* SOHM index list for message type (if in list form) */ H5SM_index_header_t *header=NULL; /* Index header for message type */ H5SM_mesg_key_t key; /* Key for looking up message */ @@ -2024,8 +2046,11 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, HDassert(sh_mesg); HDassert(ref_count); + /* Set up user data for callback */ + 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, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &tbl_cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ @@ -2056,15 +2081,15 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, /* Try to find the message in the index */ if(header->index_type == H5SM_LIST) { - H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */ + H5SM_list_cache_ud_t lst_cache_udata; /* User-data for metadata cache callback */ size_t list_pos; /* Position of the message in the list */ /* Set up user data for metadata cache callback */ - cache_udata.f = f; - cache_udata.header = header; + lst_cache_udata.f = f; + 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, &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))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -2388,6 +2413,7 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, unsigned table_vers, unsigned num_indexes) { H5SM_master_table_t *table = NULL; /* SOHM master table */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2417,8 +2443,11 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, if(num_indexes == 0 || num_indexes > H5O_SHMESG_MAX_NINDEXES) HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "number of indexes must be between 1 and H5O_SHMESG_MAX_NINDEXES") + /* Set up user data for callback */ + 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, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") HDfprintf(stream, "%*sShared Message Master Table...\n", indent, ""); @@ -2563,6 +2592,7 @@ herr_t H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) { H5SM_master_table_t *table = NULL; /* SOHM master table */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ unsigned u; /* Local index variable */ @@ -2576,12 +2606,15 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) HDassert(hdr_size); HDassert(ih_info); + /* Set up user data for callback */ + 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, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get SOHM header size */ - *hdr_size = H5SM_TABLE_SIZE(f) + (table->num_indexes * H5SM_INDEX_HEADER_SIZE(f)); + *hdr_size = table->table_size; /* Loop over all the indices for shared messages */ for(u = 0; u < table->num_indexes; u++) { @@ -2603,7 +2636,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) } /* end if */ else { HDassert(table->indexes[u].index_type == H5SM_LIST); - ih_info->index_size += H5SM_LIST_SIZE(f, table->indexes[u].list_max); + ih_info->index_size += table->indexes[u].list_size; } /* end else */ /* Check for heap for this index */ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index cc22dcd..4a9338b 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -119,7 +119,6 @@ static H5SM_master_table_t * H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) { H5SM_master_table_t *table = NULL; - size_t size; /* Size of SOHM master table on disk */ 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 */ @@ -151,17 +150,17 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) 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 + /* Compute the size of the SOHM table header on disk. This is the "table" + * itself plus each index within the table */ - size = H5SM_TABLE_SIZE(f) + (table->num_indexes * H5SM_INDEX_HEADER_SIZE(f)); + 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, size))) + 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, size, dxpl_id, buf) < 0) + 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 */ @@ -172,11 +171,6 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM table signature") p += H5_SIZEOF_MAGIC; - /* Don't count the checksum in the table size yet, since it comes after - * all of the index headers - */ - HDassert((size_t)(p - (const uint8_t *)buf) == H5SM_TABLE_SIZE(f) - H5SM_SIZEOF_CHECKSUM); - /* 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))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed for SOHM indexes") @@ -210,16 +204,19 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) /* Address of the index's heap */ H5F_addr_decode(f, &p, &(table->indexes[x].heap_addr)); + + /* Compute the size of a list index for this SOHM index */ + table->indexes[x].list_size = H5SM_LIST_SIZE(f, table->indexes[x].list_max); } /* end for */ /* Read in checksum */ UINT32DECODE(p, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == size); + HDassert((size_t)(p - (const uint8_t *)buf) == table->table_size); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, (size - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(buf, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -270,7 +267,6 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma if(table->cache_info.is_dirty) { uint8_t *buf; /* Temporary buffer */ uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Header size on disk */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t x; /* Counter variable */ @@ -283,11 +279,8 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma if(NULL == (wb = H5WB_wrap(tbl_buf, sizeof(tbl_buf)))) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "can't wrap buffer") - /* Encode the master table and all of the index headers as one big blob */ - size = H5SM_TABLE_SIZE(f) + (H5SM_INDEX_HEADER_SIZE(f) * table->num_indexes); - /* Get a pointer to a buffer that's large enough for serialized table */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) + if(NULL == (buf = (uint8_t *)H5WB_actual(wb, table->table_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "can't get actual buffer") /* Get temporary pointer to buffer for serialized table */ @@ -328,12 +321,12 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma } /* end for */ /* Compute checksum on buffer */ - computed_chksum = H5_checksum_metadata(buf, (size - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(buf, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); UINT32ENCODE(p, computed_chksum); /* Write the table to disk */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_SOHM_TABLE, addr, size, dxpl_id, buf) < 0) + 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") table->cache_info.is_dirty = FALSE; @@ -433,7 +426,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_table_size(const H5F_t *f, const H5SM_master_table_t *table, size_t *size_ptr) +H5SM_table_size(const H5F_t UNUSED *f, const H5SM_master_table_t *table, size_t *size_ptr) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_size) @@ -443,7 +436,7 @@ H5SM_table_size(const H5F_t *f, const H5SM_master_table_t *table, size_t *size_p HDassert(size_ptr); /* Set size value */ - *size_ptr = H5SM_TABLE_SIZE(f) + (table->num_indexes * H5SM_INDEX_HEADER_SIZE(f)); + *size_ptr = table->table_size; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SM_table_size() */ @@ -467,7 +460,6 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) 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 */ - size_t size; /* Size of SOHM list on disk */ 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 */ @@ -497,15 +489,12 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf)))) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, NULL, "can't wrap buffer") - /* Compute the size of the SOHM list on disk */ - size = H5SM_LIST_SIZE(udata->f, udata->header->num_messages); - /* Get a pointer to a buffer that's large enough for serialized list index */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) + 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, size, dxpl_id, buf) < 0) + 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 */ @@ -528,10 +517,10 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) UINT32DECODE(p, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == size); + HDassert((size_t)(p - buf) <= udata->header->list_size); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, (size - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(buf, ((size_t)(p - buf) - H5SM_SIZEOF_CHECKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -589,7 +578,6 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis H5SM_bt2_ctx_t ctx; /* Message encoding context */ uint8_t *buf; /* Temporary buffer */ uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Header size on disk */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t mesgs_written; /* Number of messages written to list */ size_t x; /* Local index variable */ @@ -598,10 +586,8 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf)))) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "can't wrap buffer") - size = H5SM_LIST_SIZE(f, list->header->num_messages); - /* Get a pointer to a buffer that's large enough for serialized list index */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size))) + 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 */ @@ -626,12 +612,12 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis HDassert(mesgs_written == list->header->num_messages); /* Compute checksum on buffer */ - computed_chksum = H5_checksum_metadata(buf, (size - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); UINT32ENCODE(p, computed_chksum); /* Write the list to disk */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_SOHM_INDEX, addr, size, dxpl_id, buf) < 0) + 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; @@ -681,7 +667,7 @@ H5SM_list_dest(H5F_t *f, H5SM_list_t* 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)H5SM_LIST_SIZE(f, list->header->list_max)) < 0) + 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 */ @@ -754,7 +740,7 @@ H5SM_list_size(const H5F_t UNUSED *f, const H5SM_list_t *list, size_t *size_ptr) HDassert(size_ptr); /* Set size value */ - *size_ptr = H5SM_LIST_SIZE(f, list->header->list_max); + *size_ptr = list->header->list_size; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SM_list_size() */ diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 3aab317..84c2bf4 100755 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -62,11 +62,6 @@ + MAX(H5SM_HEAP_LOC_SIZE, H5SM_OH_LOC_SIZE(f)) /* Entry */ \ ) -#define H5SM_TABLE_SIZE(f) ( \ - (unsigned)H5_SIZEOF_MAGIC /* Signature */ \ - + (unsigned)H5SM_SIZEOF_CHECKSUM /* Checksum */ \ - ) - #define H5SM_INDEX_HEADER_SIZE(f) ( \ (unsigned)1 /* Whether index is a list or B-tree */ \ + (unsigned)1 /* Version of index format */ \ @@ -77,10 +72,26 @@ + H5F_SIZEOF_ADDR(f) /* Address of heap */ \ ) +/* Format overhead for all SOHM tree metadata in the file */ +#define H5SM_METADATA_PREFIX_SIZE ( \ + H5_SIZEOF_MAGIC /* Signature */ \ + + H5SM_SIZEOF_CHECKSUM /* Checksum */ \ + ) + +#define H5SM_TABLE_SIZE(f) ( \ + /* General metadata fields */ \ + H5SM_METADATA_PREFIX_SIZE \ + \ + /* Indices */ \ + + ((f)->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)) \ + ) + #define H5SM_LIST_SIZE(f, num_mesg) ( \ - (unsigned) H5_SIZEOF_MAGIC /* Signature */ \ - + (H5SM_SOHM_ENTRY_SIZE(f) * num_mesg) /* Message entries */ \ - + (unsigned)H5SM_SIZEOF_CHECKSUM /* Checksum */ \ + /* General metadata fields */ \ + H5SM_METADATA_PREFIX_SIZE \ + \ + /* Message entries */ \ + + (H5SM_SOHM_ENTRY_SIZE(f) * num_mesg) \ ) #define H5SM_B2_NODE_SIZE 512 @@ -154,6 +165,7 @@ typedef enum { /* Typedef for a SOHM index header */ typedef struct { +/* Stored */ unsigned mesg_types; /* Bit flag vector of message types */ size_t min_mesg_size; /* number of messages being tracked */ size_t list_max; /* >= this many messages, index with a B-tree */ @@ -162,6 +174,9 @@ typedef struct { H5SM_index_type_t index_type; /* Is the index a list or a B-tree? */ haddr_t index_addr; /* Address of the actual index (list or B-tree) */ haddr_t heap_addr; /* Address of the fheap used to store shared messages */ + +/* Not stored */ + size_t list_size; /* Size of list index on disk */ } H5SM_index_header_t; /* Typedef for a SOHM list */ @@ -173,12 +188,12 @@ typedef struct { H5SM_sohm_t *messages; /* Actual list, stored as an array */ } H5SM_list_t; - /* Typedef for shared object header message master table */ struct H5SM_master_table_t { /* Information for H5AC cache functions, _must_ be first field in structure */ H5AC_info_t cache_info; + size_t table_size; /* Size of table on disk */ unsigned num_indexes; /* Number of indexes */ H5SM_index_header_t *indexes; /* Array of num_indexes indexes */ }; @@ -219,9 +234,14 @@ typedef struct H5SM_bt2_ctx_t { uint8_t sizeof_addr; /* Size of file addresses */ } H5SM_bt2_ctx_t; -/* Callback info for loading a shared message index into the cache */ +/* Callback info for loading a shared message table index into the cache */ +typedef struct H5SM_table_cache_ud_t { + H5F_t *f; /* File that shared message index stored as a table is in */ +} H5SM_table_cache_ud_t; + +/* Callback info for loading a shared message list index into the cache */ typedef struct H5SM_list_cache_ud_t { - H5F_t *f; /* File that shared message index stored as a list is in */ + H5F_t *f; /* File that shared message index stored as a table is in */ H5SM_index_header_t *header; /* Index header for this list */ } H5SM_list_cache_ud_t; diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 48f8ff9..5f4a89b 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -91,10 +91,14 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, /* Check for shared messages being enabled */ if(H5F_addr_defined(f->shared->sohm_addr)) { H5SM_index_header_t *header; /* Index header for message type */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; /* Table index for message type */ + /* Set up user data for callback */ + 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, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index be09488..6069577 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -241,7 +241,7 @@ #define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -266,7 +266,7 @@ #define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_sU, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -291,17 +291,17 @@ #define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_uS, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Xx, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -337,17 +337,17 @@ #define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Su, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -374,7 +374,7 @@ #define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_su, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -401,12 +401,12 @@ #define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_us, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, long double, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } /* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN @@ -445,7 +445,7 @@ #define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ff, long double, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_HI_LO_BIT_SET(TYP, V, LO, HI) { \ @@ -536,7 +536,7 @@ } #define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_xF, long double, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } /* Quincey added the condition branch (else if (*(S) != (ST)((DT)(*(S))))). @@ -589,7 +589,7 @@ } #define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_Fx, long double, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } /* Since all "no exception" cores do the same thing (assign the value in the @@ -601,7 +601,7 @@ } /* The main part of every integer hardware conversion macro */ -#define H5T_CONV(GUTS,ATYPE,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ size_t elmtno; /*element number */ \ size_t sprec; /*source precision */ \ size_t dprec; /*destination precision */ \ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index afa6ceb..c70eea0 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -129,6 +129,7 @@ H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); H5_DLL herr_t H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_op_data); +H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id); H5_DLL herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info); H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 8a6ee05..95f4086 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -1303,3 +1303,44 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_vlen_get_alloc_info() */ + +/*------------------------------------------------------------------------- + * Function: H5T_vlen_reclaim_elmt + * + * Purpose: Alternative method to reclaim any VL data for a buffer element. + * + * Use this function when the datatype is already available, but + * the allocation info is needed from the dxpl_id before jumping + * into recursion. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mike McGreevy + * May 11, 2010 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id) +{ + H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ + H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ + herr_t ret_value = SUCCEED; /* return value */ + + HDassert(dt); + HDassert(elem); + + FUNC_ENTER_NOAPI(H5T_vlen_reclaim_elmt, FAIL) + + /* Get VL allocation info */ + if (H5T_vlen_get_alloc_info(dxpl_id, &vl_alloc_info) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") + + /* Recurse on buffer to free dynamic fields */ + ret_value = H5T_vlen_reclaim_recurse(elem,dt,vl_alloc_info->free_func,vl_alloc_info->free_info); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5T_vlen_reclaim_elmt */ diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index 740eab5..dbd8d94 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -21,6 +21,272 @@ #ifndef H5API_ADPT_H #define H5API_ADPT_H +/* This will only be defined if HDF5 was built with CMake */ +#ifdef H5_BUILT_AS_DYNAMIC_LIB + +#if defined (hdf5_EXPORTS) + #define _HDF5DLL_ +#else + #define _HDF5USEDLL_ +#endif + +#if defined (hdf5_test_EXPORTS) + #define _HDF5TESTDLL_ +#else + #define _HDF5TESTUSEDLL_ +#endif + +#if defined (hdf5_tools_EXPORTS) + #define _HDF5TOOLSDLL_ +#else + #define _HDF5TOOLSUSEDLL_ +#endif + +#if defined (hdf5_cpp_EXPORTS) + #define HDF5_CPPDLL_EXPORTS +#else + #define HDF5CPP_USEDLL +#endif + +#if defined (hdf5_hl_EXPORTS) + #define _HDF5_HLDLL_EXPORTS_ +#else + #define _HDF5USEHLDLL_ +#endif + +#if defined (hdf5_hl_cpp_EXPORTS) + #define HDF5_HL_CPPDLL_EXPORTS +#else + #define HDF5USE_HLCPPDLL +#endif + +#if defined (hdf5_f90cstub_EXPORTS) + #define HDF5FORT_CSTUB_DLL_EXPORTS +#else + #define HDF5FORT_CSTUB_USEDLL +#endif + +#if defined (hdf5_test_f90cstub_EXPORTS) + #define HDF5FORTTEST_CSTUB_DLL_EXPORTS +#endif + +#if defined (hdf5_hl_f90cstub_EXPORTS) + #define HDF5_HL_F90CSTUBDLL_EXPORTS +#endif + +#if defined(hdf5_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_DLL __declspec(dllexport) + #define H5_DLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_DLL __attribute__ ((visibility("default"))) + #define H5_DLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_DLL __declspec(dllimport) + #define H5_DLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_DLL __attribute__ ((visibility("default"))) + #define H5_DLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5_DLL + #define H5_DLL + #define H5_DLLVAR extern +#endif /* _HDF5DLL_ */ + +#if defined(hdf5_test_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5TEST_DLL __declspec(dllexport) + #define H5TEST_DLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5TEST_DLL __attribute__ ((visibility("default"))) + #define H5TEST_DLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5TEST_DLL __declspec(dllimport) + #define H5TEST_DLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5TEST_DLL __attribute__ ((visibility("default"))) + #define H5TEST_DLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5TEST_DLL + #define H5TEST_DLL + #define H5TEST_DLLVAR extern +#endif /* H5TEST_DLL */ + +#if defined(hdf5_tools_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5TOOLS_DLL __declspec(dllexport) + #define H5TOOLS_DLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5TOOLS_DLL __attribute__ ((visibility("default"))) + #define H5TOOLS_DLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5TOOLS_DLL __declspec(dllimport) + #define H5TOOLS_DLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5TOOLS_DLL __attribute__ ((visibility("default"))) + #define H5TOOLS_DLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5TOOLS_DLL + #define H5TOOLS_DLL + #define H5TOOLS_DLLVAR extern +#endif /* H5TOOLS_DLL */ + +#if defined(hdf5_cpp_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_DLLCPP __declspec(dllexport) + #define H5_DLLCPPVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_DLLCPP __attribute__ ((visibility("default"))) + #define H5_DLLCPPVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_DLLCPP __declspec(dllimport) + #define H5_DLLCPPVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_DLLCPP __attribute__ ((visibility("default"))) + #define H5_DLLCPPVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5_DLLCPP + #define H5_DLLCPP + #define H5_DLLCPPVAR extern +#endif /* H5_DLLCPP */ + +#if defined(hdf5_hl_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_HLDLL __declspec(dllexport) + #define H5_HLDLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_HLDLL __attribute__ ((visibility("default"))) + #define H5_HLDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_HLDLL __declspec(dllimport) + #define H5_HLDLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_HLDLL __attribute__ ((visibility("default"))) + #define H5_HLDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5_HLDLL + #define H5_HLDLL + #define H5_HLDLLVAR extern +#endif /* H5_HLDLL */ + +#if defined(hdf5_hl_cpp_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_HLCPPDLL __declspec(dllexport) + #define H5_HLCPPDLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_HLCPPDLL __attribute__ ((visibility("default"))) + #define H5_HLCPPDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_HLCPPDLL __declspec(dllimport) + #define H5_HLCPPDLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_HLCPPDLL __attribute__ ((visibility("default"))) + #define H5_HLCPPDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5_HLCPPDLL + #define H5_HLCPPDLL + #define H5_HLCPPDLLVAR extern +#endif /* H5_HLCPPDLL */ + +#if defined(hdf5_f90cstub_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_FCDLL __declspec(dllexport) + #define H5_FCDLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_FCDLL __attribute__ ((visibility("default"))) + #define H5_FCDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_FCDLL __declspec(dllimport) + #define H5_FCDLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_FCDLL __attribute__ ((visibility("default"))) + #define H5_FCDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5_FCDLL + #define H5_FCDLL + #define H5_FCDLLVAR extern +#endif /* H5_FCDLL */ + +#if defined(hdf5_f90Ctest_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_FCTESTDLL __declspec(dllexport) + #define H5_FCTESTDLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_FCTESTDLL __attribute__ ((visibility("default"))) + #define H5_FCTESTDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5_FCTESTDLL __declspec(dllimport) + #define H5_FCTESTDLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5_FCTESTDLL __attribute__ ((visibility("default"))) + #define H5_FCTESTDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef H5_FCTESTDLL + #define H5_FCTESTDLL + #define H5_FCTESTDLLVAR extern +#endif /* H5_FCTESTDLL */ + +#if defined(hdf5_hl_f90cstub_EXPORTS) + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define HDF5_HL_F90CSTUBDLL __declspec(dllexport) + #define HDF5_HL_F90CSTUBDLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define HDF5_HL_F90CSTUBDLL __attribute__ ((visibility("default"))) + #define HDF5_HL_F90CSTUBDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#else + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define HDF5_HL_F90CSTUBDLL __declspec(dllimport) + #define HDF5_HL_F90CSTUBDLLVAR __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define HDF5_HL_F90CSTUBDLL __attribute__ ((visibility("default"))) + #define HDF5_HL_F90CSTUBDLLVAR extern __attribute__ ((visibility("default"))) + #endif +#endif + +#ifndef HDF5_HL_F90CSTUBDLL + #define HDF5_HL_F90CSTUBDLL + #define HDF5_HL_F90CSTUBDLLVAR extern +#endif /* HDF5_HL_F90CSTUBDLL */ + +#else +/* This is the original HDFGroup defined preprocessor code which should still work + * with the VS projects that are maintained by "The HDF Group" + * This will be removed after the next release. + */ + #if defined(_WIN32) #if defined(_HDF5DLL_) @@ -47,6 +313,18 @@ #define H5TEST_DLLVAR extern #endif /* _HDF5TESTDLL_ */ +#if defined(_HDF5TOOLSDLL_) +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#define H5TOOLS_DLL __declspec(dllexport) +#define H5TOOLS_DLLVAR extern __declspec(dllexport) +#elif defined(_HDF5TOOLSUSEDLL_) +#define H5TOOLS_DLL __declspec(dllimport) +#define H5TOOLS_DLLVAR __declspec(dllimport) +#else +#define H5TOOLS_DLL +#define H5TOOLS_DLLVAR extern +#endif /* _HDF5TOOLSDLL_ */ + #if defined(_HDF5_HLDLL_EXPORTS_) #pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5_HLDLL __declspec(dllexport) @@ -117,6 +395,8 @@ #define H5_DLLCPP #define H5TEST_DLL #define H5TEST_DLLVAR extern +#define H5TOOLS_DLL +#define H5TOOLS_DLLVAR extern #define H5_FCDLL #define H5_FCDLLVAR extern #define H5_FCTESTDLL @@ -125,3 +405,4 @@ #endif /* H5API_ADPT_H */ +#endif /* */ diff --git a/src/H5config.h.in b/src/H5config.h.in index 8210f38..5c9e1f2 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -676,6 +676,12 @@ # endif #endif +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + /* Define to empty if `const' does not conform to ANSI C. */ #undef const diff --git a/src/H5detect.c b/src/H5detect.c index 4490fb5..29955a1 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -119,9 +119,9 @@ static volatile int nd_g = 0, na_g = 0; static void print_results(int nd, detected_t *d, int na, malign_t *m); static void iprint(detected_t *); static int byte_cmp(int, const void *, const void *); -static int bit_cmp(int, int *, void *, void *); +static int bit_cmp(int, int *, volatile void *, volatile void *); static void fix_order(int, int, int, int *, const char **); -static int imp_bit(int, int *, void *, void *); +static int imp_bit(int, int *, volatile void *, volatile void *); static unsigned long find_bias(int, int, int *, void *); static void precision (detected_t*); static void print_header(void); @@ -279,6 +279,9 @@ precision (detected_t *d) * absence of implicit mantissa bit, and exponent bias and * initializes a detected_t structure with those properties. * + * Note: 'volatile' is used for the variables below to prevent the + * compiler from optimizing them away. + * * Return: void * * Programmer: Robb Matzke @@ -927,11 +930,11 @@ byte_cmp(int n, const void *_a, const void *_b) *------------------------------------------------------------------------- */ static int -bit_cmp(int nbytes, int *perm, void *_a, void *_b) +bit_cmp(int nbytes, int *perm, volatile void *_a, volatile void *_b) { int i, j; - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; + volatile unsigned char *a = (volatile unsigned char *) _a; + volatile unsigned char *b = (volatile unsigned char *) _b; unsigned char aa, bb; for (i = 0; i < nbytes; i++) { @@ -1048,10 +1051,10 @@ fix_order(int n, int first, int last, int *perm, const char **mesg) *------------------------------------------------------------------------- */ static int -imp_bit(int n, int *perm, void *_a, void *_b) +imp_bit(int n, int *perm, volatile void *_a, volatile void *_b) { - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; + volatile unsigned char *a = (volatile unsigned char *) _a; + volatile unsigned char *b = (volatile unsigned char *) _b; int changed, major, minor; int msmb; /*most significant mantissa bit */ diff --git a/src/H5err.txt b/src/H5err.txt index 6ab1351..71d27a6 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -162,7 +162,6 @@ MINOR, CACHE, H5E_PROTECT, Protected metadata error MINOR, CACHE, H5E_NOTCACHED, Metadata not currently cached MINOR, CACHE, H5E_SYSTEM, Internal error detected MINOR, CACHE, H5E_CANTINS, Unable to insert metadata into cache -MINOR, CACHE, H5E_CANTRENAME, Unable to rename metadata MINOR, CACHE, H5E_CANTPROTECT, Unable to protect metadata MINOR, CACHE, H5E_CANTUNPROTECT, Unable to unprotect metadata MINOR, CACHE, H5E_CANTPIN, Unable to pin cache entry @@ -197,6 +196,7 @@ MINOR, OHDR, H5E_CANTDELETE, Can't delete message MINOR, OHDR, H5E_BADITER, Iteration failed MINOR, OHDR, H5E_CANTPACK, Can't pack messages MINOR, OHDR, H5E_CANTRESET, Can't reset object +MINOR, OHDR, H5E_CANTRENAME, Unable to rename object # Group related errors MINOR, GROUP, H5E_CANTOPENOBJ, Can't open object @@ -225,7 +225,7 @@ MINOR, PLIST, H5E_DUPCLASS, Duplicate class name in parent class MINOR, LINK, H5E_TRAVERSE, Link traversal failure MINOR, LINK, H5E_NLINKS, Too many soft links in path MINOR, LINK, H5E_NOTREGISTERED, Link class not registered -MINOR, LINK, H5E_CANTMOVE, Move callback returned error +MINOR, LINK, H5E_CANTMOVE, Can't move object MINOR, LINK, H5E_CANTSORT, Can't sort objects # Parallel MPI errors diff --git a/src/H5private.h b/src/H5private.h index e18bec6..5b8d123 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -142,7 +142,11 @@ #ifdef _WIN32 -#define VC_EXTRALEAN /*Exclude rarely-used stuff from Windows headers */ +#ifdef H5_HAVE_WINSOCK_H +#include +#endif + +#define WIN32_LEAN_AND_MEAN /*Exclude rarely-used stuff from Windows headers */ #include #include /* For _getcwd() */ diff --git a/src/H5public.h b/src/H5public.h index d17de1b..e07c4e3 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -71,10 +71,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 69 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 73 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "FA_a4" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.69-FA_a4" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.73-FA_a4" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 7ffd5a5..0e3d148 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -276,12 +276,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ @@ -445,7 +445,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 59 +LT_VERS_REVISION = 63 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index a3032e5..ba233e8 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -65,4 +65,4 @@ Clear file buffers before write: @CLEARFILEBUF@ GPFS: @GPFS@ Strict File Format Checks: @STRICT_FORMAT_CHECKS@ Optimization Instrumentation: @INSTRUMENT@ - Linux Large File Support (LFS): @LINUX_LFS@ + Large File Support (LFS): @LARGEFILE@ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..ae5786a --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,312 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (H5_TEST) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (TEST_LIB_SRCS + ${HDF5_TEST_SOURCE_DIR}/h5test.c + ${HDF5_TEST_SOURCE_DIR}/testframe.c + ${HDF5_TEST_SOURCE_DIR}/cache_common.c +) + +SET (TEST_LIB_HEADERS + ${HDF5_TEST_SOURCE_DIR}/h5test.h +) + +#----------------------------------------------------------------------------- +# Generate the H5srcdir_str.h file containing user settings needed by compilation +#----------------------------------------------------------------------------- +SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) + +ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +IF (BUILD_SHARED_LIBS) + IF (MSVC) + TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") + ENDIF (MSVC) +ENDIF (BUILD_SHARED_LIBS) +TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TEST_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) + +SET (testhdf5_SRCS + ${HDF5_TEST_SOURCE_DIR}/testhdf5.c + ${HDF5_TEST_SOURCE_DIR}/tarray.c + ${HDF5_TEST_SOURCE_DIR}/tattr.c + ${HDF5_TEST_SOURCE_DIR}/tchecksum.c + ${HDF5_TEST_SOURCE_DIR}/tconfig.c + ${HDF5_TEST_SOURCE_DIR}/tcoords.c + ${HDF5_TEST_SOURCE_DIR}/tfile.c + ${HDF5_TEST_SOURCE_DIR}/tgenprop.c + ${HDF5_TEST_SOURCE_DIR}/th5o.c + ${HDF5_TEST_SOURCE_DIR}/th5s.c + ${HDF5_TEST_SOURCE_DIR}/theap.c + ${HDF5_TEST_SOURCE_DIR}/tid.c + ${HDF5_TEST_SOURCE_DIR}/titerate.c + ${HDF5_TEST_SOURCE_DIR}/tmeta.c + ${HDF5_TEST_SOURCE_DIR}/tmisc.c + ${HDF5_TEST_SOURCE_DIR}/trefer.c + ${HDF5_TEST_SOURCE_DIR}/trefstr.c + ${HDF5_TEST_SOURCE_DIR}/tselect.c + ${HDF5_TEST_SOURCE_DIR}/tskiplist.c + ${HDF5_TEST_SOURCE_DIR}/tsohm.c + ${HDF5_TEST_SOURCE_DIR}/ttime.c + ${HDF5_TEST_SOURCE_DIR}/ttst.c + ${HDF5_TEST_SOURCE_DIR}/tunicode.c + ${HDF5_TEST_SOURCE_DIR}/tvltypes.c + ${HDF5_TEST_SOURCE_DIR}/tvlstr.c +) + +#-- Adding test for testhdf5 +ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) +H5_NAMING (testhdf5) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testhdf5 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_TEST (NAME testhdf5 COMMAND $) + +MACRO (ADD_H5_TEST file) + ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + H5_NAMING (${file}) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${file} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + + ADD_TEST (NAME ${file} COMMAND $) +ENDMACRO (ADD_H5_TEST file) + +SET (H5_TESTS + lheap + ohdr + stab + gheap + #cache + #cache_api + #cache_tagging + pool + hyperslab + istore + bittests + dt_arith + dtypes + cmpd_dset + extend + external + objcopy + links + unlink + big + mtime + fillval + mount + flush1 + flush2 + app_ref + enum + set_extent + #ttsafe + getname + vfd + ntypes + dangle + dtransform + reserved + cross_read + freespace + mf + farray + earray + btree2 + fheap +) + +FOREACH (test ${H5_TESTS}) + ADD_H5_TEST(${test}) +ENDFOREACH (test ${H5_TESTS}) + +SET (H5_CHECK_TESTS +) + +FOREACH (chktest ${H5_CHECK_TESTS}) + ADD_H5_TEST(${chktest}) +ENDFOREACH (chktest ${H5_CHECK_TESTS}) + +#-- Allow extra time for fheap to complete 30min +IF (WIN32) + SET_TESTS_PROPERTIES (fheap PROPERTIES TIMEOUT 2500) +ENDIF (WIN32) + +#-- Adding test for cache +ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +H5_NAMING (cache) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (cache + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME cache COMMAND $) + +#-- Adding test for cache_api +ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +H5_NAMING (cache_api) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (cache_api + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME cache_api COMMAND $) + +#-- Adding test for cache_tagging +ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +H5_NAMING (cache_tagging) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (cache_tagging + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME cache_tagging COMMAND $) + +#-- Adding test for ttsafe +SET (ttsafe_SRCS + ttsafe.c + ttsafe_dcreate.c + ttsafe_error.c + ttsafe_cancel.c + ttsafe_acreate.c +) + +ADD_EXECUTABLE (ttsafe ${ttsafe_SRCS}) +H5_NAMING (ttsafe) +TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME ttsafe COMMAND $) + +#-- Copy all the HDF5 files from the test directory into the source directory +SET (HDF5_REFERENCE_TEST_FILES + tnullspace.h5 +) + +FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) +ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + +#-- Copy all the HDF5 files from the test directory into the source directory +SET (HDF5_REFERENCE_TEST_FILES + be_data.h5 + be_extlink1.h5 + be_extlink2.h5 + corrupt_stab_msg.h5 + deflate.h5 + family_v16_00000.h5 + family_v16_00001.h5 + family_v16_00002.h5 + family_v16_00003.h5 + filespace_1_6.h5 + filespace_1_8.h5 + fill_old.h5 + group_old.h5 + le_data.h5 + le_extlink1.h5 + le_extlink2.h5 + mergemsg.h5 + noencoder.h5 + specmetaread.h5 + tarrold.h5 + tbad_msg_count.h5 + tbogus.h5 + test_filters_be.hdf5 + test_filters_le.hdf5 + th5s.h5 + tlayouto.h5 + tmtimen.h5 + tmtimeo.h5 + vms_data.h5 +) + +FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${H5_TEST_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file} to ${dest}") + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${H5_TEST_SOURCE_DIR}/${h5_file} ${dest} + ) +ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + +# generator executables +IF (CREATE_GENERATORS) + SET (H5_GENERATORS + gen_bad_ohdr + gen_bogus + gen_cross + gen_deflate + gen_filters + gen_new_array + gen_new_fill + gen_new_group + gen_new_mtime + gen_new_super + gen_noencoder + gen_nullspace + gen_udlinks + space_overflow + gen_filespace + gen_specmetaread + ) + + FOREACH (gen ${H5_GENERATORS}) + ADD_EXECUTABLE (${gen} ${HDF5_TEST_SOURCE_DIR}/${gen}.c) + H5_NAMING (${gen}) + TARGET_LINK_LIBRARIES (${gen} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + ENDFOREACH (gen ${H5_GENERATORS}) + +ENDIF (CREATE_GENERATORS) diff --git a/test/Makefile.in b/test/Makefile.in index 21e4cfc..2a0b13d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -524,12 +524,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/test/cache.c b/test/cache.c index 364ec75..0e6cb42 100644 --- a/test/cache.c +++ b/test/cache.c @@ -25,7 +25,84 @@ #include "H5ACprivate.h" #include "cache_common.h" + +/* private typedef declarations: */ +struct flush_cache_test_spec +{ + int entry_num; + int entry_type; + 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_destroyed; +}; + +struct pe_flush_cache_test_spec +{ + int entry_num; + int entry_type; + int entry_index; + hbool_t insert_flag; + unsigned int flags; + 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_destroyed; +}; + +struct fo_flush_entry_check +{ + int entry_num; + int entry_type; + int entry_index; + size_t expected_size; + hbool_t in_cache; + hbool_t at_main_addr; + 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_destroyed; +}; + +struct fo_flush_cache_test_spec +{ + int entry_num; + int entry_type; + int entry_index; + hbool_t insert_flag; + unsigned int flags; + hbool_t resize_flag; + size_t new_size; + int num_pins; + int pin_type[MAX_PINS]; + 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_destroyed; +}; + +struct move_entry_test_spec +{ + int entry_type; + int entry_index; + hbool_t is_dirty; + hbool_t is_pinned; +}; + + /* private function declarations: */ static unsigned smoke_check_1(void); @@ -59,7 +136,6 @@ static void check_flush_cache__single_entry_test(H5F_t * file_ptr, int entry_type, int entry_idx, hbool_t insert_flag, - hbool_t dirty_flag, unsigned int flags, unsigned int flush_flags, hbool_t expected_loaded, @@ -70,7 +146,6 @@ static void check_flush_cache__pinned_single_entry_test(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, @@ -97,16 +172,16 @@ 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); -static unsigned check_rename_entry(void); -static void check_rename_entry__run_test(H5F_t * file_ptr, int test_num, - struct rename_entry_test_spec * spec_ptr); +static unsigned check_move_entry(void); +static void check_move_entry__run_test(H5F_t * file_ptr, int test_num, + struct move_entry_test_spec * spec_ptr); static unsigned check_pin_protected_entry(void); static unsigned check_resize_entry(void); static unsigned check_evictions_enabled(void); static unsigned check_destroy_pinned_err(void); static unsigned check_destroy_protected_err(void); static unsigned check_duplicate_insert_err(void); -static unsigned check_rename_err(void); +static unsigned check_move_err(void); static unsigned check_double_pin_err(void); static unsigned check_double_unpin_err(void); static unsigned check_pin_entry_errs(void); @@ -139,7 +214,7 @@ static unsigned check_notify_cb(void); /*------------------------------------------------------------------------- * Function: smoke_check_1() * - * Purpose: A basic functional test, inserts, destroys, and renames in + * Purpose: A basic functional test, inserts, destroys, and moves in * the mix, along with repeated protects and unprotects. * All entries are marked as clean. * @@ -162,7 +237,6 @@ smoke_check_1(void) { const char * fcn_name = "smoke_check_1"; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = FALSE; int dirty_unprotects = FALSE; int dirty_destroys = FALSE; hbool_t display_stats = FALSE; @@ -202,11 +276,10 @@ smoke_check_1(void) /* verbose */ FALSE, /* reset_stats */ TRUE, /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, + /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -221,11 +294,10 @@ smoke_check_1(void) /* verbose */ FALSE, /* reset_stats */ TRUE, /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, + /* display_detailed_stats */ FALSE, /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, + /* do_moves */ TRUE, + /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -240,11 +312,10 @@ smoke_check_1(void) /* verbose */ FALSE, /* reset_stats */ TRUE, /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, + /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -272,7 +343,6 @@ smoke_check_1(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -297,7 +367,6 @@ smoke_check_1(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -330,7 +399,7 @@ smoke_check_1(void) * Function: smoke_check_2() * * Purpose: A basic functional test, with inserts, destroys, and - * renames in the mix, along with some repeated protects + * moves in the mix, along with some repeated protects * and unprotects. About half the entries are marked as * dirty. * @@ -353,7 +422,6 @@ smoke_check_2(void) { const char * fcn_name = "smoke_check_2"; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = TRUE; int dirty_unprotects = TRUE; int dirty_destroys = TRUE; hbool_t display_stats = FALSE; @@ -395,9 +463,8 @@ smoke_check_2(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -414,9 +481,8 @@ smoke_check_2(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, + /* do_moves */ TRUE, + /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -433,9 +499,8 @@ smoke_check_2(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -463,7 +528,6 @@ smoke_check_2(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -488,7 +552,6 @@ smoke_check_2(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -521,7 +584,7 @@ smoke_check_2(void) * Function: smoke_check_3() * * Purpose: A basic functional test on a tiny cache, with inserts, - * destroys, and renames in the mix, along with repeated + * destroys, and moves in the mix, along with repeated * protects and unprotects. All entries are marked as clean. * * Return: void @@ -543,7 +606,6 @@ smoke_check_3(void) { const char * fcn_name = "smoke_check_3"; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = FALSE; int dirty_unprotects = FALSE; int dirty_destroys = FALSE; hbool_t display_stats = FALSE; @@ -585,9 +647,8 @@ smoke_check_3(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -604,9 +665,8 @@ smoke_check_3(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, + /* do_moves */ TRUE, + /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -623,9 +683,8 @@ smoke_check_3(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -653,7 +712,6 @@ smoke_check_3(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -678,7 +736,6 @@ smoke_check_3(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -711,7 +768,7 @@ smoke_check_3(void) * Function: smoke_check_4() * * Purpose: A basic functional test on a tiny cache, with inserts, - * destroys, and renames in the mix, along with repeated + * destroys, and moves in the mix, along with repeated * protects and unprotects. About half the entries are * marked as dirty. * @@ -734,7 +791,6 @@ smoke_check_4(void) { const char * fcn_name = "smoke_check_4"; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = TRUE; int dirty_unprotects = TRUE; int dirty_destroys = TRUE; hbool_t display_stats = FALSE; @@ -776,9 +832,8 @@ smoke_check_4(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -795,9 +850,8 @@ smoke_check_4(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, + /* do_moves */ TRUE, + /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -814,9 +868,8 @@ smoke_check_4(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -844,7 +897,6 @@ smoke_check_4(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -869,7 +921,6 @@ smoke_check_4(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -926,7 +977,6 @@ smoke_check_5(void) const char * fcn_name = "smoke_check_5"; herr_t result; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = FALSE; int dirty_unprotects = FALSE; hbool_t display_stats = FALSE; int32_t max_index = 1024; @@ -1035,8 +1085,7 @@ smoke_check_5(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1048,8 +1097,7 @@ smoke_check_5(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1061,8 +1109,7 @@ smoke_check_5(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ TRUE); if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1086,7 +1133,6 @@ smoke_check_5(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -1111,7 +1157,6 @@ smoke_check_5(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -1168,7 +1213,6 @@ smoke_check_6(void) const char * fcn_name = "smoke_check_6"; herr_t result; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = TRUE; int dirty_unprotects = FALSE; hbool_t display_stats = FALSE; int mile_stone = 1; @@ -1274,8 +1318,7 @@ smoke_check_6(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1287,8 +1330,7 @@ smoke_check_6(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1300,8 +1342,7 @@ smoke_check_6(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ TRUE); if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1325,7 +1366,6 @@ smoke_check_6(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -1350,7 +1390,6 @@ smoke_check_6(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -1407,7 +1446,6 @@ smoke_check_7(void) const char * fcn_name = "smoke_check_7"; herr_t result; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = FALSE; int dirty_unprotects = FALSE; hbool_t display_stats = FALSE; int mile_stone = 1; @@ -1514,8 +1552,7 @@ smoke_check_7(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1527,8 +1564,7 @@ smoke_check_7(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1540,8 +1576,7 @@ smoke_check_7(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ TRUE); if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1565,7 +1600,6 @@ smoke_check_7(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -1590,7 +1624,6 @@ smoke_check_7(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -1647,7 +1680,6 @@ smoke_check_8(void) const char * fcn_name = "smoke_check_8"; herr_t result; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = TRUE; int dirty_unprotects = FALSE; hbool_t display_stats = FALSE; int mile_stone = 1; @@ -1753,8 +1785,7 @@ smoke_check_8(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1766,8 +1797,7 @@ smoke_check_8(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ FALSE); if ( show_progress ) /* 5 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1779,8 +1809,7 @@ smoke_check_8(void) /* reset_stats */ TRUE, /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, - /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts); + /* do_inserts */ TRUE); if ( show_progress ) /* 6 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -1804,7 +1833,6 @@ smoke_check_8(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ @@ -1829,7 +1857,6 @@ smoke_check_8(void) /* display_stats */ display_stats, /* display_detailed_stats */ FALSE, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ @@ -1865,7 +1892,7 @@ smoke_check_8(void) * part of the time. * * Recall that smoke check 1 is a basic functional test, - * with inserts, destroys, and renames in the mix, along + * with inserts, destroys, and moves in the mix, along * with repeated protects and unprotects. All entries are * marked as clean. * @@ -1887,7 +1914,6 @@ smoke_check_9(void) const char * fcn_name = "smoke_check_9"; herr_t result; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = FALSE; int dirty_unprotects = FALSE; int dirty_destroys = FALSE; hbool_t display_stats = FALSE; @@ -1949,9 +1975,8 @@ smoke_check_9(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -1985,9 +2010,8 @@ smoke_check_9(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, + /* do_moves */ TRUE, + /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -2019,9 +2043,8 @@ smoke_check_9(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -2079,7 +2102,6 @@ smoke_check_9(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 13 */ @@ -2119,7 +2141,6 @@ smoke_check_9(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 16 */ @@ -2171,7 +2192,7 @@ smoke_check_9(void) * part of the time. * * Recall that smoke check 2 is a basic functional test, - * with inserts, destroys, and renames in the mix, along + * with inserts, destroys, and moves in the mix, along * with some repeated protects and unprotects. About half * the entries are marked as dirty. * @@ -2193,7 +2214,6 @@ smoke_check_10(void) const char * fcn_name = "smoke_check_10"; herr_t result; hbool_t show_progress = FALSE; - hbool_t dirty_inserts = TRUE; int dirty_unprotects = TRUE; int dirty_destroys = TRUE; hbool_t display_stats = FALSE; @@ -2238,9 +2258,8 @@ smoke_check_10(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -2272,9 +2291,8 @@ smoke_check_10(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ FALSE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, + /* do_moves */ TRUE, + /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -2306,9 +2324,8 @@ smoke_check_10(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ dirty_destroys, @@ -2366,7 +2383,6 @@ smoke_check_10(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 12 */ @@ -2421,7 +2437,6 @@ smoke_check_10(void) /* display_stats */ display_stats, /* display_detailed_stats */ display_detailed_stats, /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 16 */ @@ -2529,9 +2544,8 @@ write_permitted_check(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ TRUE, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ TRUE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ TRUE, @@ -2550,9 +2564,8 @@ write_permitted_check(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ FALSE, - /* dirty_inserts */ FALSE, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, + /* do_moves */ TRUE, + /* move_to_main_addr */ TRUE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ FALSE, @@ -2571,9 +2584,8 @@ write_permitted_check(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ TRUE, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, + /* do_moves */ TRUE, + /* move_to_main_addr */ FALSE, /* do_destroys */ FALSE, /* do_mult_ro_protects */ TRUE, /* dirty_destroys */ TRUE, @@ -2601,7 +2613,6 @@ write_permitted_check(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ TRUE, - /* dirty_inserts */ TRUE, /* dirty_unprotects */ TRUE); if ( show_progress ) /* 8 */ @@ -2617,7 +2628,6 @@ write_permitted_check(void) /* display_stats */ display_stats, /* display_detailed_stats */ TRUE, /* do_inserts */ FALSE, - /* dirty_inserts */ FALSE, /* dirty_unprotects */ NO_CHANGE); write_permitted = TRUE; @@ -2721,13 +2731,12 @@ check_insert_entry(void) if ( pass ) { - insert_entry(file_ptr, entry_type, 0, TRUE, H5C__NO_FLAGS_SET); - insert_entry(file_ptr, entry_type, 1, TRUE, H5C__SET_FLUSH_MARKER_FLAG); - insert_entry(file_ptr, entry_type, 2, TRUE, H5C__PIN_ENTRY_FLAG); - insert_entry(file_ptr, entry_type, 3, TRUE, (H5C__SET_FLUSH_MARKER_FLAG | H5C__PIN_ENTRY_FLAG)); + insert_entry(file_ptr, entry_type, 0, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, entry_type, 1, H5C__SET_FLUSH_MARKER_FLAG); + insert_entry(file_ptr, entry_type, 2, H5C__PIN_ENTRY_FLAG); + insert_entry(file_ptr, entry_type, 3, (H5C__SET_FLUSH_MARKER_FLAG | H5C__PIN_ENTRY_FLAG)); } - /* Verify that the entries are inserted as desired. */ i = 0; @@ -2874,7 +2883,6 @@ check_insert_entry(void) } /* while */ - /* So much for looking at the individual entries. Now verify * that the various counts and sized in the cache header are * as expected. @@ -2904,7 +2912,6 @@ check_insert_entry(void) } } - /* Finally, if stats collection is enabled, verify that the expected * stats are collected. */ @@ -2931,7 +2938,6 @@ check_insert_entry(void) } #endif /* H5C_COLLECT_CACHE_STATS */ - /* Unpin the pinned entries so we can take down the cache cleanly. */ if ( pass ) { @@ -3216,100 +3222,92 @@ 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, - /* dirty_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* 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 + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* 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 + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* 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 + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* 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 + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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 + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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 + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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 + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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 + /* expected_destroyed = */ FALSE } }; @@ -3330,7 +3328,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3342,8 +3339,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3354,7 +3350,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -3366,8 +3361,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3378,7 +3372,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3390,8 +3383,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3402,7 +3394,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -3414,8 +3405,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3440,7 +3430,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3452,8 +3441,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3464,7 +3452,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, @@ -3476,8 +3463,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3488,7 +3474,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3500,8 +3485,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3512,7 +3496,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, @@ -3524,8 +3507,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3550,7 +3532,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3562,8 +3543,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ FALSE, @@ -3574,7 +3554,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -3586,8 +3565,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ FALSE, @@ -3598,7 +3576,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3610,8 +3587,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3622,7 +3598,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -3634,8 +3609,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3661,7 +3635,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, @@ -3673,8 +3646,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3685,7 +3657,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, @@ -3697,8 +3668,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3709,7 +3679,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, @@ -3721,8 +3690,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3733,7 +3701,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, @@ -3745,8 +3712,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3772,7 +3738,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3784,8 +3749,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3796,7 +3760,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -3808,8 +3771,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3820,7 +3782,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3832,8 +3793,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3844,7 +3804,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -3856,8 +3815,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -3883,7 +3841,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3895,8 +3852,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ FALSE, @@ -3907,7 +3863,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -3919,8 +3874,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ FALSE, @@ -3931,7 +3885,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -3943,8 +3896,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3955,7 +3907,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, @@ -3967,8 +3918,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -3995,7 +3945,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, @@ -4007,8 +3956,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -4019,7 +3967,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, @@ -4031,8 +3978,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -4043,7 +3989,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, @@ -4055,8 +4000,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -4067,7 +4011,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, @@ -4079,8 +4022,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ TRUE, /* expected_flushed = */ FALSE, @@ -4109,7 +4051,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -4121,8 +4062,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -4133,7 +4073,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -4145,8 +4084,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -4157,7 +4095,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, @@ -4169,8 +4106,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ TRUE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -4181,7 +4117,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, @@ -4193,8 +4128,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* expected_loaded = */ FALSE, /* expected_cleared = */ FALSE, /* expected_flushed = */ TRUE, @@ -4224,7 +4158,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4239,8 +4172,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4255,7 +4187,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 2, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4272,8 +4203,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 3, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, @@ -4290,7 +4220,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 4, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4309,8 +4238,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 5, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, @@ -4329,7 +4257,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 6, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4350,8 +4277,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 7, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, @@ -4386,7 +4312,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4401,8 +4326,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4417,7 +4341,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 2, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4434,8 +4357,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 3, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, @@ -4452,7 +4374,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4467,8 +4388,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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}, @@ -4483,7 +4403,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 2, /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, @@ -4500,8 +4419,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 3, /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, MONSTER_ENTRY_TYPE, @@ -4532,7 +4450,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4547,8 +4464,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4563,7 +4479,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4579,8 +4494,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4595,7 +4509,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4610,8 +4523,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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}, @@ -4625,7 +4537,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4640,8 +4551,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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}, @@ -4670,7 +4580,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4685,8 +4594,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4701,7 +4609,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4717,8 +4624,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4733,7 +4639,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4748,8 +4653,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 4, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, PICO_ENTRY_TYPE, @@ -4767,7 +4671,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 4, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4786,8 +4689,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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}, @@ -4817,7 +4719,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 100, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 0, /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, @@ -4832,8 +4733,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 75, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4848,7 +4748,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 25, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4864,8 +4763,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, -1, -1, -1, -1, -1, -1, -1}, @@ -4880,7 +4778,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 10, /* insert_flag = */ FALSE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4896,8 +4793,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 20, /* insert_flag = */ FALSE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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}, @@ -4912,7 +4808,6 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 30, /* insert_flag = */ TRUE, - /* dirty_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, /* num_pins = */ 1, /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, @@ -4928,8 +4823,7 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* dirty_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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}, @@ -5039,14 +4933,14 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, if ( spec[i].insert_flag ) { insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].dirty_flag, spec[i].flags); + spec[i].flags); } else { protect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index); unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - (int)(spec[i].dirty_flag), spec[i].flags); + spec[i].flags); } total_entry_size += entry_sizes[spec[i].entry_type]; @@ -5267,14 +5161,14 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, if ( spec[i].insert_flag ) { insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - spec[i].dirty_flag, spec[i].flags); + spec[i].flags); } else { protect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index); unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - (int)(spec[i].dirty_flag), spec[i].flags); + spec[i].flags); } total_entry_size += entry_sizes[spec[i].entry_type]; @@ -5420,7 +5314,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, * * These are tests that test the cache's ability to handle * the case in which the flush callback dirties, resizes, - * and/or renames entries. + * and/or moves entries. * * Do nothing if pass is FALSE on entry. * @@ -5473,6 +5367,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 0, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5501,6 +5396,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5581,6 +5477,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 0, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5609,6 +5506,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5685,7 +5583,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5764,7 +5663,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5824,7 +5724,7 @@ 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 renames the entry for which it has + * which the call back function moves the entry for which it has * been called. * * Run this entry twice, as the first run moves the entry to its @@ -5845,6 +5745,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 0, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5852,7 +5753,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, 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 }, @@ -5900,11 +5801,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) check_size, checks); - /* this change forces the rename to move the target entry back to its + /* this change forces the move to move the target entry back to its * main address. The first test moved it to its alternate address. * * Note that these two tests are not the same, as in the first test, - * the renamed entry is moved forward in the slist. In the second + * the moved entry is moved forward in the slist. In the second * it is moved backwards. * * Since there is only one entry in the cache, this doesn't really @@ -5936,7 +5837,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * second test. * * Single entry test verifying that the cache can handle the case in - * which the call back function renames the entry for which it has + * which the call back function moves the entry for which it has * been called. * * Run this entry twice, as the first run moves the entry to its @@ -5957,6 +5858,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 0, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -5964,7 +5866,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_flush_ops = */ 1, /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ - { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, 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 }, @@ -6012,11 +5914,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) check_size, checks); - /* this change forces the rename to move the target entry back to its + /* this change forces the move to move the target entry back to its * main address. The first test moved it to its alternate address. * * Note that these two tests are not the same, as in the first test, - * the renamed entry is moved forward in the slist. In the second + * the moved entry is moved forward in the slist. In the second * it is moved backwards. * * Since there is only one entry in the cache, this doesn't really @@ -6050,7 +5952,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) if ( pass ) /* test #9 & #10 */ { /* Single entry test verifying that the cache can handle the case in - * which the call back function both resizes and renames the entry + * which the call back function both resizes and moves the entry * for which it has been called. * * Again, we run this entry twice, as the first run moves the entry @@ -6070,7 +5972,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6079,7 +5982,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, 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 }, @@ -6126,11 +6029,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) check_size, checks); - /* this change forces the rename to move the target entry back to its + /* this change forces the move to move the target entry back to its * main address. The first test moved it to its alternate address. * * Note that these two tests are not the same, as in the first test, - * the renamed entry is moved forward in the slist. In the second + * the moved entry is moved forward in the slist. In the second * it is moved backwards. * * Since there is only one entry in the cache, this doesn't really @@ -6162,7 +6065,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * second test. * * Single entry test verifying that the cache can handle the case in - * which the call back function both resizes and renames the entry + * which the call back function both resizes and moves the entry * for which it has been called. * * Again, we run this entry twice, as the first run moves the entry to its @@ -6182,7 +6085,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6191,7 +6095,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* flush_ops = */ /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, 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 }, @@ -6238,11 +6142,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) check_size, checks); - /* this change forces the rename to move the target entry back to its + /* this change forces the move to move the target entry back to its * main address. The first test moved it to its alternate address. * * Note that these two tests are not the same, as in the first test, - * the renamed entry is moved forward in the slist. In the second + * the moved entry is moved forward in the slist. In the second * it is moved backwards. * * Since there is only one entry in the cache, this doesn't really @@ -6298,6 +6202,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6396,6 +6301,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6493,6 +6399,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6590,6 +6497,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6665,7 +6573,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { /* Test the ability of the cache to handle the case in which * the flush function of an entry that is resident in cache - * resizes, dirties, and renames two entries that are not in cache. + * resizes, dirties, and moves two entries that are not in cache. * * At present, I am assured that this case will never occur, but * lets make sure we can handle it regardless. @@ -6687,6 +6595,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6696,10 +6605,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, 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 }, @@ -6757,12 +6666,12 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) check_size, checks); - /* this change forces the renames to move the target entries back to + /* this change forces the moves to move the target entries back to * their main address. The first test moved them to their alternate * address. * * Note that these two tests are not the same, as in the first test, - * the renamed entries are moved forward in the slist. In the second + * the moved entries are moved forward in the slist. In the second * they are moved backwards. */ if ( pass ) { @@ -6794,7 +6703,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * * Test the ability of the cache to handle the case in which * the flush function of an entry that is resident in cache - * resizes, dirties, and renames two entries that are not in cache. + * resizes, dirties, and moves two entries that are not in cache. * * At present, I am assured that this case will never occur, but * lets make sure we can handle it regardless. @@ -6816,6 +6725,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6825,10 +6735,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, 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 }, @@ -6886,12 +6796,12 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) check_size, checks); - /* this change forces the renames to move the target entries back to + /* this change forces the moves to move the target entries back to * their main address. The first test moved them to their alternate * address. * * Note that these two tests are not the same, as in the first test, - * the renamed entries are moved forward in the slist. In the second + * the moved entries are moved forward in the slist. In the second * they are moved backwards. */ if ( pass ) { @@ -6929,7 +6839,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* Now mix things up a bit. * * Load several entries, two of which have flush functions that - * resize, dirty, and rename two entries that are not in the + * resize, dirty, and move two entries that are not in the * cache. Mark only one of these entries, and then flush the * cache with the flush marked entries flag. * @@ -6957,6 +6867,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6966,10 +6877,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, 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 }, @@ -6985,6 +6896,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 11, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -6994,10 +6906,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, 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 }, @@ -7013,6 +6925,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 0, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7041,6 +6954,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7148,7 +7062,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* Mix things up some more. * * Load lots of entries, some of which have flush functions that - * resize, dirty, and rename two entries that are not in the + * resize, dirty, and move two entries that are not in the * cache. * * Also load entries that have flush ops on entries that are in @@ -7172,6 +7086,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7181,10 +7096,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, 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 }, @@ -7200,6 +7115,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 11, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7209,10 +7125,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, 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 }, @@ -7228,6 +7144,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 0, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7256,6 +7173,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7284,6 +7202,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7312,6 +7231,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7421,7 +7341,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * Mix things up some more. * * Load lots of entries, some of which have flush functions that - * resize, dirty, and rename two entries that are not in the + * resize, dirty, and move two entries that are not in the * cache. * * Also load entries that have flush ops on entries that are in @@ -7442,6 +7362,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7451,10 +7372,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2, 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 }, @@ -7470,6 +7391,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 11, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7479,10 +7401,10 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 12, 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 }, @@ -7498,6 +7420,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 0, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7526,6 +7449,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7554,6 +7478,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7582,6 +7507,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7708,6 +7634,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7736,6 +7663,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 50, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 1, /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -7764,6 +7692,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 150, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 1, /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -7842,6 +7771,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -7870,6 +7800,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 50, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 1, /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -7898,6 +7829,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 150, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 1, /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -7990,12 +7922,12 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * dirties (VET, 100) * resizes (VET, 200) * dirty (VET, 300) -- dirty first to bring into cache. - * renames (VET, 300) + * moves (VET, 300) * * (VET, 2000) initially clean, and in cache * dirties (VET, 2100) * resizes (VET, 2200) - * renames (VET, 2300) + * moves (VET, 2300) * * (VET, 350) initially clean, and in cache * pins (VET, 1000) @@ -8007,7 +7939,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * (VET, 450) initially dirty, and in cache * pins (VET, 1000) * dirties (VET, 1000) - * renames (VET, 450) + * moves (VET, 450) * pins (VET, 2000) * dirties (VET, 2000) * @@ -8046,6 +7978,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 200, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8074,6 +8007,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 2100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8102,6 +8036,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 2300, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8130,6 +8065,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1000, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8140,7 +8076,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, 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 }, @@ -8158,6 +8094,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 2000, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8167,7 +8104,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, 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 }, @@ -8186,6 +8123,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 350, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8214,6 +8152,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 450, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8242,6 +8181,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 650, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8270,6 +8210,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 750, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8298,6 +8239,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 500, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8427,12 +8369,12 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * dirties (VET, 100) * resizes (VET, 200) * dirty (VET, 300) -- dirty first to bring into cache. - * renames (VET, 300) + * moves (VET, 300) * * (VET, 2000) initially clean, and in cache * dirties (VET, 2100) * resizes (VET, 2200) - * renames (VET, 2300) + * moves (VET, 2300) * * (VET, 350) initially clean, and in cache * pins (VET, 1000) @@ -8444,7 +8386,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * (VET, 450) initially dirty, and in cache * pins (VET, 1000) * dirties (VET, 1000) - * renames (VET, 450) + * moves (VET, 450) * pins (VET, 2000) * dirties (VET, 2000) * @@ -8483,6 +8425,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 200, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8511,6 +8454,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 2100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8539,6 +8483,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 2300, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8567,6 +8512,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 1000, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8577,7 +8523,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, 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 }, @@ -8595,6 +8541,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 2000, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8604,7 +8551,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 2300, 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 }, @@ -8623,6 +8570,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 350, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8651,6 +8599,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 450, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8679,6 +8628,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 650, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8707,6 +8657,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 750, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 2, /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0}, @@ -8735,6 +8686,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 500, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8845,6 +8797,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8872,7 +8825,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 200, /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 1, /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -8882,7 +8836,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, 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 }, @@ -8900,7 +8854,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 300, /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 1, /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -8910,7 +8865,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, 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 }, @@ -8929,6 +8884,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 400, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -8956,7 +8912,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 500, /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 1, /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -8966,7 +8923,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, 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 }, @@ -9038,6 +8995,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -9065,7 +9023,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 200, /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 1, /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -9075,7 +9034,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 200, 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 }, @@ -9093,7 +9052,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 300, /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 1, /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -9103,7 +9063,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 300, 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 }, @@ -9122,6 +9082,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_index = */ 400, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, + /* resize_flag = */ FALSE, /* new_size = */ 0, /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -9149,7 +9110,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 500, /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, + /* flags = */ H5C__DIRTIED_FLAG, + /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 1, /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0}, @@ -9159,7 +9121,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* op_code: type: idx: flag: size: order_ptr: */ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL }, { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL }, - { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 500, 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 }, @@ -9387,7 +9349,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, - TRUE, spec[i].flags); + spec[i].flags); } else { @@ -9413,9 +9375,12 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, (int)(spec[i].new_size)); } - unprotect_entry_with_size_change(file_ptr, spec[i].entry_type, - spec[i].entry_index, - spec[i].flags, spec[i].new_size); + if(spec[i].resize_flag) + resize_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, + spec[i].new_size, TRUE); + + unprotect_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, + spec[i].flags); } for ( j = 0; j < spec[i].num_pins; j++ ) @@ -9797,12 +9762,12 @@ 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; int num_monster_entries = 31; int num_large_entries = 0; herr_t result; - H5C_t * cache_ptr = file_ptr->shared->cache; test_entry_t * entry_ptr; test_entry_t * base_addr; struct expected_entry_status expected[8 + 31 + 14] = @@ -9922,40 +9887,36 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) */ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 0, - H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, - (VARIABLE_ENTRY_SIZE / 2)); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 1, - H5C__NO_FLAGS_SET, (size_t)0); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 2, - H5C__NO_FLAGS_SET, (size_t)0); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 3, - H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, - (VARIABLE_ENTRY_SIZE / 2)); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 4, - H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, - (VARIABLE_ENTRY_SIZE / 2)); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 5, - H5C__DIRTIED_FLAG | H5C__SIZE_CHANGED_FLAG, - (VARIABLE_ENTRY_SIZE / 2)); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 6, - H5C__NO_FLAGS_SET, (size_t)0); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 7, - H5C__NO_FLAGS_SET, (size_t)0); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__NO_FLAGS_SET); if ( ( cache_ptr->index_len != 8 ) || ( cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 2)) + @@ -9991,7 +9952,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 2) dirties (VET, 0) * resizes (VET, 0) to VARIABLE_ENTRY_SIZE - * renames (VET, 0) to its alternate address + * moves (VET, 0) to its alternate address * * (VET, 3) dirties (VET, 0) * resizes itself to VARIABLE_ENTRY_SIZE @@ -10001,20 +9962,20 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__RESIZE, - VARIABLE_ENTRY_TYPE, 0, FALSE, + VARIABLE_ENTRY_TYPE, 0, TRUE, 3 * VARIABLE_ENTRY_SIZE / 4, NULL); add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RESIZE, - VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE, NULL); - add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RENAME, + VARIABLE_ENTRY_TYPE, 0, TRUE, VARIABLE_ENTRY_SIZE, NULL); + add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL); 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, 3, FLUSH_OP__RESIZE, - VARIABLE_ENTRY_TYPE, 3, FALSE, VARIABLE_ENTRY_SIZE, NULL); + VARIABLE_ENTRY_TYPE, 3, TRUE, VARIABLE_ENTRY_SIZE, NULL); add_flush_op(VARIABLE_ENTRY_TYPE, 7, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 6, FALSE, (size_t)0, NULL); @@ -10035,7 +9996,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 2) Y 10 KB N N 0 dirty (VET, 0) * resize (VET, 0) to 10 KB - * rename (VET, 0) to its alternate address + * 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 @@ -10057,15 +10018,13 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 0; i < 31; i++ ) { protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, MONSTER_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } for ( i = 0; i < 1; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* The cache should now be exactly full */ @@ -10109,7 +10068,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 2) Y 10 KB N N 0 dirty (VET, 0) * resize (VET, 0) to 10 KB - * rename (VET, 0) to its alternate address + * 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 @@ -10132,8 +10091,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) num_large_entries = 2; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, 1, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); if ( ( cache_ptr->index_len != 40 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - @@ -10145,7 +10103,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) (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."; } @@ -10161,7 +10118,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* 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 renaming + * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the moving * of (VET, 0) to its alternate address. * * The following table shows the expected states of the variable @@ -10198,8 +10155,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) num_large_entries = 3; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, 2, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DIRTIED_FLAG); if ( ( cache_ptr->index_len != 40 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - @@ -10271,12 +10227,10 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) num_large_entries = 5; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, 3, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); protect_entry(file_ptr, LARGE_ENTRY_TYPE, 4); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, 4, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); /* verify cache size */ if ( ( cache_ptr->index_len != 41 ) || @@ -10312,15 +10266,13 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 0; i < 31; i++ ) { protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, MONSTER_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } for ( i = 0; i < 5; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* verify cache size */ @@ -10379,8 +10331,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 5; i < 8; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* verify cache size */ @@ -10441,8 +10392,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 8; i < 9; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* verify cache size */ @@ -10507,8 +10457,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 9; i < 10; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* verify cache size */ @@ -10543,15 +10492,13 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 0; i < 31; i++ ) { protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, MONSTER_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } for ( i = 0; i < 10; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* verify cache size */ @@ -10640,8 +10587,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) num_large_entries = 12; - /* a newly loaded entry is not inserted in the cache until after space has been - * made for it. Thus (LET, 11) will not be flushed. + /* a newly loaded entry is not inserted in the cache until after + * space has been made for it. Thus (LET, 11) will not be flushed. */ for ( i = num_variable_entries; i < num_variable_entries + num_monster_entries + num_large_entries - 1; @@ -10654,8 +10601,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 10; i < 12; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* verify cache size */ @@ -10687,15 +10633,13 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 0; i < num_monster_entries; i++ ) { protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, MONSTER_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + 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_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* update the expected array to mark all these entries dirty again. */ @@ -10767,8 +10711,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) num_large_entries = 14; - /* a newly loaded entry is not inserted in the cache until after space has been - * made for it. Thus (LET, 13) will not be flushed. + /* a newly loaded entry is not inserted in the cache until after + * space has been made for it. Thus (LET, 13) will not be flushed. */ for ( i = num_variable_entries; i < num_variable_entries + num_monster_entries + num_large_entries - 1; @@ -10781,8 +10725,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) for ( i = 12; i < 14; i++ ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); - unprotect_entry_with_size_change(file_ptr, LARGE_ENTRY_TYPE, i, - H5C__DIRTIED_FLAG, (size_t)0); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__DIRTIED_FLAG); } /* verify cache size */ @@ -10804,7 +10747,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) expected); } - /* at this point we have cycled all the variable size entries through the cache. + /* at this point we have cycled all the variable size entries through + * the cache. * * flush the cache and end the test. */ @@ -10844,9 +10788,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) ( cache_ptr->clears[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 14 ) || ( cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 9 ) || - ( cache_ptr->renames[VARIABLE_ENTRY_TYPE] != 1 ) || - ( cache_ptr->entry_flush_renames[VARIABLE_ENTRY_TYPE] != 0 ) || - ( cache_ptr->cache_flush_renames[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 ) || @@ -10869,9 +10813,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) ( cache_ptr->clears[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->flushes[LARGE_ENTRY_TYPE] != 38 ) || ( cache_ptr->evictions[LARGE_ENTRY_TYPE] != 14 ) || - ( cache_ptr->renames[LARGE_ENTRY_TYPE] != 0 ) || - ( cache_ptr->entry_flush_renames[LARGE_ENTRY_TYPE] != 0 ) || - ( cache_ptr->cache_flush_renames[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 ) || ( cache_ptr->pins[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->unpins[LARGE_ENTRY_TYPE] != 0 ) || ( cache_ptr->dirty_pins[LARGE_ENTRY_TYPE] != 0 ) || @@ -10894,9 +10838,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) || ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 93 ) || ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 31 ) || - ( cache_ptr->renames[MONSTER_ENTRY_TYPE] != 0 ) || - ( cache_ptr->entry_flush_renames[MONSTER_ENTRY_TYPE] != 0 ) || - ( cache_ptr->cache_flush_renames[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 ) || @@ -10941,8 +10885,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * JRM -- 5/17/06 * Complete reqrite of pinned entry tests to accomodate - * the new H5C_mark_pinned_or_protected_entry_dirty() - * call. + * the new H5C_mark_entry_dirty() call. * *------------------------------------------------------------------------- */ @@ -10979,7 +10922,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ TRUE, @@ -11006,8 +10948,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ TRUE, /* expected_cleared */ FALSE, @@ -11033,7 +10974,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, @@ -11060,8 +11000,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ TRUE, @@ -11087,7 +11026,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ TRUE, @@ -11114,8 +11052,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ FALSE, @@ -11141,7 +11078,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ TRUE, @@ -11168,8 +11104,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ FALSE, @@ -11195,7 +11130,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -11223,8 +11157,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, @@ -11251,7 +11184,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -11279,8 +11211,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, @@ -11307,7 +11238,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, @@ -11335,8 +11265,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ TRUE, @@ -11363,7 +11292,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | @@ -11392,8 +11320,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, @@ -11421,7 +11348,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ TRUE, @@ -11448,8 +11374,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ TRUE, /* expected_cleared */ FALSE, @@ -11475,7 +11400,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, @@ -11502,8 +11426,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ TRUE, @@ -11529,7 +11452,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ TRUE, @@ -11556,8 +11478,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ FALSE, @@ -11583,7 +11504,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ TRUE, @@ -11610,8 +11530,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ FALSE, @@ -11637,7 +11556,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -11665,8 +11583,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, @@ -11693,7 +11610,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -11721,8 +11637,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, @@ -11749,7 +11664,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, @@ -11777,8 +11691,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ TRUE, @@ -11805,7 +11718,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | @@ -11834,8 +11746,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ FALSE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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, @@ -11863,7 +11774,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ FALSE, @@ -11890,8 +11800,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ FALSE, /* expected_cleared */ FALSE, @@ -11917,7 +11826,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, @@ -11944,8 +11852,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ TRUE, @@ -11971,7 +11878,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ FALSE, @@ -11998,8 +11904,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ FALSE, @@ -12025,7 +11930,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ FALSE, @@ -12052,8 +11956,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ FALSE, @@ -12079,7 +11982,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -12107,8 +12009,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, @@ -12135,7 +12036,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -12163,8 +12063,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, @@ -12191,7 +12090,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, @@ -12219,8 +12117,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ FALSE, @@ -12247,7 +12144,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | @@ -12276,8 +12172,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, + /* flags */ H5C__DIRTIED_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, @@ -12305,7 +12200,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ FALSE, @@ -12332,8 +12226,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__NO_FLAGS_SET, /* expected_loaded */ FALSE, /* expected_cleared */ FALSE, @@ -12359,7 +12252,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, @@ -12386,8 +12278,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ TRUE, @@ -12413,7 +12304,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ FALSE, @@ -12440,8 +12330,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ FALSE, @@ -12467,7 +12356,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ FALSE, @@ -12494,8 +12382,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ FALSE, @@ -12521,7 +12408,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -12549,8 +12435,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, @@ -12577,7 +12462,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -12605,8 +12489,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, @@ -12633,7 +12516,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, @@ -12661,8 +12543,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_INVALIDATE_FLAG, /* expected_loaded */ FALSE, @@ -12689,7 +12570,6 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | @@ -12718,8 +12598,7 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* entry_type */ PICO_ENTRY_TYPE, /* entry_idx */ 0, /* insert_flag */ TRUE, - /* dirty_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* 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, @@ -12742,13 +12621,12 @@ check_flush_cache__single_entry(H5F_t * file_ptr) * * 2) Marked dirty by unprotect or not. * - * 3) Marked dirty by call to H5C_mark_pinned_entry_dirty() or not. + * 3) Marked dirty by call to H5C_mark_entry_dirty() or not. * - * 4) Marked dirty by call to H5C_mark_pinned_or_protected_entry_dirty() - * while protected or not. + * 4) Marked dirty by call to H5C_mark_entry_dirty() while protected + * or not. * - * 5) Marked dirty by call to H5C_mark_pinned_or_protected_entry_dirty() - * while pinned or not. + * 5) Marked dirty by call to H5C_mark_entry_dirty() while pinned or not. * * 6) Entry marked for flush or not. * @@ -12804,7 +12682,6 @@ 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; @@ -12815,267 +12692,267 @@ check_flush_cache__single_entry(H5F_t * file_ptr) hbool_t expected_flushed; hbool_t expected_destroyed; } spec[256] = - /* pop pop - * ent mark mark - * test entry -ry dirty mark dirty dirty unprot flush expect expect expect - * num type idx flag dirty prot pinned unpin flags flags clear flush destroy + /* 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 */ - { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 97, PICO_ENTRY_TYPE, 0, FALSE, 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, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 161, PICO_ENTRY_TYPE, 0, FALSE, 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, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, 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, 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, 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, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, 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, TRUE, FALSE, FALSE } }; + { { 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 } }; i = 0; while ( ( pass ) && ( i < 256 ) ) @@ -13091,7 +12968,6 @@ 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, @@ -13132,7 +13008,6 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, int entry_type, int entry_idx, hbool_t insert_flag, - hbool_t dirty_flag, unsigned int flags, unsigned int flush_flags, hbool_t expected_loaded, @@ -13181,14 +13056,13 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, if ( insert_flag ) { - insert_entry(file_ptr, entry_type, entry_idx, dirty_flag, flags); + insert_entry(file_ptr, entry_type, entry_idx, flags); } else { protect_entry(file_ptr, entry_type, entry_idx); - unprotect_entry(file_ptr, entry_type, entry_idx, - (int)dirty_flag, flags); + unprotect_entry(file_ptr, entry_type, entry_idx, flags); } } @@ -13306,7 +13180,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, * JRM -- 5/17/06 * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned * flags and supporting code to allow us to test the - * H5C_mark_pinned_or_protected_entry_dirty() call. Use the + * H5C_mark_entry_dirty() call. Use the * call to mark the entry dirty while the entry is protected * if pop_mark_dirty_prot is TRUE, and to mark the entry * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. @@ -13319,7 +13193,6 @@ check_flush_cache__pinned_single_entry_test(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, @@ -13374,22 +13247,19 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pop_mark_dirty_prot ) { - mark_pinned_or_protected_entry_dirty(entry_type, - entry_idx); + mark_entry_dirty(entry_type, entry_idx); } - unprotect_entry(file_ptr, entry_type, entry_idx, - (int)dirty_flag, (flags | H5C__PIN_ENTRY_FLAG)); + unprotect_entry(file_ptr, entry_type, entry_idx, (flags | H5C__PIN_ENTRY_FLAG)); if ( mark_dirty ) { - mark_pinned_entry_dirty(entry_type, entry_idx, FALSE, (size_t)0); + mark_entry_dirty(entry_type, entry_idx); } if ( pop_mark_dirty_pinned ) { - mark_pinned_or_protected_entry_dirty(entry_type, - entry_idx); + mark_entry_dirty(entry_type, entry_idx); } } @@ -13410,7 +13280,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, ( entry_ptr->cleared != expected_cleared ) || ( entry_ptr->flushed != expected_flushed ) || ( 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), @@ -13421,7 +13291,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, (int)expected_flushed, (int)(entry_ptr->destroyed), (int)expected_destroyed); - +#endif pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry status after flush in pinned single entry test #%d.", @@ -13462,7 +13332,7 @@ 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, - (int)dirty_flag, H5C__UNPIN_ENTRY_FLAG); + (flags & H5C__DIRTIED_FLAG) | H5C__UNPIN_ENTRY_FLAG); } else { @@ -13590,7 +13460,7 @@ check_get_entry_status(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } @@ -13642,7 +13512,7 @@ check_get_entry_status(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); } @@ -13668,7 +13538,7 @@ check_get_entry_status(void) if ( pass ) { - mark_pinned_entry_dirty(0, 0, FALSE, (size_t)0); + mark_entry_dirty(0, 0); } @@ -13826,7 +13696,7 @@ check_expunge_entry(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } @@ -13954,7 +13824,7 @@ check_expunge_entry(void) protect_entry(file_ptr, 0, 1); - unprotect_entry(file_ptr, 0, 1, TRUE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 1, H5C__DIRTIED_FLAG); } @@ -14179,7 +14049,7 @@ check_multiple_read_protect(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14248,7 +14118,7 @@ check_multiple_read_protect(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14271,7 +14141,7 @@ check_multiple_read_protect(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if ( ( ! ( entry_ptr->header.is_protected ) ) || ( ! ( entry_ptr->header.is_read_only ) ) || @@ -14294,7 +14164,7 @@ check_multiple_read_protect(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if ( ( entry_ptr->header.is_protected ) || ( entry_ptr->header.is_read_only ) || @@ -14345,7 +14215,7 @@ check_multiple_read_protect(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); if ( ( entry_ptr->header.is_protected ) || ( entry_ptr->header.is_read_only ) || @@ -14381,7 +14251,7 @@ check_multiple_read_protect(void) protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (1) */ protect_entry(file_ptr, 0, 6); /* (0,6) write */ - unprotect_entry(file_ptr, 0, 2, FALSE, /* (0,2) unprotect */ + unprotect_entry(file_ptr, 0, 2, /* (0,2) unprotect */ H5C__NO_FLAGS_SET); protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (1) */ @@ -14390,16 +14260,16 @@ check_multiple_read_protect(void) protect_entry(file_ptr, 0, 0); /* (0,0) write */ protect_entry_ro(file_ptr, 0, 2); /* (0,2) read only (2) */ - unprotect_entry(file_ptr, 0, 2, FALSE, /* (0,2) read only (1) pin */ + unprotect_entry(file_ptr, 0, 2, /* (0,2) read only (1) pin */ H5C__PIN_ENTRY_FLAG); - unprotect_entry(file_ptr, 0, 6, FALSE, /* (0,6) unprotect */ + unprotect_entry(file_ptr, 0, 6, /* (0,6) unprotect */ H5C__NO_FLAGS_SET); protect_entry_ro(file_ptr, 0, 4); /* (0,4) read only (3) */ - unprotect_entry(file_ptr, 0, 2, FALSE, /* (0,2) unprotect */ + unprotect_entry(file_ptr, 0, 2, /* (0,2) unprotect */ H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, 0, 1, FALSE, /* (0,1) unprotect */ + unprotect_entry(file_ptr, 0, 1, /* (0,1) unprotect */ H5C__NO_FLAGS_SET); if ( pass ) { @@ -14424,9 +14294,9 @@ check_multiple_read_protect(void) } } - unprotect_entry(file_ptr, 0, 4, FALSE, /* (0,4) read only (2) */ + unprotect_entry(file_ptr, 0, 4, /* (0,4) read only (2) */ H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, 0, 4, FALSE, /* (0,4) read only (1) */ + unprotect_entry(file_ptr, 0, 4, /* (0,4) read only (1) */ H5C__UNPIN_ENTRY_FLAG); if ( ( pass ) && ( entry_ptr->header.is_pinned ) ) { @@ -14436,9 +14306,9 @@ check_multiple_read_protect(void) } - unprotect_entry(file_ptr, 0, 4, FALSE, /* (0,4) unprotect */ + unprotect_entry(file_ptr, 0, 4, /* (0,4) unprotect */ H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, 0, 0, FALSE, /* (0,0) unprotect */ + unprotect_entry(file_ptr, 0, 0, /* (0,0) unprotect */ H5C__NO_FLAGS_SET); unpin_entry(0, 2); @@ -14474,9 +14344,9 @@ check_multiple_read_protect(void) /*------------------------------------------------------------------------- - * Function: check_rename_entry() + * Function: check_move_entry() * - * Purpose: Verify that H5C_rename_entry behaves as expected. In + * Purpose: Verify that H5C_move_entry behaves as expected. In * particular, verify that it works correctly with pinned * entries. * @@ -14491,12 +14361,12 @@ check_multiple_read_protect(void) */ static unsigned -check_rename_entry(void) +check_move_entry(void) { - const char * fcn_name = "check_rename_entry"; + const char * fcn_name = "check_move_entry"; int i; H5F_t * file_ptr = NULL; - struct rename_entry_test_spec test_specs[4] = + struct move_entry_test_spec test_specs[4] = { { /* int entry_type = */ PICO_ENTRY_TYPE, @@ -14524,23 +14394,23 @@ check_rename_entry(void) } }; - TESTING("H5C_rename_entry() functionality"); + TESTING("H5C_move_entry() functionality"); pass = TRUE; - /* allocate a cache, load entries into it, and then rename + /* allocate a cache, load entries into it, and then move * them. To the extent possible, verify that the desired * actions took place. * * At present, we should do the following tests: * - * 1) Rename a clean, unprotected, unpinned entry. + * 1) move a clean, unprotected, unpinned entry. * - * 2) Rename a dirty, unprotected, unpinned entry. + * 2) move a dirty, unprotected, unpinned entry. * - * 3) Rename a clean, unprotected, pinned entry. + * 3) move a clean, unprotected, pinned entry. * - * 4) Rename a dirty, unprotected, pinned entry. + * 4) move a dirty, unprotected, pinned entry. * * In all cases, the entry should have moved to its * new location, and have been marked dirty if it wasn't @@ -14564,7 +14434,7 @@ check_rename_entry(void) i = 0; while ( ( pass ) && ( i < 4 ) ) { - check_rename_entry__run_test(file_ptr, i, &(test_specs[i])); + check_move_entry__run_test(file_ptr, i, &(test_specs[i])); i++; } @@ -14583,13 +14453,13 @@ check_rename_entry(void) return (unsigned)!pass; -} /* check_rename_entry() */ +} /* check_move_entry() */ /*------------------------------------------------------------------------- - * Function: check_rename_entry__run_test() + * Function: check_move_entry__run_test() * - * Purpose: Run a rename entry test. + * Purpose: Run a move entry test. * * Do nothing if pass is FALSE on entry. * @@ -14606,11 +14476,11 @@ check_rename_entry(void) */ static void -check_rename_entry__run_test(H5F_t * file_ptr, +check_move_entry__run_test(H5F_t * file_ptr, int test_num, - struct rename_entry_test_spec * spec_ptr) + struct move_entry_test_spec * spec_ptr) { - /* const char * fcn_name = "check_rename_entry__run_test"; */ + /* 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; @@ -14634,7 +14504,7 @@ check_rename_entry__run_test(H5F_t * file_ptr, pass = FALSE; HDsnprintf(msg, (size_t)128, - "bad entry_ptr in rename test #%d.", + "bad entry_ptr in move test #%d.", test_num); failure_mssg = msg; @@ -14648,18 +14518,20 @@ check_rename_entry__run_test(H5F_t * file_ptr, protect_entry(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index); - unprotect_entry(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index, - (int)(spec_ptr->is_dirty), flags); + if(spec_ptr->is_dirty) + flags |= H5C__DIRTIED_FLAG; - rename_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE); + unprotect_entry(file_ptr, spec_ptr->entry_type, spec_ptr->entry_index, flags); + + move_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE); } if ( pass ) { - /* verify that the rename took place, and that the cache's internal + /* verify that the move took place, and that the cache's internal * structures are as expected. Note that some sanity checking is - * done by rename_entry(), so we don't have to repeat it here. + * done by move_entry(), so we don't have to repeat it here. */ if ( spec_ptr->is_pinned ) { @@ -14668,7 +14540,7 @@ check_rename_entry__run_test(H5F_t * file_ptr, pass = FALSE; HDsnprintf(msg, (size_t)128, - "Pinned entry not pinned after rename in test #%d.", + "Pinned entry not pinned after move in test #%d.", test_num); failure_mssg = msg; } @@ -14687,7 +14559,7 @@ check_rename_entry__run_test(H5F_t * file_ptr, pass = FALSE; HDsnprintf(msg, (size_t)128, - "Pinned entry not in pel after rename in test #%d.", + "Pinned entry not in pel after move in test #%d.", test_num); failure_mssg = msg; } @@ -14701,7 +14573,7 @@ check_rename_entry__run_test(H5F_t * file_ptr, pass = FALSE; HDsnprintf(msg, (size_t)128, - "Unpinned entry pinned after rename in test #%d.", + "Unpinned entry pinned after move in test #%d.", test_num); failure_mssg = msg; } @@ -14711,7 +14583,7 @@ check_rename_entry__run_test(H5F_t * file_ptr, { pass = FALSE; HDsnprintf(msg, (size_t)128, - "Entry not at head of LRU after rename in test #%d.", + "Entry not at head of LRU after move in test #%d.", test_num); failure_mssg = msg; } @@ -14719,11 +14591,11 @@ check_rename_entry__run_test(H5F_t * file_ptr, } /* put the entry back where it started from */ - rename_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, TRUE); + move_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, TRUE); return; -} /* check_rename_entry__run_test() */ +} /* check_move_entry__run_test() */ /*------------------------------------------------------------------------- @@ -14807,7 +14679,7 @@ check_pin_protected_entry(void) } } - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); if ( pass ) { @@ -14838,10 +14710,6 @@ check_pin_protected_entry(void) * Programmer: John Mainzer * 7/7/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -14988,25 +14856,36 @@ check_resize_entry(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__SIZE_CHANGED_FLAG | H5C__DIRTIED_FLAG, (LARGE_ENTRY_SIZE / 2)); + result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 2)); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; - HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 1."); + HDsnprintf(msg, (size_t)128, "error(s) in H5C_resize_entry()."); failure_mssg = msg; - } else { + } else { - /* tidy up so we play nice with the standard protect / unprotect - * calls. - */ - entry_ptr->is_protected = FALSE; - entry_ptr->is_dirty = TRUE; - entry_ptr->size = LARGE_ENTRY_SIZE / 2; - } + 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); + + if ( result < 0 ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 1."); + failure_mssg = msg; + + } else { + + /* tidy up so we play nice with the standard protect / unprotect + * calls. + */ + entry_ptr->is_protected = FALSE; + entry_ptr->is_dirty = TRUE; + entry_ptr->size = LARGE_ENTRY_SIZE / 2; + } + } } if ( pass ) { @@ -15064,25 +14943,36 @@ check_resize_entry(void) if ( pass ) { - 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 | H5C__SIZE_CHANGED_FLAG), LARGE_ENTRY_SIZE); + result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; - HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 2."); + HDsnprintf(msg, (size_t)128, "error(s) in H5C_resize_entry()."); failure_mssg = msg; - } else { + } else { - /* tidy up so we play nice with the standard protect / unprotect - * calls. - */ - entry_ptr->is_protected = FALSE; - entry_ptr->is_dirty = TRUE; - entry_ptr->size = LARGE_ENTRY_SIZE; - } + 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); + + if ( result < 0 ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 2."); + failure_mssg = msg; + + } else { + + /* tidy up so we play nice with the standard protect / unprotect + * calls. + */ + entry_ptr->is_protected = FALSE; + entry_ptr->is_dirty = TRUE; + entry_ptr->size = LARGE_ENTRY_SIZE; + } + } } if ( pass ) { @@ -15136,19 +15026,19 @@ check_resize_entry(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__PIN_ENTRY_FLAG); } if ( pass ) { - result = H5C_resize_pinned_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); + result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_pinned_entry() reports failure 1."); + "H5C_resize_entry() reports failure 1."); failure_mssg = msg; } @@ -15203,13 +15093,13 @@ check_resize_entry(void) if ( pass ) { - result = H5C_resize_pinned_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); + result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_pinned_entry() reports failure 2."); + "H5C_resize_entry() reports failure 2."); failure_mssg = msg; } @@ -15266,7 +15156,7 @@ check_resize_entry(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG); } @@ -15317,7 +15207,7 @@ check_resize_entry(void) } - /* now repreat the above tests with several entries in the cache: */ + /* now repeat the above tests with several entries in the cache: */ if ( pass ) { @@ -15339,13 +15229,13 @@ check_resize_entry(void) if ( pass ) { protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, TRUE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); } @@ -15419,25 +15309,36 @@ check_resize_entry(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__SIZE_CHANGED_FLAG | H5C__DIRTIED_FLAG, (LARGE_ENTRY_SIZE / 2)); + result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 2)); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; - HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 3."); + HDsnprintf(msg, (size_t)128, "error(s) in H5C_resize_entry()."); failure_mssg = msg; - } else { + } else { - /* tidy up so we play nice with the standard protect / unprotect - * calls. - */ - entry_ptr->is_protected = FALSE; - entry_ptr->is_dirty = TRUE; - entry_ptr->size = LARGE_ENTRY_SIZE / 2; - } + 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); + + if ( result < 0 ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 3."); + failure_mssg = msg; + + } else { + + /* tidy up so we play nice with the standard protect / unprotect + * calls. + */ + entry_ptr->is_protected = FALSE; + entry_ptr->is_dirty = TRUE; + entry_ptr->size = LARGE_ENTRY_SIZE / 2; + } + } } if ( pass ) { @@ -15497,25 +15398,36 @@ check_resize_entry(void) if ( pass ) { - 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 | H5C__SIZE_CHANGED_FLAG), LARGE_ENTRY_SIZE); + result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); - if ( result < 0 ) { + if ( result < 0 ) { pass = FALSE; - HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 4."); + HDsnprintf(msg, (size_t)128, "error(s) in H5C_resize_entry()."); failure_mssg = msg; - } else { + } else { - /* tidy up so we play nice with the standard protect / unprotect - * calls. - */ - entry_ptr->is_protected = FALSE; - entry_ptr->is_dirty = TRUE; - entry_ptr->size = LARGE_ENTRY_SIZE; - } + 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); + + if ( result < 0 ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, "H5C_unprotect() reports failure 4."); + failure_mssg = msg; + + } else { + + /* tidy up so we play nice with the standard protect / unprotect + * calls. + */ + entry_ptr->is_protected = FALSE; + entry_ptr->is_dirty = TRUE; + entry_ptr->size = LARGE_ENTRY_SIZE; + } + } } if ( pass ) { @@ -15569,19 +15481,19 @@ check_resize_entry(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__PIN_ENTRY_FLAG); } if ( pass ) { - result = H5C_resize_pinned_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); + result = H5C_resize_entry((void *)entry_ptr, (LARGE_ENTRY_SIZE / 4)); if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_pinned_entry() reports failure 3."); + "H5C_resize_entry() reports failure 3."); failure_mssg = msg; } @@ -15638,13 +15550,13 @@ check_resize_entry(void) if ( pass ) { - result = H5C_resize_pinned_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); + result = H5C_resize_entry((void *)entry_ptr, LARGE_ENTRY_SIZE); if ( result < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, - "H5C_resize_pinned_entry() reports failure 4."); + "H5C_resize_entry() reports failure 4."); failure_mssg = msg; } @@ -15701,7 +15613,7 @@ check_resize_entry(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, FALSE, + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__UNPIN_ENTRY_FLAG | H5C__DELETED_FLAG); } @@ -15752,15 +15664,14 @@ check_resize_entry(void) } if ( pass ) { - protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DELETED_FLAG); protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, FALSE, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DELETED_FLAG); protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__DELETED_FLAG); } @@ -15941,8 +15852,7 @@ check_evictions_enabled(void) for ( i = 0; i < 16 ; i++ ) { protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } } @@ -15976,8 +15886,7 @@ check_evictions_enabled(void) /* protect and unprotect another entry */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 16); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 16, - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 16, H5C__NO_FLAGS_SET); } @@ -16045,7 +15954,7 @@ check_evictions_enabled(void) if ( pass ) { /* insert an entry */ - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 17, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 17, H5C__NO_FLAGS_SET); } @@ -16150,8 +16059,7 @@ check_evictions_enabled(void) /* protect and unprotect another entry */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 18); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 18, - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 18, H5C__NO_FLAGS_SET); } @@ -16182,7 +16090,7 @@ check_evictions_enabled(void) if ( pass ) { /* insert another entry */ - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, H5C__NO_FLAGS_SET); } @@ -16231,8 +16139,7 @@ check_evictions_enabled(void) /* protect and unprotect an entry that is in the cache */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 19); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 19, H5C__NO_FLAGS_SET); } @@ -16264,8 +16171,7 @@ check_evictions_enabled(void) /* protect and unprotect an entry that isn't in the cache */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 20); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 20, - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 20, H5C__NO_FLAGS_SET); } @@ -16391,8 +16297,7 @@ check_evictions_enabled(void) * the cache to grow. */ protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 21); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 21, - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 21, H5C__NO_FLAGS_SET); } @@ -16440,7 +16345,7 @@ check_evictions_enabled(void) if ( pass ) { /* insert an entry */ - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 22, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 22, H5C__NO_FLAGS_SET); } @@ -16591,7 +16496,7 @@ check_flush_protected_err(void) } else { - unprotect_entry(file_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); + 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 ) { @@ -16661,7 +16566,7 @@ check_destroy_pinned_err(void) (size_t)(1 * 1024)); protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) >= 0 ) { @@ -16757,7 +16662,7 @@ check_destroy_protected_err(void) } else { - unprotect_entry(file_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) < 0 ) { @@ -16854,7 +16759,7 @@ check_duplicate_insert_err(void) } else { - unprotect_entry(file_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); takedown_cache(file_ptr, FALSE, FALSE); } @@ -16875,9 +16780,9 @@ check_duplicate_insert_err(void) /*------------------------------------------------------------------------- - * Function: check_rename_err() + * Function: check_move_err() * - * Purpose: Verify that an attempt to rename an entry to the address + * Purpose: Verify that an attempt to move an entry to the address * of an existing entry will generate an error. * * Return: void @@ -16891,9 +16796,9 @@ check_duplicate_insert_err(void) */ static unsigned -check_rename_err(void) +check_move_err(void) { - const char * fcn_name = "check_rename_err()"; + const char * fcn_name = "check_move_err()"; herr_t result; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; @@ -16901,11 +16806,11 @@ check_rename_err(void) test_entry_t * entry_0_1_ptr; test_entry_t * entry_1_0_ptr; - TESTING("rename to existing entry errors"); + TESTING("move to existing entry errors"); pass = TRUE; - /* allocate a cache, and insert several entries. Try to rename + /* allocate a cache, and insert several entries. Try to move * entries to other entries resident in the cache. This should * fail. Destroy the cache -- should succeed. */ @@ -16918,9 +16823,9 @@ check_rename_err(void) (size_t)(1 * 1024)); cache_ptr = file_ptr->shared->cache; - insert_entry(file_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); - insert_entry(file_ptr, 0, 1, TRUE, H5C__NO_FLAGS_SET); - insert_entry(file_ptr, 1, 0, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, 0, 1, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, 1, 0, H5C__NO_FLAGS_SET); entry_0_0_ptr = &((entries[0])[0]); entry_0_1_ptr = &((entries[0])[1]); @@ -16929,25 +16834,25 @@ check_rename_err(void) if ( pass ) { - result = H5C_rename_entry(cache_ptr, &(types[0]), + result = H5C_move_entry(cache_ptr, &(types[0]), entry_0_0_ptr->addr, entry_0_1_ptr->addr); if ( result >= 0 ) { pass = FALSE; - failure_mssg = "rename to addr of same type succeeded.\n"; + failure_mssg = "move to addr of same type succeeded.\n"; } } if ( pass ) { - result = H5C_rename_entry(cache_ptr, &(types[0]), + result = H5C_move_entry(cache_ptr, &(types[0]), entry_0_0_ptr->addr, entry_1_0_ptr->addr); if ( result >= 0 ) { pass = FALSE; - failure_mssg = "rename to addr of different type succeeded.\n"; + failure_mssg = "move to addr of different type succeeded.\n"; } } @@ -16966,7 +16871,7 @@ check_rename_err(void) return (unsigned)!pass; -} /* check_rename_err() */ +} /* check_move_err() */ /*------------------------------------------------------------------------- @@ -17014,7 +16919,7 @@ check_double_pin_err(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); protect_entry(file_ptr, 0, 0); @@ -17025,7 +16930,7 @@ check_double_pin_err(void) 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, (size_t)0); + H5C__PIN_ENTRY_FLAG); if ( result > 0 ) { @@ -17035,7 +16940,7 @@ check_double_pin_err(void) } else { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); } } @@ -17111,7 +17016,7 @@ check_double_unpin_err(void) 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, (size_t)0); + H5C__UNPIN_ENTRY_FLAG); if ( result > 0 ) { @@ -17121,7 +17026,7 @@ check_double_unpin_err(void) } else { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } } @@ -17207,7 +17112,7 @@ check_pin_entry_errs(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } @@ -17226,7 +17131,7 @@ check_pin_entry_errs(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); protect_entry(file_ptr, 0, 0); } @@ -17244,7 +17149,7 @@ check_pin_entry_errs(void) } else { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__UNPIN_ENTRY_FLAG); } } @@ -17278,13 +17183,6 @@ check_pin_entry_errs(void) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * - * - Modified call to H5C_protect() to pass H5C__NO_FLAGS_SET in the - * the new flags parameter. - * - * JRM -- 3/28/07 - * *------------------------------------------------------------------------- */ @@ -17331,7 +17229,7 @@ check_double_protect_err(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } if ( pass ) { @@ -17363,16 +17261,6 @@ check_double_protect_err(void) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * - * JRM -- 6/17/05 - * Modified function to use the new dirtied parameter in - * H5C_unprotect(). - * - * JRM -- 9/8/05 - * Updated function for the new size change parameter in - * H5C_unprotect(). We don't use them for now. - * *------------------------------------------------------------------------- */ @@ -17402,7 +17290,7 @@ check_double_unprotect_err(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } @@ -17411,7 +17299,7 @@ check_double_unprotect_err(void) 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, (size_t)0); + H5C__NO_FLAGS_SET); if ( result > 0 ) { @@ -17444,13 +17332,7 @@ check_double_unprotect_err(void) * * Purpose: Verify that: * - * 1) a call to H5C_mark_pinned_entry_dirty with an upinned - * entry as the target will generate an error. - * - * 2) a call to H5C_mark_pinned_entry_dirty with a protected - * entry as the target will generate an error. - * - * 3) a call to H5C_mark_pinned_or_protected_entry_dirty with + * 1) a call to H5C_mark_entry_dirty with * and unpinned and unprotected entry will generate an * error. * @@ -17459,10 +17341,6 @@ check_double_unprotect_err(void) * Programmer: John Mainzer * 5/17/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -17478,14 +17356,8 @@ check_mark_entry_dirty_errs(void) pass = TRUE; - /* allocate a cache, protect an entry, and then attempt to mark it dirty - * with the H5C_mark_pinned_entry_dirty() call -- This should fail. - * - * Then unprotect the entry without pinning it, and try to mark it dirty - * again -- this should fail too. - * - * Try it again using H5C_mark_pinned_or_protected_entry_dirty -- this - * should fail as well. + /* allocate a cache, protect an entry, unprotect the entry without + * pinning it, and try to mark it dirty -- this should fail. * * Destroy the cache -- should succeed. */ @@ -17499,52 +17371,21 @@ check_mark_entry_dirty_errs(void) protect_entry(file_ptr, 0, 0); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); - - protect_entry(file_ptr, 0, 0); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } if ( pass ) { - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, FALSE, (size_t)0); - - if ( result > 0 ) { - - pass = FALSE; - failure_mssg = - "attempt dirty a pinned and protected entry succeeded.\n"; - - } else { - - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG); - } - } - - if ( pass ) { - - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, FALSE, (size_t)0); + result = H5C_mark_entry_dirty((void *)entry_ptr); if ( result > 0 ) { pass = FALSE; failure_mssg = - "attempt to dirty a unpinned and unprotected entry succeeded 1.\n"; - } - } - - if ( pass ) { - - result = H5C_mark_pinned_or_protected_entry_dirty((void *)entry_ptr); - - - if ( result > 0 ) { - - pass = FALSE; - failure_mssg = - "attempt to dirty a unpinned and unprotected entry succeeded 2.\n"; + "attempt to dirty a unpinned and unprotected entry succeeded.\n"; } } @@ -17634,7 +17475,7 @@ check_expunge_entry_errs(void) } else { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); } } @@ -17693,7 +17534,7 @@ check_expunge_entry_errs(void) /*------------------------------------------------------------------------- * Function: check_resize_entry_errs() * - * Purpose: Verify that invalid calls to H5C_resize_pinned_entry() + * Purpose: Verify that invalid calls to H5C_resize_entry() * generates errors as expected. * * Return: void @@ -17701,10 +17542,6 @@ check_expunge_entry_errs(void) * Programmer: John Mainzer * 7/7/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -17721,11 +17558,11 @@ check_resize_entry_errs(void) pass = TRUE; /* Allocate a cache, protect an entry, and then call - * H5C_resize_pinned_entry() to resize it -- this should fail. + * H5C_resize_entry() to resize it -- this should succeed. * * Unprotect the the entry with the pinned flag, and then call - * H5C_resize_pinned_entry() again with new size of zero. - * This should fail too. + * H5C_resize_entry() again with new size of zero. + * This should fail. * * Finally, unpin the entry and destroy the cache. * This should succeed. @@ -17746,30 +17583,30 @@ check_resize_entry_errs(void) if ( pass ) { - result = H5C_resize_pinned_entry((void *)entry_ptr, (size_t)1); + result = H5C_resize_entry((void *)entry_ptr, (size_t)1); - if ( result > 0 ) { + if ( result < 0 ) { pass = FALSE; failure_mssg = - "Call to H5C_resize_pinned_entry on a protected entry succeeded.\n"; + "Call to H5C_resize_entry on a protected entry failed.\n"; } else { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); } } if ( pass ) { - result = H5C_resize_pinned_entry((void *)entry_ptr, (size_t)0); + result = H5C_resize_entry((void *)entry_ptr, (size_t)0); - if ( result > 0 ) { + if ( result >= 0 ) { pass = FALSE; failure_mssg = - "Call to H5C_resize_pinned_entry with 0 new size succeeded.\n"; + "Call to H5C_resize_entry with 0 new size succeeded.\n"; } else { @@ -17807,10 +17644,6 @@ check_resize_entry_errs(void) * Programmer: John Mainzer * 4/3/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -17847,7 +17680,7 @@ check_unprotect_ro_dirty_err(void) result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG, (size_t)0); + H5C__DIRTIED_FLAG); if ( result >= 0 ) { @@ -17859,7 +17692,7 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } @@ -17891,7 +17724,7 @@ check_unprotect_ro_dirty_err(void) result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG, (size_t)0); + H5C__DIRTIED_FLAG); if ( result > 0 ) { @@ -17903,8 +17736,8 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } @@ -17988,7 +17821,7 @@ check_protect_ro_rw_err(void) if ( pass ) { - unprotect_entry(file_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET); } if ( pass ) { @@ -18163,9 +17996,9 @@ check_check_evictions_enabled_err(void) * * Modifications: * - * John Mainzer 1/8/08 - * Added a basic set of tests for the flash cache size - * increment code. + * John Mainzer 1/8/08 + * Added a basic set of tests for the flash cache size + * increment code. * *------------------------------------------------------------------------- */ @@ -18297,8 +18130,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, PICO_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18327,8 +18159,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18357,8 +18188,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, PICO_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18387,8 +18217,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18417,8 +18246,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18447,8 +18275,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18478,8 +18305,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18508,8 +18334,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18538,8 +18363,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18569,8 +18393,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18668,8 +18491,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18699,8 +18521,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18730,8 +18551,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18761,8 +18581,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18791,8 +18610,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18821,8 +18639,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18851,8 +18668,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -18862,8 +18678,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i + 1000); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i + 1000, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i + 1000, H5C__NO_FLAGS_SET); } i++; } @@ -18892,8 +18707,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -18922,8 +18736,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -19021,8 +18834,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -19051,8 +18863,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19081,8 +18892,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19111,8 +18921,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -19218,8 +19027,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19245,8 +19053,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19272,8 +19079,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19303,8 +19109,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19333,8 +19138,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19362,8 +19166,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19391,8 +19194,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19421,8 +19223,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19452,8 +19253,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -19479,8 +19279,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -19506,8 +19305,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -19536,8 +19334,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -19645,8 +19442,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19672,8 +19468,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19699,8 +19494,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19730,8 +19524,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19760,8 +19553,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19789,8 +19581,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19818,8 +19609,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19847,8 +19637,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19876,8 +19665,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19905,8 +19693,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19934,8 +19721,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19964,8 +19750,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -19995,8 +19780,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20022,8 +19806,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20051,8 +19834,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20081,8 +19863,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20189,8 +19970,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20216,8 +19996,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20243,8 +20022,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20274,8 +20052,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20304,8 +20081,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20333,8 +20109,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20362,8 +20137,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20392,8 +20166,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20423,8 +20196,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20450,8 +20222,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20477,8 +20248,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20507,8 +20277,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -20614,8 +20383,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20641,8 +20409,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20668,8 +20435,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20696,8 +20462,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20724,8 +20489,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20752,8 +20516,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20781,8 +20544,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20883,8 +20645,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20910,8 +20671,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20945,8 +20705,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -20976,8 +20735,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21007,8 +20765,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21039,8 +20796,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21069,8 +20825,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21100,8 +20855,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21132,8 +20886,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21164,8 +20917,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21196,8 +20948,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21226,8 +20977,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21256,8 +21006,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21286,8 +21035,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21316,8 +21064,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21346,8 +21093,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -21477,8 +21223,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, HUGE_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } if ( ( pass ) && @@ -21505,8 +21250,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } if ( ( pass ) && @@ -21533,8 +21277,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 1, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || @@ -21558,8 +21301,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 2, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || @@ -21615,14 +21357,13 @@ check_auto_cache_resize(void) /* insert a huge entry into the cache */ if ( pass ) { - insert_entry(file_ptr, HUGE_ENTRY_TYPE, 1, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); + /* protect and unprotect a couple times to increment cache_accesses */ protect_entry(file_ptr, HUGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); protect_entry(file_ptr, HUGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, HUGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || @@ -21645,7 +21386,7 @@ check_auto_cache_resize(void) */ if ( pass ) { - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 4, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (80 * 1024) ) || @@ -21666,7 +21407,7 @@ check_auto_cache_resize(void) */ if ( pass ) { - insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 5, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, MONSTER_ENTRY_TYPE, 5, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || @@ -21690,8 +21431,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 6); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 6, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 6, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || @@ -21718,20 +21458,20 @@ check_auto_cache_resize(void) expunge_entry(file_ptr, MONSTER_ENTRY_TYPE, 6); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 10, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 11, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 12, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 13, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, 1024, TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__DIRTIED_FLAG); flush_cache(file_ptr, TRUE, FALSE, FALSE); @@ -21766,20 +21506,16 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 13, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || @@ -21801,8 +21537,8 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 10, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 3 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (3 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); if ( ( pass ) && @@ -21826,8 +21562,8 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 10, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 10 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (10 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); if ( ( pass ) && @@ -21850,8 +21586,8 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 11, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 10 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (10 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); if ( ( pass ) && @@ -21874,8 +21610,8 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 12, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 10 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (10 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); if ( ( pass ) && @@ -21899,14 +21635,16 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 10, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 11, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 12, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); if ( pass ) { @@ -21939,8 +21677,7 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, - H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE); if ( ( pass ) && @@ -21978,8 +21715,7 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, - H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE); if ( ( pass ) && @@ -21999,8 +21735,7 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, - H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__PIN_ENTRY_FLAG); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE); if ( ( pass ) && @@ -22023,16 +21758,13 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, - H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__UNPIN_ENTRY_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, - H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__UNPIN_ENTRY_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, - H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__UNPIN_ENTRY_FLAG); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -22055,14 +21787,16 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 10, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 11, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__DIRTIED_FLAG); + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry_with_size_change(file_ptr, VARIABLE_ENTRY_TYPE, 12, - H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, (1 * 1024), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__DIRTIED_FLAG); if ( pass ) { @@ -22091,9 +21825,8 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, - H5C__PIN_ENTRY_FLAG); - resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__PIN_ENTRY_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || @@ -22111,7 +21844,7 @@ check_auto_cache_resize(void) if ( pass ) { - resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) || @@ -22130,9 +21863,8 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, - H5C__PIN_ENTRY_FLAG); - resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__PIN_ENTRY_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -22151,9 +21883,8 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, - H5C__PIN_ENTRY_FLAG); - resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__PIN_ENTRY_FLAG); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -22175,16 +21906,13 @@ check_auto_cache_resize(void) if ( pass ) { protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, - H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 10, H5C__UNPIN_ENTRY_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, - H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 11, H5C__UNPIN_ENTRY_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, - H5C__UNPIN_ENTRY_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 12, H5C__UNPIN_ENTRY_FLAG); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || @@ -22304,8 +22032,7 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (4 * 1024) ) || @@ -22331,8 +22058,7 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (12 * 1024) ) || @@ -22357,11 +22083,9 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); protect_entry(file_ptr, LARGE_ENTRY_TYPE, 3); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 3, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (12 * 1024) ) || @@ -22390,8 +22114,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, TINY_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, TINY_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, TINY_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -22414,8 +22137,7 @@ check_auto_cache_resize(void) rpt_fcn_called = FALSE; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (4 * 1024 + 128) ) || @@ -22444,8 +22166,7 @@ check_auto_cache_resize(void) protect_entry(file_ptr, TINY_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, TINY_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, TINY_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -22496,9 +22217,9 @@ check_auto_cache_resize(void) * * Modifications: * - * Added code to include the flash cache size increment - * code in this test. - * JRM -- 1/10/08 + * Added code to include the flash cache size increment + * code in this test. + * JRM -- 1/10/08 * *------------------------------------------------------------------------- */ @@ -22697,8 +22418,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -22728,8 +22448,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -22758,8 +22477,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -22857,8 +22575,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -22888,8 +22605,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -22918,8 +22634,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23018,8 +22733,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23049,8 +22763,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23079,8 +22792,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23180,8 +22892,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23209,8 +22920,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23239,8 +22949,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23338,8 +23047,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23368,8 +23076,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23398,8 +23105,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23497,8 +23203,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23527,8 +23232,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23557,8 +23261,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23666,8 +23369,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23696,8 +23398,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23728,8 +23429,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23758,8 +23458,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23790,8 +23489,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -23897,8 +23595,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23927,8 +23624,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23959,8 +23655,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -23989,8 +23684,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24021,8 +23715,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -24135,8 +23828,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24165,8 +23857,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24199,8 +23890,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24231,8 +23921,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24265,8 +23954,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 999); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 999, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 999, H5C__NO_FLAGS_SET); } i++; } @@ -24369,8 +24057,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24401,8 +24088,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -24498,8 +24184,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24530,8 +24215,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -24627,8 +24311,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24659,8 +24342,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -24756,8 +24438,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24788,8 +24469,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -24886,8 +24566,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -24918,8 +24597,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -25016,8 +24694,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -25048,8 +24725,7 @@ check_auto_cache_resize_disable(void) protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -25169,8 +24845,7 @@ check_auto_cache_resize_disable(void) rpt_fcn_called = FALSE; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || @@ -25209,8 +24884,7 @@ check_auto_cache_resize_disable(void) rpt_fcn_called = FALSE; protect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0); - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); if ( ( pass ) && ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || @@ -25459,8 +25133,7 @@ check_auto_cache_resize_epoch_markers(void) protect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MEDIUM_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -25492,8 +25165,7 @@ check_auto_cache_resize_epoch_markers(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -25524,8 +25196,7 @@ check_auto_cache_resize_epoch_markers(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -25638,8 +25309,7 @@ check_auto_cache_resize_epoch_markers(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -25830,8 +25500,7 @@ check_auto_cache_resize_epoch_markers(void) protect_entry(file_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, SMALL_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -25988,65 +25657,6 @@ check_auto_cache_resize_epoch_markers(void) *------------------------------------------------------------------------- */ -/* Epsilon for floating-point comparisons */ -#define FP_EPSILON 0.000001 - -static hbool_t -resize_configs_are_equal(const H5C_auto_size_ctl_t *a, - const H5C_auto_size_ctl_t *b, - hbool_t compare_init) -{ - if(a->version != b->version) - return(FALSE); - else if(a->rpt_fcn != b->rpt_fcn) - return(FALSE); - else if(compare_init && (a->set_initial_size != b->set_initial_size)) - 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) - return(FALSE); - else if(a->max_size != b->max_size) - return(FALSE); - else if(a->min_size != b->min_size) - return(FALSE); - else if(a->epoch_length != b->epoch_length) - 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) - return(FALSE); - else if(HDfabs(a->increment - b->increment) > FP_EPSILON) - return(FALSE); - else if(a->apply_max_increment != b->apply_max_increment) - return(FALSE); - else if(a->max_increment != b->max_increment) - 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) - return(FALSE); - else if(HDfabs(a->flash_threshold - b->flash_threshold) > FP_EPSILON) - 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) - return(FALSE); - else if(HDfabs(a->decrement - b->decrement) > FP_EPSILON) - return(FALSE); - else if(a->apply_max_decrement != b->apply_max_decrement) - return(FALSE); - else if(a->max_decrement != b->max_decrement) - return(FALSE); - else if(a->epochs_before_eviction != b->epochs_before_eviction) - 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) - return(FALSE); - return(TRUE); -} - static unsigned check_auto_cache_resize_input_errs(void) { @@ -28596,8 +28206,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { - unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i, H5C__NO_FLAGS_SET); } i++; } @@ -28642,8 +28251,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { - unprotect_entry(file_ptr, PICO_ENTRY_TYPE, 0, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, PICO_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } i++; } @@ -28658,7 +28266,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( HDfabs(hit_rate - 0.5) > FP_EPSILON ) { /* i.e. hit_rate != 0.5 */ + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = @@ -28725,8 +28333,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { - unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i + 500, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, PICO_ENTRY_TYPE, i + 500, H5C__NO_FLAGS_SET); } i++; } @@ -28742,7 +28349,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( HDfabs(hit_rate - 0.5) > FP_EPSILON ) { /* i.e. hit_rate != 0.5 */ + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = @@ -28830,8 +28437,7 @@ check_auto_cache_resize_aux_fcns(void) } if ( pass ) { - unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, MONSTER_ENTRY_TYPE, 0, H5C__NO_FLAGS_SET); } if ( pass ) { @@ -29254,7 +28860,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { @@ -29265,8 +28870,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* Change expected values, and verify the status of the entries @@ -29315,7 +28919,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { protect_entry(file_ptr, /* H5F_t * file_ptr */ @@ -29325,8 +28928,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* Verify the status of the entries. @@ -29371,7 +28973,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { protect_entry(file_ptr, /* H5F_t * file_ptr */ @@ -29381,8 +28982,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* Verify the status of the entries. @@ -29425,7 +29025,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { protect_entry(file_ptr, /* H5F_t * file_ptr */ @@ -29435,8 +29034,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* Expected staus is that after each insertion, the entry @@ -29499,7 +29097,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { protect_entry(file_ptr, /* H5F_t * file_ptr */ @@ -29509,8 +29106,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* Verify the status of the entries. @@ -29564,7 +29160,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { protect_entry(file_ptr, /* H5F_t * file_ptr */ @@ -29574,8 +29169,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* This past inserted entry is now in the cache and dirty */ @@ -29696,7 +29290,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { @@ -29707,8 +29300,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* This past inserted entry is now in the cache and dirty */ @@ -29739,7 +29331,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { protect_entry(file_ptr, /* H5F_t * file_ptr */ @@ -29749,8 +29340,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx++, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* Verify the status of the entries. @@ -29794,7 +29384,6 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) insert_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* hbool_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ } else { @@ -29805,8 +29394,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ entry_idx, /* int32_t idx */ - TRUE, /* int32_t dirty */ - H5C__NO_FLAGS_SET); /* unsigned int flags */ + H5C__DIRTIED_FLAG); /* unsigned int flags */ } /* This past inserted entry is now in the cache and dirty */ @@ -29902,7 +29490,7 @@ check_flush_deps(void) /* Insert entries to work with into the cache */ for(u = 0; u < 5; u++) { - insert_entry(file_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, entry_type, (int32_t)u, H5C__NO_FLAGS_SET); if ( !pass ) CACHE_ERROR("insert_entry failed") /* Change expected values, and verify the status of the entries @@ -29990,7 +29578,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30056,7 +29643,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30164,7 +29750,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 3, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30191,7 +29776,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30218,7 +29802,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30324,7 +29907,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30357,7 +29939,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30387,7 +29968,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 3, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30502,7 +30082,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 3, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30529,7 +30108,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30556,7 +30134,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30671,7 +30248,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30704,7 +30280,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30734,7 +30309,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 3, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30804,7 +30378,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30915,7 +30488,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30945,7 +30517,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -30972,7 +30543,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31123,7 +30693,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31150,7 +30719,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31177,7 +30745,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31320,7 +30887,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31347,7 +30913,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31374,7 +30939,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31440,7 +31004,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31513,7 +31076,6 @@ check_flush_deps(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31589,7 +31151,7 @@ check_flush_deps_err(void) /* Insert entries to work with into the cache */ for(u = 0; u < 10; u++) { - insert_entry(file_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, entry_type, (int32_t)u, H5C__NO_FLAGS_SET); if ( !pass ) CACHE_ERROR("insert_entry failed") } /* end for */ @@ -31612,7 +31174,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") break; @@ -31637,14 +31198,12 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") break; @@ -31696,7 +31255,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 6, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31709,7 +31267,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 7, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31719,7 +31276,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31729,7 +31285,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31739,7 +31294,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31749,7 +31303,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 3, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31759,7 +31312,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31769,7 +31321,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 5, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") break; @@ -31791,7 +31342,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") break; @@ -31813,7 +31363,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") break; @@ -31847,7 +31396,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31857,7 +31405,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31867,7 +31414,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 3, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") break; @@ -31896,7 +31442,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -31906,7 +31451,6 @@ check_flush_deps_err(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") break; @@ -31985,7 +31529,7 @@ check_flush_deps_order(void) /* Insert entries to work with into the cache */ for(u = 0; u < 5; u++) { - insert_entry(file_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, entry_type, (int32_t)u, H5C__NO_FLAGS_SET); if ( !pass ) CACHE_ERROR("insert_entry failed") /* Change expected values, and verify the status of the entries @@ -32042,7 +31586,6 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -32139,7 +31682,6 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -32250,7 +31792,6 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -32372,7 +31913,6 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -32537,21 +32077,18 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 3, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -32765,21 +32302,18 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -32950,7 +32484,6 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -33087,7 +32620,6 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -33275,21 +32807,18 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 0, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -33528,21 +33057,18 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -33798,21 +33324,18 @@ check_flush_deps_order(void) unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 1, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 2, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") unprotect_entry(file_ptr, /* H5F_t * file_ptr */ entry_type, /* int32_t type */ 4, /* int32_t idx */ - FALSE, /* int32_t dirty */ H5C__NO_FLAGS_SET); /* unsigned int flags */ if ( !pass ) CACHE_ERROR("unprotect_entry failed") @@ -34016,7 +33539,7 @@ check_notify_cb(void) /* Insert entries to work with into the cache */ for(u = 0; u < 5; u++) { - insert_entry(file_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET); + insert_entry(file_ptr, entry_type, (int32_t)u, H5C__NO_FLAGS_SET); if ( !pass ) CACHE_ERROR("insert_entry failed") /* Change expected values, and verify the status of the entries @@ -34098,7 +33621,7 @@ check_notify_cb(void) /* Unprotect entries, evicting them from the cache */ for(u = 0; u < 5; u++) { - unprotect_entry(file_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, entry_type, (int32_t)u, H5C__DIRTIED_FLAG); if ( !pass ) CACHE_ERROR("unprotect_entry failed") /* Change expected values, and verify the status of the entries @@ -34215,7 +33738,7 @@ main(void) nerrs += check_get_entry_status(); nerrs += check_expunge_entry(); nerrs += check_multiple_read_protect(); - nerrs += check_rename_entry(); + nerrs += check_move_entry(); nerrs += check_pin_protected_entry(); nerrs += check_resize_entry(); nerrs += check_evictions_enabled(); @@ -34223,7 +33746,7 @@ main(void) nerrs += check_destroy_pinned_err(); nerrs += check_destroy_protected_err(); nerrs += check_duplicate_insert_err(); - nerrs += check_rename_err(); + nerrs += check_move_err(); nerrs += check_double_pin_err(); nerrs += check_double_unpin_err(); nerrs += check_pin_entry_errs(); diff --git a/test/cache_api.c b/test/cache_api.c index e7ba7bd..8fd2912 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -30,59 +30,12 @@ /* macro definitions */ -#define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \ -( ( (a).version == (b).version ) && \ - ( (a).rpt_fcn == (b).rpt_fcn ) && \ - ( ( ! compare_init ) || \ - ( (a).set_initial_size == (b).set_initial_size ) ) && \ - ( ( ! compare_init ) || \ - ( (a).initial_size == (b).initial_size ) ) && \ - ( (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 ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (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 ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ - ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (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 ) && \ - ( (a).empty_reserve == (b).empty_reserve ) ) - - /* private function declarations: */ static void check_fapl_mdc_api_calls(void); -static void validate_mdc_config(hid_t file_id, - H5AC_cache_config_t * ext_config_ptr, - hbool_t compare_init, - int test_num); - static void check_file_mdc_api_calls(void); -static void check_and_validate_cache_hit_rate(hid_t file_id, - double * hit_rate_ptr, - hbool_t dump_data, - int64_t min_accesses, - double min_hit_rate); - -static void check_and_validate_cache_size(hid_t file_id, - size_t * max_size_ptr, - size_t * min_clean_size_ptr, - size_t * cur_size_ptr, - int32_t * cur_num_entries_ptr, - hbool_t dump_data); - static void mdc_api_call_smoke_check(int express_test); static void check_fapl_mdc_api_errs(void); @@ -117,73 +70,6 @@ static void check_file_mdc_api_errs(void); *------------------------------------------------------------------------- */ -#define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \ - ( ( (a).version == (b).version ) && \ - ( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \ - ( (a).open_trace_file == (b).open_trace_file ) && \ - ( (a).close_trace_file == (b).close_trace_file ) && \ - ( ( (a).open_trace_file == FALSE ) || \ - ( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \ - ( (a).evictions_enabled == (b).evictions_enabled ) && \ - ( ( ! cmp_set_init ) || \ - ( (a).set_initial_size == (b).set_initial_size ) ) && \ - ( ( ! cmp_init_size ) || \ - ( (a).initial_size == (b).initial_size ) ) && \ - ( (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 ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (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 ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ - ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (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 ) && \ - ( (a).empty_reserve == (b).empty_reserve ) ) - -#define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \ -{ \ - (i).version = H5C__CURR_AUTO_SIZE_CTL_VER; \ - if ( (e).rpt_fcn_enabled ) \ - (i).rpt_fcn = H5C_def_auto_resize_rpt_fcn; \ - else \ - (i).rpt_fcn = NULL; \ - (i).set_initial_size = (e).set_initial_size; \ - (i).initial_size = (e).initial_size; \ - (i).min_clean_fraction = (e).min_clean_fraction; \ - (i).max_size = (e).max_size; \ - (i).min_size = (e).min_size; \ - (i).epoch_length = (long int)((e).epoch_length); \ - (i).incr_mode = (e).incr_mode; \ - (i).lower_hr_threshold = (e).lower_hr_threshold; \ - (i).increment = (e).increment; \ - (i).apply_max_increment = (e).apply_max_increment; \ - (i).max_increment = (e).max_increment; \ - (i).flash_incr_mode = (e).flash_incr_mode; \ - (i).flash_multiple = (e).flash_multiple; \ - (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; \ - (i).epochs_before_eviction = (int)((e).epochs_before_eviction); \ - (i).apply_empty_reserve = (e).apply_empty_reserve; \ - (i).empty_reserve = (e).empty_reserve; \ -} - static void check_fapl_mdc_api_calls(void) { @@ -377,12 +263,12 @@ check_fapl_mdc_api_calls(void) /* conpare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! RESIZE_CONFIGS_ARE_EQUAL(default_auto_size_ctl, \ - cache_ptr->resize_ctl, TRUE) ) { + if ( ! resize_configs_are_equal(&default_auto_size_ctl, \ + &cache_ptr->resize_ctl, TRUE) ) { pass = FALSE; - failure_mssg = "Unexpected value(s) in cache resize_ctl.\n"; + failure_mssg = "Unexpected value(s) in cache resize_ctl 1.\n"; } } @@ -526,12 +412,12 @@ check_fapl_mdc_api_calls(void) /* conpare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! RESIZE_CONFIGS_ARE_EQUAL(mod_auto_size_ctl, \ - cache_ptr->resize_ctl, TRUE) ) { + if ( ! resize_configs_are_equal(&mod_auto_size_ctl, \ + &cache_ptr->resize_ctl, TRUE) ) { pass = FALSE; - failure_mssg = "Unexpected value(s) in cache resize_ctl.\n"; + failure_mssg = "Unexpected value(s) in cache resize_ctl 2.\n"; } } @@ -608,128 +494,6 @@ check_fapl_mdc_api_calls(void) /*------------------------------------------------------------------------- - * Function: validate_mdc_config() - * - * Purpose: Verify that the file indicated by the file_id parameter - * has both internal and external configuration matching - * *config_ptr. - * - * Do nothin on success. On failure, set pass to FALSE, and - * load an error message into failue_mssg. Note that - * failure_msg is assumed to be at least 128 bytes in length. - * - * Return: void - * - * Programmer: John Mainzer - * 4/14/04 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ - -static void -validate_mdc_config(hid_t file_id, - H5AC_cache_config_t * ext_config_ptr, - hbool_t compare_init, - int test_num) -{ - /* const char * fcn_name = "validate_mdc_config()"; */ - static char msg[256]; - H5F_t * file_ptr = NULL; - H5C_t * cache_ptr = NULL; - H5AC_cache_config_t scratch; - H5C_auto_size_ctl_t int_config; - - XLATE_EXT_TO_INT_MDC_CONFIG(int_config, (*ext_config_ptr)) - - /* get a pointer to the files internal data structure */ - if ( pass ) { - - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); - - if ( file_ptr == NULL ) { - - pass = FALSE; - HDsnprintf(msg, (size_t)128, "Can't get file_ptr #%d.", test_num); - failure_mssg = msg; - - } else { - - cache_ptr = file_ptr->shared->cache; - } - } - - /* verify that we can access the internal version of the cache config */ - if ( pass ) { - - if ( ( cache_ptr == NULL ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || - ( cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER ) ){ - - pass = FALSE; - HDsnprintf(msg, (size_t)128, - "Can't access cache resize_ctl #%d.", test_num); - failure_mssg = msg; - } - } - - /* compare the cache's internal configuration with the expected value */ - if ( pass ) { - - if ( ! RESIZE_CONFIGS_ARE_EQUAL(int_config, cache_ptr->resize_ctl, - compare_init) ) { - - pass = FALSE; - HDsnprintf(msg, (size_t)128, - "Unexpected internal config #%d.", test_num); - failure_mssg = msg; - } - } - - /* obtain external cache config */ - if ( pass ) { - - scratch.version = H5AC__CURR_CACHE_CONFIG_VERSION; - - if ( H5Fget_mdc_config(file_id, &scratch) < 0 ) { - - pass = FALSE; - HDsnprintf(msg, (size_t)128, - "H5Fget_mdc_config() failed #%d.", test_num); - failure_mssg = msg; - } - } - - if ( pass ) { - - /* Recall that in any configuration supplied by the cache - * at run time, the set_initial_size field will always - * be FALSE, regardless of the value passed in. Thus we - * always presume that this field need not match that of - * the supplied external configuration. - * - * The cache also sets the initial_size field to the current - * cache max size instead of the value initialy supplied. - * Depending on circumstances, this may or may not match - * the original. Hence the compare_init parameter. - */ - if ( ! CACHE_CONFIGS_EQUAL((*ext_config_ptr), scratch, \ - FALSE, compare_init) ) { - - pass = FALSE; - HDsnprintf(msg, (size_t)128, - "Unexpected external config #%d.", test_num); - failure_mssg = msg; - } - } - - return; - -} /* validate_mdc_config() */ - - -/*------------------------------------------------------------------------- * Function: check_file_mdc_api_calls() * * Purpose: Verify that the file related metadata cache API calls are @@ -1072,282 +836,6 @@ check_file_mdc_api_calls(void) /*------------------------------------------------------------------------- - * Function: check_and_validate_cache_hit_rate() - * - * Purpose: Use the API functions to get and reset the cache hit rate. - * Verify that the value returned by the API call agrees with - * the cache internal data structures. - * - * If the number of cache accesses exceeds the value provided - * in the min_accesses parameter, and the hit rate is less than - * min_hit_rate, set pass to FALSE, and set failure_mssg to - * a string indicating that hit rate was unexpectedly low. - * - * Return hit rate in *hit_rate_ptr, and print the data to - * stdout if requested. - * - * If an error is detected, set pass to FALSE, and set - * failure_mssg to an appropriate value. - * - * Return: void - * - * Programmer: John Mainzer - * 4/18/04 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ - -static void -check_and_validate_cache_hit_rate(hid_t file_id, - double * hit_rate_ptr, - hbool_t dump_data, - int64_t min_accesses, - double min_hit_rate) -{ - /* const char * fcn_name = "check_and_validate_cache_hit_rate()"; */ - herr_t result; - int64_t cache_hits = 0; - int64_t cache_accesses = 0; - double expected_hit_rate; - double hit_rate; - H5F_t * file_ptr = NULL; - H5C_t * cache_ptr = NULL; - - /* get a pointer to the files internal data structure */ - if ( pass ) { - - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); - - if ( file_ptr == NULL ) { - - pass = FALSE; - failure_mssg = "Can't get file_ptr."; - - } else { - - cache_ptr = file_ptr->shared->cache; - } - } - - /* verify that we can access the cache data structure */ - if ( pass ) { - - if ( ( cache_ptr == NULL ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { - - pass = FALSE; - failure_mssg = "Can't access cache resize_ctl."; - } - } - - /* compare the cache's internal configuration with the expected value */ - if ( pass ) { - - cache_hits = cache_ptr->cache_hits; - cache_accesses = cache_ptr->cache_accesses; - - if ( cache_accesses > 0 ) { - - expected_hit_rate = ((double)cache_hits) / ((double)cache_accesses); - - } else { - - expected_hit_rate = 0.0; - } - - result = H5Fget_mdc_hit_rate(file_id, &hit_rate); - - if ( result < 0 ) { - - pass = FALSE; - failure_mssg = "H5Fget_mdc_hit_rate() failed."; - - } else if ( hit_rate != expected_hit_rate ) { - - pass = FALSE; - failure_mssg = "unexpected hit rate."; - } - } - - if ( pass ) { /* reset the hit rate */ - - result = H5Freset_mdc_hit_rate_stats(file_id); - - if ( result < 0 ) { - - pass = FALSE; - failure_mssg = "H5Freset_mdc_hit_rate_stats() failed."; - } - } - - /* set *hit_rate_ptr if appropriate */ - if ( ( pass ) && ( hit_rate_ptr != NULL ) ) { - - *hit_rate_ptr = hit_rate; - } - - /* dump data to stdout if requested */ - if ( ( pass ) && ( dump_data ) ) { - - HDfprintf(stdout, - "cache_hits: %ld, cache_accesses: %ld, hit_rate: %lf\n", - (long)cache_hits, (long)cache_accesses, hit_rate); - } - - if ( ( pass ) && - ( cache_accesses > min_accesses ) && - ( hit_rate < min_hit_rate ) ) { - - pass = FALSE; - failure_mssg = "Unexpectedly low hit rate."; - } - - return; - -} /* check_and_validate_cache_hit_rate() */ - - -/*------------------------------------------------------------------------- - * Function: check_and_validate_cache_size() - * - * Purpose: Use the API function to get the cache size data. Verify - * that the values returned by the API call agree with - * the cache internal data structures. - * - * Return size data in the locations specified by the pointer - * parameters if these parameters are not NULL. Print the - * data to stdout if requested. - * - * If an error is detected, set pass to FALSE, and set - * failure_mssg to an appropriate value. - * - * Return: void - * - * Programmer: John Mainzer - * 4/18/04 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ - -static void -check_and_validate_cache_size(hid_t file_id, - size_t * max_size_ptr, - size_t * min_clean_size_ptr, - size_t * cur_size_ptr, - int32_t * cur_num_entries_ptr, - hbool_t dump_data) -{ - /* const char * fcn_name = "check_and_validate_cache_size()"; */ - herr_t result; - size_t expected_max_size; - size_t max_size; - size_t expected_min_clean_size; - size_t min_clean_size; - size_t expected_cur_size; - size_t cur_size; - int32_t expected_cur_num_entries; - int cur_num_entries; - H5F_t * file_ptr = NULL; - H5C_t * cache_ptr = NULL; - - /* get a pointer to the files internal data structure */ - if ( pass ) { - - file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); - - if ( file_ptr == NULL ) { - - pass = FALSE; - failure_mssg = "Can't get file_ptr."; - - } else { - - cache_ptr = file_ptr->shared->cache; - } - } - - /* verify that we can access the cache data structure */ - if ( pass ) { - - if ( ( cache_ptr == NULL ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { - - pass = FALSE; - failure_mssg = "Can't access cache data structure."; - } - } - - /* compare the cache's internal configuration with the expected value */ - if ( pass ) { - - expected_max_size = cache_ptr->max_cache_size; - expected_min_clean_size = cache_ptr->min_clean_size; - expected_cur_size = cache_ptr->index_size; - expected_cur_num_entries = cache_ptr->index_len; - - result = H5Fget_mdc_size(file_id, - &max_size, - &min_clean_size, - &cur_size, - &cur_num_entries); - - if ( result < 0 ) { - - pass = FALSE; - failure_mssg = "H5Fget_mdc_size() failed."; - - } else if ( ( max_size != expected_max_size ) || - ( min_clean_size != expected_min_clean_size ) || - ( cur_size != expected_cur_size ) || - ( cur_num_entries != (int)expected_cur_num_entries ) ) { - - pass = FALSE; - failure_mssg = "H5Fget_mdc_size() returned unexpected value(s)."; - - } - } - - /* return size values if requested */ - if ( ( pass ) && ( max_size_ptr != NULL ) ) { - - *max_size_ptr = max_size; - } - - if ( ( pass ) && ( min_clean_size_ptr != NULL ) ) { - - *min_clean_size_ptr = min_clean_size; - } - - if ( ( pass ) && ( cur_size_ptr != NULL ) ) { - - *cur_size_ptr = cur_size; - } - - if ( ( pass ) && ( cur_num_entries_ptr != NULL ) ) { - - *cur_num_entries_ptr = cur_num_entries; - } - - - /* dump data to stdout if requested */ - if ( ( pass ) && ( dump_data ) ) { - - HDfprintf(stdout, - "max_sz: %ld, min_clean_sz: %ld, cur_sz: %ld, cur_ent: %ld\n", - (long)max_size, (long)min_clean_size, (long)cur_size, - (long)cur_num_entries); - } - - return; - -} /* check_and_validate_cache_size() */ - - -/*------------------------------------------------------------------------- * Function: mdc_api_call_smoke_check() * * Purpose: @@ -3424,7 +2912,9 @@ check_fapl_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - H5E_BEGIN_TRY { result = H5Pget_mdc_config(-1, &scratch); } H5E_END_TRY; + H5E_BEGIN_TRY { + result = H5Pget_mdc_config(-1, &scratch); + } H5E_END_TRY; if ( result >= 0 ) { diff --git a/test/cache_common.c b/test/cache_common.c index a684e92..312de3d 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -64,20 +64,93 @@ hbool_t try_core_file_driver = FALSE; hbool_t core_file_driver_failed = FALSE; const char *failure_mssg = NULL; -test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; -test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; -test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; -test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; -test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; -test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; -test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; -test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; -test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; -test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; -test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES]; +static test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; +static test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; +static test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; +static test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; +static test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; +static test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; +static test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; +static test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; +static test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; +static test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; +static test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES]; 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 notify_notify(H5C_notify_action_t action, void *thing); + test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = { pico_entries, @@ -304,6 +377,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, /* address translation funtions: */ + /*------------------------------------------------------------------------- * Function: addr_to_type_and_index * @@ -473,10 +547,6 @@ check_write_permitted(const H5F_t UNUSED * f, * Programmer: John Mainzer * 6/10/04 * - * Modifications: - * - * Added variable_clear. -- JRM 8/30/06 - * *------------------------------------------------------------------------- */ @@ -608,16 +678,6 @@ notify_clear(H5F_t * f, void * thing, hbool_t dest) * Programmer: John Mainzer * 6/10/04 * - * Modifications: - * - * JRM -- 4/4/06 - * Added code to decrement the pinning_ref_count s of entries - * pinned by the target entry, and to unpin those entries - * if the reference count drops to zero. - * - * JRM -- 8/30/06 - * Added variable_destroy(). - * *------------------------------------------------------------------------- */ @@ -781,14 +841,6 @@ notify_dest(H5F_t * f, void * thing) * Programmer: John Mainzer * 6/10/04 * - * Modifications: - * - * JRM -- 8/30/06 - * Added variable_flush() and flags_ptr parameter. - * - * JRM -- 9/1/06 - * Added support for flush operations. - * *------------------------------------------------------------------------- */ @@ -968,11 +1020,6 @@ notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, * Programmer: John Mainzer * 6/10/04 * - * Modifications: - * - * JRM -- 8/30/06 - * Added variable_load(). - * *------------------------------------------------------------------------- */ @@ -1103,11 +1150,6 @@ notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) * Programmer: John Mainzer * 6/10/04 * - * Modifications: - * - * JRM -- 8/30/06 - * Added variable_size(). - * *------------------------------------------------------------------------- */ @@ -1418,8 +1460,7 @@ create_pinned_entry_dependency(H5F_t * file_ptr, if ( pinned_entry_ptr->pinning_ref_count == 0 ) { protect_entry(file_ptr, pinned_type, pinned_idx); - unprotect_entry(file_ptr, pinned_type, pinned_idx, FALSE, - H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, pinned_type, pinned_idx, H5C__PIN_ENTRY_FLAG); } (pinned_entry_ptr->pinning_ref_count)++; @@ -1439,7 +1480,7 @@ create_pinned_entry_dependency(H5F_t * file_ptr, * If the dirty_pin parameter is true, verify that the * target entry is in the cache and is pinned. If it * isn't, scream and die. If it is, use the - * H5C_mark_pinned_entry_dirty() call to dirty it. + * H5C_mark_entry_dirty() call to dirty it. * * Do nothing if pass is false on entry. * @@ -1492,14 +1533,14 @@ dirty_entry(H5F_t * file_ptr, } else { - mark_pinned_entry_dirty(type, idx, FALSE, (size_t)0); + mark_entry_dirty(type, idx); } } } else { protect_entry(file_ptr, type, idx); - unprotect_entry(file_ptr, type, idx, TRUE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG); } } @@ -1532,7 +1573,7 @@ execute_flush_op(H5F_t * file_ptr, { H5C_t * cache_ptr; - HDassert( file_ptr ) ; + HDassert( file_ptr ); cache_ptr = file_ptr->shared->cache; HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -1543,7 +1584,7 @@ execute_flush_op(H5F_t * file_ptr, ( entry_ptr->header.size == entry_ptr->size ) ); HDassert( op_ptr != NULL ); HDassert( ( 0 <= entry_ptr->type ) && - ( entry_ptr->type < NUMBER_OF_ENTRY_TYPES ) ); + ( entry_ptr->type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= entry_ptr->index ) && ( entry_ptr->index <= max_indices[entry_ptr->type] ) ); HDassert( ( 0 <= op_ptr->type ) && @@ -1600,8 +1641,8 @@ execute_flush_op(H5F_t * file_ptr, } break; - case FLUSH_OP__RENAME: - rename_entry(cache_ptr, op_ptr->type, op_ptr->idx, + case FLUSH_OP__MOVE: + move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); break; @@ -1817,24 +1858,20 @@ reset_entries(void) /*------------------------------------------------------------------------- - * Function: resize_entry + * Function: resize_entry * - * Purpose: Given a pointer to a cache, an entry type, an index, and - * a size, set the size of the target entry to the size. Note - * that at present, the type of the entry must be - * VARIABLE_ENTRY_TYPE. + * Purpose: Given a pointer to a cache, an entry type, an index, and + * a new size, set the size of the target entry to the new size. * - * If the resize_pin parameter is true, verify that the - * target entry is in the cache and is pinned. If it - * isn't, scream and die. If it is, use the - * H5C_mark_pinned_entry_dirty() call to resize it. + * Note that at present, the type of the entry must be + * VARIABLE_ENTRY_TYPE. * - * Do nothing if pass is false on entry. + * Do nothing if pass is false on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer - * 6/10/04 + * Programmer: John Mainzer + * 1/11/08 * *------------------------------------------------------------------------- */ @@ -1843,11 +1880,12 @@ void resize_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - size_t new_size, - hbool_t resize_pin) + size_t new_size, + hbool_t in_cache) { test_entry_t * base_addr; test_entry_t * entry_ptr; + herr_t result; HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( type == VARIABLE_ENTRY_TYPE ); @@ -1856,126 +1894,61 @@ resize_entry(H5F_t * file_ptr, if ( pass ) { - base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); - - if ( resize_pin ) { + if ( in_cache ) { H5C_t *cache_ptr = file_ptr->shared->cache; HDassert( cache_ptr ); - if ( ! entry_in_cache(cache_ptr, type, idx) ) { + if ( ! entry_in_cache(cache_ptr, type, idx) ) { - pass = FALSE; + pass = FALSE; failure_mssg = "entry to be resized pinned is not in cache."; - } else { - - if ( ! ( (entry_ptr->header).is_pinned ) ) { - - pass = FALSE; - failure_mssg = "entry to be resized pinned is not pinned."; - - } else { - - mark_pinned_entry_dirty(type, idx, TRUE, new_size); - } - } - } else { - - protect_entry(file_ptr, type, idx); - unprotect_entry_with_size_change(file_ptr, type, idx, - H5C__SIZE_CHANGED_FLAG, new_size); - } - } - - return; - -} /* resize_entry() */ - - -/*------------------------------------------------------------------------- - * Function: resize_pinned_entry - * - * Purpose: Given a pointer to a cache, an entry type, an index, and - * a new size, change the size of the target pinned entry - * to match the supplied new size. - * - * Do nothing if pass is false on entry. - * - * Return: void - * - * Programmer: John Mainzer - * 1/11/08 - * - *------------------------------------------------------------------------- - */ - -void -resize_pinned_entry(H5C_t * cache_ptr, - int32_t type, - int32_t idx, - size_t new_size) -{ - herr_t result; - test_entry_t * base_addr; - test_entry_t * entry_ptr; - - HDassert( cache_ptr ); - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); - HDassert( type == VARIABLE_ENTRY_TYPE ) ; - HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes[type] ) ); - - if ( pass ) { - - if ( ! entry_in_cache(cache_ptr, type, idx) ) { - - pass = FALSE; - failure_mssg = "entry not in cache."; - - } else { + } else { - base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); + base_addr = entries[type]; + entry_ptr = &(base_addr[idx]); - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); + HDassert( entry_ptr->index == idx ); + HDassert( entry_ptr->type == type ); + HDassert( entry_ptr->cache_ptr == cache_ptr ); + HDassert( entry_ptr == entry_ptr->self ); - if ( ! ( (entry_ptr->header).is_pinned ) ) { + if ( ! ( entry_ptr->header.is_pinned || entry_ptr->header.is_protected ) ) { - pass = FALSE; - failure_mssg = "entry to be resized is not pinned."; + pass = FALSE; + failure_mssg = "entry to be resized is not pinned or protected."; - } else { + } else { - entry_ptr->size = new_size; + entry_ptr->size = new_size; - result = H5C_resize_pinned_entry((void *)entry_ptr, - new_size); + result = H5C_resize_entry((void *)entry_ptr, new_size); + entry_ptr->is_dirty = TRUE; - if ( result != SUCCEED ) { + if ( result != SUCCEED ) { - pass = FALSE; - failure_mssg = "error(s) in H5C_resize_pinned_entry()."; + pass = FALSE; + failure_mssg = "error(s) in H5C_resize_entry()."; - } else { + } else { - HDassert( entry_ptr->size = (entry_ptr->header).size ); + HDassert( entry_ptr->size = (entry_ptr->header).size ); + } } } - } + } else { + + protect_entry(file_ptr, type, idx); + resize_entry(file_ptr, type, idx, new_size, TRUE); + unprotect_entry(file_ptr, type, idx, H5C__DIRTIED_FLAG); + } } return; -} /* resize_pinned_entry() */ +} /* resize_entry() */ /*------------------------------------------------------------------------- @@ -2639,7 +2612,7 @@ setup_cache(size_t max_cache_size, cache_ptr = H5C_create(max_cache_size, min_clean_size, (NUMBER_OF_ENTRY_TYPES - 1), - (const char **)entry_type_names, + (const char **)entry_type_names, check_write_permitted, TRUE, NULL, @@ -2743,7 +2716,7 @@ setup_cache(size_t max_cache_size, * Return: void * * Programmer: John Mainzer - * 6/11/04 + * 9/14/07 * *------------------------------------------------------------------------- */ @@ -2973,12 +2946,7 @@ flush_cache(H5F_t * file_ptr, /*------------------------------------------------------------------------- * Function: insert_entry() * - * Purpose: Insert the entry indicated by the type and index. Mark - * it clean or dirty as indicated. - * - * Note that I don't see much practical use for inserting - * a clean entry, but the interface permits it so we should - * test it. + * Purpose: Insert the entry indicated by the type and index. * * Do nothing if pass is false. * @@ -2994,7 +2962,6 @@ void insert_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - hbool_t UNUSED dirty, unsigned int flags) { H5C_t * cache_ptr; @@ -3077,7 +3044,7 @@ insert_entry(H5F_t * file_ptr, /*------------------------------------------------------------------------- - * Function: mark_pinned_entry_dirty() + * Function: mark_entry_dirty() * * Purpose: Mark the specified entry as dirty. * @@ -3092,12 +3059,9 @@ insert_entry(H5F_t * file_ptr, */ void -mark_pinned_entry_dirty(int32_t type, - int32_t idx, - hbool_t size_changed, - size_t new_size) +mark_entry_dirty(int32_t type, + int32_t idx) { - /* const char * fcn_name = "mark_pinned_entry_dirty()"; */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3113,127 +3077,23 @@ mark_pinned_entry_dirty(int32_t type, HDassert( entry_ptr->index == idx ); HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); - HDassert( ! (entry_ptr->header.is_protected) ); - HDassert( entry_ptr->header.is_pinned ); - HDassert( entry_ptr->is_pinned ); + HDassert( entry_ptr->header.is_protected || + entry_ptr->header.is_pinned ); entry_ptr->is_dirty = TRUE; - if ( size_changed ) { - - /* update entry size now to keep the sanity checks happy */ - entry_ptr->size = new_size; - } - - result = H5C_mark_pinned_entry_dirty((void *)entry_ptr, - size_changed, - new_size); + result = H5C_mark_entry_dirty((void *)entry_ptr); if ( ( result < 0 ) || - ( ! (entry_ptr->header.is_dirty) ) || - ( ! (entry_ptr->header.is_pinned) ) || + ( !entry_ptr->header.is_protected && !entry_ptr->header.is_pinned ) || + ( entry_ptr->header.is_protected && !entry_ptr->header.dirtied ) || + ( !entry_ptr->header.is_protected && !entry_ptr->header.is_dirty ) || ( entry_ptr->header.type != &(types[type]) ) || ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { -#if 0 /* This is useful debugging code -- keep it around */ - HDfprintf(stdout, "result = %ld.\n", (long)result); - HDfprintf(stdout, "entry_ptr->header.is_dirty = %d.\n", - (int)(entry_ptr->header.is_dirty)); - HDfprintf(stdout, "entry_ptr->header.is_pinned = %d.\n", - (int)(entry_ptr->header.is_pinned)); - HDfprintf(stdout, - "(entry_ptr->header.type != &(types[type])) = %d.\n", - (int)(entry_ptr->header.type != &(types[type]))); - HDfprintf(stdout, - "entry_ptr->size = %ld, entry_ptr->header.size = %ld.\n", - (long)(entry_ptr->size), (long)(entry_ptr->header.size)); - HDfprintf(stdout, - "entry_ptr->addr = %ld, entry_ptr->header.addr = %ld.\n", - (long)(entry_ptr->addr), (long)(entry_ptr->header.addr)); -#endif - pass = FALSE; - failure_mssg = "error in H5C_mark_pinned_entry_dirty()."; - - } - - HDassert( ((entry_ptr->header).type)->id == type ); - - } - - return; - -} /* mark_pinned_entry_dirty() */ - - -/*------------------------------------------------------------------------- - * Function: mark_pinned_or_protected_entry_dirty() - * - * Purpose: Mark the specified entry as dirty. - * - * Do nothing if pass is FALSE on entry. - * - * Return: void - * - * Programmer: John Mainzer - * 5/17/06 - * - *------------------------------------------------------------------------- - */ - -void -mark_pinned_or_protected_entry_dirty(int32_t type, - int32_t idx) -{ - /* const char * fcn_name = "mark_pinned_or_protected_entry_dirty()"; */ - herr_t result; - test_entry_t * base_addr; - test_entry_t * entry_ptr; - - if ( pass ) { - - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); - - base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->header.is_protected || - entry_ptr->header.is_pinned ); - - entry_ptr->is_dirty = TRUE; - - result = H5C_mark_pinned_or_protected_entry_dirty((void *)entry_ptr); - - if ( ( result < 0 ) - || - ( ( ! (entry_ptr->header.is_protected) ) - && - ( ! (entry_ptr->header.is_pinned) ) - ) - || - ( ( entry_ptr->header.is_protected ) - && - ( ! ( entry_ptr->header.dirtied ) ) - ) - || - ( ( ! ( entry_ptr->header.is_protected ) ) - && - ( ! ( entry_ptr->header.is_dirty ) ) - ) - || - ( entry_ptr->header.type != &(types[type]) ) - || - ( entry_ptr->size != entry_ptr->header.size ) - || - ( entry_ptr->addr != entry_ptr->header.addr ) ) { - pass = FALSE; - failure_mssg = - "error in H5C_mark_pinned_or_protected_entry_dirty()."; + failure_mssg = "error in H5C_mark_entry_dirty()."; } @@ -3243,13 +3103,13 @@ mark_pinned_or_protected_entry_dirty(int32_t type, return; -} /* mark_pinned_or_protected_entry_dirty() */ +} /* mark_entry_dirty() */ /*------------------------------------------------------------------------- - * Function: rename_entry() + * Function: move_entry() * - * Purpose: Rename the entry indicated by the type and index to its + * Purpose: Move the entry indicated by the type and index to its * main or alternate address as indicated. If the entry is * already at the desired entry, do nothing. * @@ -3262,7 +3122,7 @@ mark_pinned_or_protected_entry_dirty(int32_t type, */ void -rename_entry(H5C_t * cache_ptr, +move_entry(H5C_t * cache_ptr, int32_t type, int32_t idx, hbool_t main_addr) @@ -3274,74 +3134,77 @@ rename_entry(H5C_t * cache_ptr, test_entry_t * base_addr; test_entry_t * entry_ptr; - HDassert( cache_ptr ); - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); + if ( pass ) { - base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); + HDassert( cache_ptr ); + HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); + HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->cache_ptr == cache_ptr ); - HDassert( !(entry_ptr->is_protected) ); - HDassert( !(entry_ptr->header.is_protected) ); + base_addr = entries[type]; + entry_ptr = &(base_addr[idx]); + + HDassert( entry_ptr->index == idx ); + HDassert( entry_ptr->type == type ); + HDassert( entry_ptr == entry_ptr->self ); + HDassert( entry_ptr->cache_ptr == cache_ptr ); + HDassert( !(entry_ptr->is_protected) ); + HDassert( !(entry_ptr->header.is_protected) ); - if ( entry_ptr->at_main_addr && !main_addr ) { + if ( entry_ptr->at_main_addr && !main_addr ) { - /* rename to alt addr */ + /* move to alt addr */ - HDassert( entry_ptr->addr == entry_ptr->main_addr ); + HDassert( entry_ptr->addr == entry_ptr->main_addr ); - done = FALSE; - old_addr = entry_ptr->addr; - new_addr = entry_ptr->alt_addr; + done = FALSE; + old_addr = entry_ptr->addr; + new_addr = entry_ptr->alt_addr; - } else if ( !(entry_ptr->at_main_addr) && main_addr ) { + } else if ( !(entry_ptr->at_main_addr) && main_addr ) { - /* rename to main addr */ + /* move to main addr */ - HDassert( entry_ptr->addr == entry_ptr->alt_addr ); + HDassert( entry_ptr->addr == entry_ptr->alt_addr ); - done = FALSE; - old_addr = entry_ptr->addr; - new_addr = entry_ptr->main_addr; - } + done = FALSE; + old_addr = entry_ptr->addr; + new_addr = entry_ptr->main_addr; + } - if ( ! done ) { + if ( ! done ) { - entry_ptr->is_dirty = TRUE; + entry_ptr->is_dirty = TRUE; - result = H5C_rename_entry(cache_ptr, &(types[type]), - old_addr, new_addr); - } + result = H5C_move_entry(cache_ptr, &(types[type]), + old_addr, new_addr); + } - if ( ! done ) { + if ( ! done ) { - if ( ( result < 0 ) || - ( ( ! ( entry_ptr->header.destroy_in_progress ) ) && - ( entry_ptr->header.addr != new_addr ) ) ) { + if ( ( result < 0 ) || + ( ( ! ( entry_ptr->header.destroy_in_progress ) ) && + ( entry_ptr->header.addr != new_addr ) ) ) { - pass = FALSE; - failure_mssg = "error in H5C_rename_entry()."; + pass = FALSE; + failure_mssg = "error in H5C_move_entry()."; - } else { + } else { - entry_ptr->addr = new_addr; - entry_ptr->at_main_addr = main_addr; + entry_ptr->addr = new_addr; + entry_ptr->at_main_addr = main_addr; + } } - } - HDassert( ((entry_ptr->header).type)->id == type ); + HDassert( ((entry_ptr->header).type)->id == type ); - HDassert( entry_ptr->header.is_dirty ); - HDassert( entry_ptr->is_dirty ); + HDassert( entry_ptr->header.is_dirty ); + HDassert( entry_ptr->is_dirty ); + } return; -} /* rename_entry() */ +} /* move_entry() */ /*------------------------------------------------------------------------- @@ -3364,7 +3227,6 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) { - /* const char * fcn_name = "protect_entry()"; */ H5C_t * cache_ptr; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3459,10 +3321,9 @@ protect_entry_ro(H5F_t * file_ptr, int32_t type, int32_t idx) { - /* const char * fcn_name = "protect_entry_ro()"; */ H5C_t *cache_ptr; - test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t *base_addr; + test_entry_t *entry_ptr; H5C_cache_entry_t * cache_entry_ptr; if ( pass ) { @@ -3596,13 +3457,11 @@ void unpin_entry(int32_t type, int32_t idx) { - /* const char * fcn_name = "unpin_entry()"; */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; if ( pass ) { - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); @@ -3617,7 +3476,7 @@ unpin_entry(int32_t type, HDassert( entry_ptr->is_pinned ); HDassert( entry_ptr->pinned_from_client ); - result = H5C_unpin_entry((void *)entry_ptr); + result = H5C_unpin_entry(entry_ptr); if ( ( result < 0 ) || ( entry_ptr->header.pinned_from_client ) || @@ -3663,11 +3522,8 @@ void unprotect_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - int dirty, unsigned int flags) { - /* const char * fcn_name = "unprotect_entry()"; */ - H5C_t *cache_ptr; herr_t result; hbool_t pin_flag_set; hbool_t unpin_flag_set; @@ -3675,10 +3531,6 @@ unprotect_entry(H5F_t * file_ptr, test_entry_t * entry_ptr; if ( pass ) { - - cache_ptr = file_ptr->shared->cache; - - HDassert( cache_ptr ); HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); @@ -3688,7 +3540,6 @@ unprotect_entry(H5F_t * file_ptr, HDassert( entry_ptr->index == idx ); HDassert( entry_ptr->type == type ); HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->cache_ptr == cache_ptr ); HDassert( entry_ptr->header.is_protected ); HDassert( entry_ptr->is_protected ); @@ -3699,15 +3550,11 @@ unprotect_entry(H5F_t * file_ptr, HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) ); HDassert ( ( ! unpin_flag_set ) || ( entry_ptr->is_pinned ) ); - if ( ( dirty == TRUE ) || ( dirty == FALSE ) ) { - - flags |= (dirty ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET); - entry_ptr->is_dirty = (hbool_t)(entry_ptr->is_dirty || dirty); - } + if(flags & H5C__DIRTIED_FLAG) + entry_ptr->is_dirty = TRUE; result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags, - (size_t)0); + &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( ( entry_ptr->header.is_protected ) && @@ -3717,26 +3564,6 @@ unprotect_entry(H5F_t * file_ptr, ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { -#if 1 /* JRM */ - if ( result < 0 ) { - HDfprintf(stdout, "result is negative.\n"); - } - if ( ( entry_ptr->header.is_protected ) && - ( ( ! ( entry_ptr->is_read_only ) ) || - ( entry_ptr->ro_ref_count <= 0 ) ) ) { - HDfprintf(stdout, "protected and not RO or refcnt <= 0.\n"); - } - if ( entry_ptr->header.type != &(types[type]) ) { - HDfprintf(stdout, "type disagreement.\n"); - } - if ( entry_ptr->size != entry_ptr->header.size ) { - HDfprintf(stdout, "size disagreement.\n"); - } - if ( entry_ptr->addr != entry_ptr->header.addr ) { - HDfprintf(stdout, "addr disagreement.\n"); - } -#endif /* JRM */ - pass = FALSE; failure_mssg = "error in H5C_unprotect()."; @@ -3794,181 +3621,34 @@ unprotect_entry(H5F_t * file_ptr, /*------------------------------------------------------------------------- - * Function: unprotect_entry_with_size_change() - * - * Purpose: Version of unprotect_entry() that allow access to the new - * size change parameters in H5C_unprotect_entry() - * - * At present, only the sizes of VARIABLE_ENTRY_TYPE entries - * can be changed. Thus this function will scream and die - * if the H5C__SIZE_CHANGED_FLAG is set and the type is not - * VARIABLE_ENTRY_TYPE. + * Function: row_major_scan_forward() * - * Do nothing if pass is FALSE on entry. + * Purpose: Do a sequence of inserts, protects, unprotects, moves, + * destroys while scanning through the set of entries. If + * pass is false on entry, do nothing. * * Return: void * * Programmer: John Mainzer - * 8/31/06 + * 6/12/04 * *------------------------------------------------------------------------- */ void -unprotect_entry_with_size_change(H5F_t * file_ptr, - int32_t type, - int32_t idx, - unsigned int flags, - size_t new_size) -{ - const char * fcn_name = "unprotect_entry_with_size_change()"; - herr_t result; - hbool_t dirty_flag_set; - hbool_t pin_flag_set; - hbool_t unpin_flag_set; - hbool_t size_changed_flag_set; - test_entry_t * base_addr; - test_entry_t * entry_ptr; - - if ( pass ) { -#ifndef NDEBUG - H5C_t * cache_ptr; - - cache_ptr = file_ptr->shared->cache; - - HDassert( cache_ptr ); -#endif /* NDEBUG */ - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); - HDassert( new_size <= entry_sizes[type] ); - - base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->cache_ptr == cache_ptr ); - HDassert( entry_ptr->header.is_protected ); - HDassert( entry_ptr->is_protected ); - - dirty_flag_set = (hbool_t)((flags & H5C__DIRTIED_FLAG) != 0 ); - pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0 ); - unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0 ); - size_changed_flag_set = (hbool_t)((flags & H5C__SIZE_CHANGED_FLAG) != 0 ); - - HDassert ( ! ( pin_flag_set && unpin_flag_set ) ); - HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) ); - HDassert ( ( ! unpin_flag_set ) || ( entry_ptr->is_pinned ) ); - HDassert ( ( ! size_changed_flag_set ) || ( new_size > 0 ) ); - HDassert ( ( ! size_changed_flag_set ) || - ( type == VARIABLE_ENTRY_TYPE ) ); - - entry_ptr->is_dirty = (hbool_t)(entry_ptr->is_dirty || dirty_flag_set); - - if ( size_changed_flag_set ) { - - entry_ptr->is_dirty = TRUE; - entry_ptr->size = new_size; - } - - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags, - new_size); - - if ( ( result < 0 ) || - ( entry_ptr->header.is_protected ) || - ( entry_ptr->header.type != &(types[type]) ) || - ( entry_ptr->size != entry_ptr->header.size ) || - ( entry_ptr->addr != entry_ptr->header.addr ) ) { - - if ( result < 0 ) - HDfprintf(stdout, "%s: H5C_unprotect() failed.\n", fcn_name); - - if ( entry_ptr->header.is_protected ) - HDfprintf(stdout, "%s: entry still protected?!?.\n", fcn_name); - - if ( entry_ptr->header.type != &(types[type]) ) - HDfprintf(stdout, "%s: entry has bad type after unprotect.\n", fcn_name); - - if ( entry_ptr->size != entry_ptr->header.size ) - HDfprintf(stdout, "%s: bad entry size after unprotect. e/a = %d/%d\n", fcn_name, - (int)(entry_ptr->size), - (int)(entry_ptr->header.size)); - - if ( entry_ptr->addr != entry_ptr->header.addr ) - HDfprintf(stdout, "%s: bad entry addr after unprotect. e/a = 0x%llx/0x%llx\n", fcn_name, - (long long)(entry_ptr->addr), - (long long)(entry_ptr->header.addr)); - - pass = FALSE; - failure_mssg = "error in H5C_unprotect()."; - - } - else - { - entry_ptr->is_protected = FALSE; - - if ( pin_flag_set ) { - - HDassert ( entry_ptr->header.is_pinned ); - entry_ptr->pinned_from_client = TRUE; - entry_ptr->is_pinned = TRUE; - - } else if ( unpin_flag_set ) { - - HDassert ( entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache ); - entry_ptr->pinned_from_client = FALSE; - entry_ptr->is_pinned = entry_ptr->pinned_from_cache; - - } - } - - HDassert( ((entry_ptr->header).type)->id == type ); - - if ( ( flags & H5C__DIRTIED_FLAG ) != 0 - && ( (flags & H5C__DELETED_FLAG) == 0 ) ) { - - HDassert( entry_ptr->header.is_dirty ); - HDassert( entry_ptr->is_dirty ); - } - } - - return; - -} /* unprotect_entry_with_size_change() */ - - -/*------------------------------------------------------------------------- - * Function: row_major_scan_forward() - * - * Purpose: Do a sequence of inserts, protects, unprotects, renames, - * destroys while scanning through the set of entries. If - * pass is false on entry, do nothing. - * - * Return: void - * - * Programmer: John Mainzer - * 6/12/04 - * - *------------------------------------------------------------------------- - */ - -void -row_major_scan_forward(H5F_t * file_ptr, - int32_t lag, - hbool_t verbose, - hbool_t reset_stats, - hbool_t display_stats, - hbool_t display_detailed_stats, - hbool_t do_inserts, - hbool_t dirty_inserts, - hbool_t do_renames, - hbool_t rename_to_main_addr, - hbool_t do_destroys, - hbool_t do_mult_ro_protects, - int dirty_destroys, - int dirty_unprotects) +row_major_scan_forward(H5F_t * file_ptr, + int32_t lag, + hbool_t verbose, + hbool_t reset_stats, + hbool_t display_stats, + hbool_t display_detailed_stats, + hbool_t do_inserts, + hbool_t do_moves, + hbool_t move_to_main_addr, + hbool_t do_destroys, + hbool_t do_mult_ro_protects, + int dirty_destroys, + int dirty_unprotects) { const char * fcn_name = "row_major_scan_forward"; H5C_t * cache_ptr; @@ -4011,8 +3691,7 @@ row_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(file_ptr, type, (idx + lag), dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); } @@ -4033,17 +3712,16 @@ row_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); - unprotect_entry(file_ptr, type, idx+lag-2, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx+lag-2, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( do_renames ) && ( (idx + lag - 2) >= 0 ) && + if ( ( pass ) && ( do_moves ) && ( (idx + lag - 2) >= 0 ) && ( (idx + lag - 2) <= max_indices[type] ) && ( ( (idx + lag - 2) % 3 ) == 0 ) ) { - rename_entry(cache_ptr, type, (idx + lag - 2), - rename_to_main_addr); + move_entry(cache_ptr, type, (idx + lag - 2), + move_to_main_addr); } @@ -4064,8 +3742,7 @@ row_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 5)); - unprotect_entry(file_ptr, type, idx+lag-5, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx+lag-5, H5C__NO_FLAGS_SET); } if ( do_mult_ro_protects ) @@ -4111,8 +3788,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx + lag - 7)); - unprotect_entry(file_ptr, type, (idx + lag - 7), - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, (idx + lag - 7), H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx + lag - 8) >= 0 ) && @@ -4123,8 +3799,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx + lag - 8)); - unprotect_entry(file_ptr, type, (idx + lag - 8), - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, (idx + lag - 8), H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx + lag - 9) >= 0 ) && @@ -4135,8 +3810,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx + lag - 9)); - unprotect_entry(file_ptr, type, (idx + lag - 9), - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, (idx + lag - 9), H5C__NO_FLAGS_SET); } } /* if ( do_mult_ro_protects ) */ @@ -4155,8 +3829,7 @@ row_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); - unprotect_entry(file_ptr, type, idx-lag+2, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx-lag+2, H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx - lag + 1) >= 0 ) && @@ -4178,38 +3851,33 @@ row_major_scan_forward(H5F_t * file_ptr, switch ( (idx - lag) %4 ) { case 0: /* we just did an insert */ - unprotect_entry(file_ptr, type, idx - lag, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); break; case 1: if ( (entries[type])[idx-lag].is_dirty ) { - unprotect_entry(file_ptr, type, idx - lag, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); } else { unprotect_entry(file_ptr, type, idx - lag, - dirty_unprotects, - H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } break; case 2: /* we just did an insrt */ - unprotect_entry(file_ptr, type, idx - lag, - NO_CHANGE, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); break; case 3: if ( (entries[type])[idx-lag].is_dirty ) { - unprotect_entry(file_ptr, type, idx - lag, - NO_CHANGE, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); } else { unprotect_entry(file_ptr, type, idx - lag, - dirty_destroys, - H5C__DELETED_FLAG); + (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) + | H5C__DELETED_FLAG); } break; @@ -4228,7 +3896,7 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); unprotect_entry(file_ptr, type, idx - lag, - dirty_unprotects, H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } } @@ -4272,8 +3940,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, hbool_t reset_stats, hbool_t display_stats, hbool_t display_detailed_stats, - hbool_t do_inserts, - hbool_t dirty_inserts) + hbool_t do_inserts) { const char * fcn_name = "hl_row_major_scan_forward"; H5C_t * cache_ptr; @@ -4317,8 +3984,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(file_ptr, type, (idx + lag), dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); } i = idx; @@ -4335,8 +4001,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry(file_ptr, type, i, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, i, H5C__NO_FLAGS_SET); } i--; } @@ -4362,7 +4027,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, /*------------------------------------------------------------------------- * Function: row_major_scan_backward() * - * Purpose: Do a sequence of inserts, protects, unprotects, renames, + * Purpose: Do a sequence of inserts, protects, unprotects, moves, * destroys while scanning backwards through the set of * entries. If pass is false on entry, do nothing. * @@ -4382,9 +4047,8 @@ row_major_scan_backward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, - hbool_t do_renames, - hbool_t rename_to_main_addr, + hbool_t do_moves, + hbool_t move_to_main_addr, hbool_t do_destroys, hbool_t do_mult_ro_protects, int dirty_destroys, @@ -4425,8 +4089,7 @@ row_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); - insert_entry(file_ptr, type, (idx - lag), dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, (idx - lag), H5C__NO_FLAGS_SET); } @@ -4447,17 +4110,16 @@ row_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); - unprotect_entry(file_ptr, type, idx-lag+2, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx-lag+2, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( do_renames ) && ( (idx - lag + 2) >= 0 ) && + if ( ( pass ) && ( do_moves ) && ( (idx - lag + 2) >= 0 ) && ( (idx - lag + 2) <= max_indices[type] ) && ( ( (idx - lag + 2) % 3 ) == 0 ) ) { - rename_entry(cache_ptr, type, (idx - lag + 2), - rename_to_main_addr); + move_entry(cache_ptr, type, (idx - lag + 2), + move_to_main_addr); } @@ -4478,8 +4140,7 @@ row_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 5)); - unprotect_entry(file_ptr, type, idx-lag+5, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx-lag+5, H5C__NO_FLAGS_SET); } if ( do_mult_ro_protects ) @@ -4525,8 +4186,7 @@ row_major_scan_backward(H5F_t * file_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx - lag + 7)); - unprotect_entry(file_ptr, type, (idx - lag + 7), - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, (idx - lag + 7), H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx - lag + 8) >= 0 ) && @@ -4537,8 +4197,7 @@ row_major_scan_backward(H5F_t * file_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx - lag + 8)); - unprotect_entry(file_ptr, type, (idx - lag + 8), - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, (idx - lag + 8), H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx - lag + 9) >= 0 ) && @@ -4549,8 +4208,7 @@ row_major_scan_backward(H5F_t * file_ptr, HDfprintf(stdout, "(u-ro, %d, %d) ", type, (idx - lag + 9)); - unprotect_entry(file_ptr, type, (idx - lag + 9), - FALSE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, (idx - lag + 9), H5C__NO_FLAGS_SET); } } /* if ( do_mult_ro_protects ) */ @@ -4570,8 +4228,7 @@ row_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); - unprotect_entry(file_ptr, type, idx+lag-2, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx+lag-2, H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx + lag - 1) >= 0 ) && @@ -4595,37 +4252,32 @@ row_major_scan_backward(H5F_t * file_ptr, case 0: if ( (entries[type])[idx+lag].is_dirty ) { - unprotect_entry(file_ptr, type, idx + lag, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx + lag, H5C__NO_FLAGS_SET); } else { unprotect_entry(file_ptr, type, idx + lag, - dirty_unprotects, - H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } break; case 1: /* we just did an insert */ - unprotect_entry(file_ptr, type, idx + lag, - NO_CHANGE, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, idx + lag, H5C__NO_FLAGS_SET); break; case 2: if ( (entries[type])[idx + lag].is_dirty ) { - unprotect_entry(file_ptr, type, idx + lag, - NO_CHANGE, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, type, idx + lag, H5C__DELETED_FLAG); } else { unprotect_entry(file_ptr, type, idx + lag, - dirty_destroys, - H5C__DELETED_FLAG); + (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) + | H5C__DELETED_FLAG); } break; case 3: /* we just did an insrt */ - unprotect_entry(file_ptr, type, idx + lag, - NO_CHANGE, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, type, idx + lag, H5C__DELETED_FLAG); break; default: @@ -4639,10 +4291,10 @@ row_major_scan_backward(H5F_t * file_ptr, ( ( idx + lag) <= max_indices[type] ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); unprotect_entry(file_ptr, type, idx + lag, - dirty_unprotects, H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } } @@ -4686,8 +4338,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, hbool_t reset_stats, hbool_t display_stats, hbool_t display_detailed_stats, - hbool_t do_inserts, - hbool_t dirty_inserts) + hbool_t do_inserts) { const char * fcn_name = "hl_row_major_scan_backward"; H5C_t * cache_ptr; @@ -4731,8 +4382,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(file_ptr, type, (idx + lag), dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); } i = idx; @@ -4749,8 +4399,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry(file_ptr, type, i, NO_CHANGE, - H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, i, H5C__NO_FLAGS_SET); } i--; } @@ -4785,8 +4434,6 @@ hl_row_major_scan_backward(H5F_t * file_ptr, * Programmer: John Mainzer * 6/23/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -4798,7 +4445,6 @@ col_major_scan_forward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects) { const char * fcn_name = "col_major_scan_forward()"; @@ -4837,8 +4483,7 @@ col_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(file_ptr, type, (idx + lag), dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); } if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { @@ -4856,7 +4501,7 @@ col_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); unprotect_entry(file_ptr, type, idx - lag, - dirty_unprotects, H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } if ( verbose ) @@ -4901,7 +4546,6 @@ hl_col_major_scan_forward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects) { const char * fcn_name = "hl_col_major_scan_forward()"; @@ -4953,8 +4597,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, i); - insert_entry(file_ptr, type, i, dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, i, H5C__NO_FLAGS_SET); } if ( ( pass ) && ( i >= 0 ) && ( i <= local_max_index ) ) { @@ -4972,7 +4615,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, i); unprotect_entry(file_ptr, type, i, - dirty_unprotects, H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } if ( verbose ) @@ -5020,7 +4663,6 @@ col_major_scan_backward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects) { const char * fcn_name = "col_major_scan_backward()"; @@ -5066,8 +4708,7 @@ col_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); - insert_entry(file_ptr, type, (idx - lag), dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, (idx - lag), H5C__NO_FLAGS_SET); } if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { @@ -5085,7 +4726,7 @@ col_major_scan_backward(H5F_t * file_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); unprotect_entry(file_ptr, type, idx + lag, - dirty_unprotects, H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } if ( verbose ) @@ -5136,7 +4777,6 @@ hl_col_major_scan_backward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects) { const char * fcn_name = "hl_col_major_scan_backward()"; @@ -5187,8 +4827,7 @@ hl_col_major_scan_backward(H5F_t * file_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, i); - insert_entry(file_ptr, type, i, dirty_inserts, - H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, i, H5C__NO_FLAGS_SET); } if ( ( pass ) && ( i >= 0 ) && ( i <= local_max_index ) ) { @@ -5206,7 +4845,7 @@ hl_col_major_scan_backward(H5F_t * file_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, i); unprotect_entry(file_ptr, type, i, - dirty_unprotects, H5C__NO_FLAGS_SET); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } if ( verbose ) @@ -5439,3 +5078,455 @@ destroy_flush_dependency(int32_t par_type, } /* destroy_flush_dependency() */ + +/*** H5AC level utility functions ***/ + + +/*------------------------------------------------------------------------- + * Function: check_and_validate_cache_hit_rate() + * + * Purpose: Use the API functions to get and reset the cache hit rate. + * Verify that the value returned by the API call agrees with + * the cache internal data structures. + * + * If the number of cache accesses exceeds the value provided + * in the min_accesses parameter, and the hit rate is less than + * min_hit_rate, set pass to FALSE, and set failure_mssg to + * a string indicating that hit rate was unexpectedly low. + * + * Return hit rate in *hit_rate_ptr, and print the data to + * stdout if requested. + * + * If an error is detected, set pass to FALSE, and set + * failure_mssg to an appropriate value. + * + * Return: void + * + * Programmer: John Mainzer + * 4/18/04 + * + *------------------------------------------------------------------------- + */ + +void +check_and_validate_cache_hit_rate(hid_t file_id, + double * hit_rate_ptr, + hbool_t dump_data, + int64_t min_accesses, + double min_hit_rate) +{ + /* const char * fcn_name = "check_and_validate_cache_hit_rate()"; */ + herr_t result; + int64_t cache_hits = 0; + int64_t cache_accesses = 0; + double expected_hit_rate; + double hit_rate; + H5F_t * file_ptr = NULL; + H5C_t * cache_ptr = NULL; + + /* get a pointer to the files internal data structure */ + if ( pass ) { + + file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + + if ( file_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "Can't get file_ptr."; + + } else { + + cache_ptr = file_ptr->shared->cache; + } + } + + /* verify that we can access the cache data structure */ + if ( pass ) { + + if ( ( cache_ptr == NULL ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { + + pass = FALSE; + failure_mssg = "Can't access cache resize_ctl."; + } + } + + /* compare the cache's internal configuration with the expected value */ + if ( pass ) { + + cache_hits = cache_ptr->cache_hits; + cache_accesses = cache_ptr->cache_accesses; + + if ( cache_accesses > 0 ) { + + expected_hit_rate = ((double)cache_hits) / ((double)cache_accesses); + + } else { + + expected_hit_rate = 0.0; + } + + result = H5Fget_mdc_hit_rate(file_id, &hit_rate); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fget_mdc_hit_rate() failed."; + + } else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001) ) { + + pass = FALSE; + failure_mssg = "unexpected hit rate."; + + } + } + + if ( pass ) { /* reset the hit rate */ + + result = H5Freset_mdc_hit_rate_stats(file_id); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "H5Freset_mdc_hit_rate_stats() failed."; + } + } + + /* set *hit_rate_ptr if appropriate */ + if ( ( pass ) && ( hit_rate_ptr != NULL ) ) { + + *hit_rate_ptr = hit_rate; + } + + /* dump data to stdout if requested */ + if ( ( pass ) && ( dump_data ) ) { + + HDfprintf(stdout, + "cache_hits: %ld, cache_accesses: %ld, hit_rate: %lf\n", + (long)cache_hits, (long)cache_accesses, hit_rate); + } + + if ( ( pass ) && + ( cache_accesses > min_accesses ) && + ( hit_rate < min_hit_rate ) ) { + + pass = FALSE; + failure_mssg = "Unexpectedly low hit rate."; + } + + return; + +} /* check_and_validate_cache_hit_rate() */ + + +/*------------------------------------------------------------------------- + * Function: check_and_validate_cache_size() + * + * Purpose: Use the API function to get the cache size data. Verify + * that the values returned by the API call agree with + * the cache internal data structures. + * + * Return size data in the locations specified by the pointer + * parameters if these parameters are not NULL. Print the + * data to stdout if requested. + * + * If an error is detected, set pass to FALSE, and set + * failure_mssg to an appropriate value. + * + * Return: void + * + * Programmer: John Mainzer + * 4/18/04 + * + *------------------------------------------------------------------------- + */ + +void +check_and_validate_cache_size(hid_t file_id, + size_t * max_size_ptr, + size_t * min_clean_size_ptr, + size_t * cur_size_ptr, + int32_t * cur_num_entries_ptr, + hbool_t dump_data) +{ + /* const char * fcn_name = "check_and_validate_cache_size()"; */ + herr_t result; + size_t expected_max_size; + size_t max_size; + size_t expected_min_clean_size; + size_t min_clean_size; + size_t expected_cur_size; + size_t cur_size; + int32_t expected_cur_num_entries; + int cur_num_entries; + H5F_t * file_ptr = NULL; + H5C_t * cache_ptr = NULL; + + /* get a pointer to the files internal data structure */ + if ( pass ) { + + file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + + if ( file_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "Can't get file_ptr."; + + } else { + + cache_ptr = file_ptr->shared->cache; + } + } + + /* verify that we can access the cache data structure */ + if ( pass ) { + + if ( ( cache_ptr == NULL ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { + + pass = FALSE; + failure_mssg = "Can't access cache data structure."; + } + } + + /* compare the cache's internal configuration with the expected value */ + if ( pass ) { + + expected_max_size = cache_ptr->max_cache_size; + expected_min_clean_size = cache_ptr->min_clean_size; + expected_cur_size = cache_ptr->index_size; + expected_cur_num_entries = cache_ptr->index_len; + + result = H5Fget_mdc_size(file_id, + &max_size, + &min_clean_size, + &cur_size, + &cur_num_entries); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fget_mdc_size() failed."; + + } else if ( ( max_size != expected_max_size ) || + ( min_clean_size != expected_min_clean_size ) || + ( cur_size != expected_cur_size ) || + ( cur_num_entries != (int)expected_cur_num_entries ) ) { + + pass = FALSE; + failure_mssg = "H5Fget_mdc_size() returned unexpected value(s)."; + + } + } + + /* return size values if requested */ + if ( ( pass ) && ( max_size_ptr != NULL ) ) { + + *max_size_ptr = max_size; + } + + if ( ( pass ) && ( min_clean_size_ptr != NULL ) ) { + + *min_clean_size_ptr = min_clean_size; + } + + if ( ( pass ) && ( cur_size_ptr != NULL ) ) { + + *cur_size_ptr = cur_size; + } + + if ( ( pass ) && ( cur_num_entries_ptr != NULL ) ) { + + *cur_num_entries_ptr = cur_num_entries; + } + + + /* dump data to stdout if requested */ + if ( ( pass ) && ( dump_data ) ) { + + HDfprintf(stdout, + "max_sz: %ld, min_clean_sz: %ld, cur_sz: %ld, cur_ent: %ld\n", + (long)max_size, (long)min_clean_size, (long)cur_size, + (long)cur_num_entries); + } + + return; + +} /* check_and_validate_cache_size() */ + +hbool_t +resize_configs_are_equal(const H5C_auto_size_ctl_t *a, + const H5C_auto_size_ctl_t *b, + hbool_t compare_init) +{ + if(a->version != b->version) + return(FALSE); + else if(a->rpt_fcn != b->rpt_fcn) + return(FALSE); + else if(compare_init && (a->set_initial_size != b->set_initial_size)) + 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) + return(FALSE); + else if(a->max_size != b->max_size) + return(FALSE); + else if(a->min_size != b->min_size) + return(FALSE); + else if(a->epoch_length != b->epoch_length) + 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) + return(FALSE); + else if(HDfabs(a->increment - b->increment) > FP_EPSILON) + return(FALSE); + else if(a->apply_max_increment != b->apply_max_increment) + return(FALSE); + else if(a->max_increment != b->max_increment) + 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) + return(FALSE); + else if(HDfabs(a->flash_threshold - b->flash_threshold) > FP_EPSILON) + 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) + return(FALSE); + else if(HDfabs(a->decrement - b->decrement) > FP_EPSILON) + return(FALSE); + else if(a->apply_max_decrement != b->apply_max_decrement) + return(FALSE); + else if(a->max_decrement != b->max_decrement) + return(FALSE); + else if(a->epochs_before_eviction != b->epochs_before_eviction) + 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) + return(FALSE); + return(TRUE); +} + + +/*------------------------------------------------------------------------- + * Function: validate_mdc_config() + * + * Purpose: Verify that the file indicated by the file_id parameter + * has both internal and external configuration matching + * *config_ptr. + * + * Do nothin on success. On failure, set pass to FALSE, and + * load an error message into failue_mssg. Note that + * failure_msg is assumed to be at least 128 bytes in length. + * + * Return: void + * + * Programmer: John Mainzer + * 4/14/04 + * + *------------------------------------------------------------------------- + */ + +void +validate_mdc_config(hid_t file_id, + H5AC_cache_config_t * ext_config_ptr, + hbool_t compare_init, + int test_num) +{ + /* const char * fcn_name = "validate_mdc_config()"; */ + static char msg[256]; + H5F_t * file_ptr = NULL; + H5C_t * cache_ptr = NULL; + H5AC_cache_config_t scratch; + H5C_auto_size_ctl_t int_config; + + XLATE_EXT_TO_INT_MDC_CONFIG(int_config, (*ext_config_ptr)) + + /* get a pointer to the files internal data structure */ + if ( pass ) { + + file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE); + + if ( file_ptr == NULL ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, "Can't get file_ptr #%d.", test_num); + failure_mssg = msg; + + } else { + + cache_ptr = file_ptr->shared->cache; + } + } + + /* verify that we can access the internal version of the cache config */ + if ( pass ) { + + if ( ( cache_ptr == NULL ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || + ( cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER ) ){ + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Can't access cache resize_ctl #%d.", test_num); + failure_mssg = msg; + } + } + + /* compare the cache's internal configuration with the expected value */ + if ( pass ) { + + if ( ! resize_configs_are_equal(&int_config, &cache_ptr->resize_ctl, + compare_init) ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Unexpected internal config #%d.", test_num); + failure_mssg = msg; + } + } + + /* obtain external cache config */ + if ( pass ) { + + scratch.version = H5AC__CURR_CACHE_CONFIG_VERSION; + + if ( H5Fget_mdc_config(file_id, &scratch) < 0 ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "H5Fget_mdc_config() failed #%d.", test_num); + failure_mssg = msg; + } + } + + if ( pass ) { + + /* Recall that in any configuration supplied by the cache + * at run time, the set_initial_size field will always + * be FALSE, regardless of the value passed in. Thus we + * always presume that this field need not match that of + * the supplied external configuration. + * + * The cache also sets the initial_size field to the current + * cache max size instead of the value initialy supplied. + * Depending on circumstances, this may or may not match + * the original. Hence the compare_init parameter. + */ + if ( ! CACHE_CONFIGS_EQUAL((*ext_config_ptr), scratch, \ + FALSE, compare_init) ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Unexpected external config #%d.", test_num); + failure_mssg = msg; + } + } + + return; + +} /* validate_mdc_config() */ + diff --git a/test/cache_common.h b/test/cache_common.h index 3714f6e..f493239 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -141,7 +141,7 @@ #define FLUSH_OP__NO_OP 0 #define FLUSH_OP__DIRTY 1 #define FLUSH_OP__RESIZE 2 -#define FLUSH_OP__RENAME 3 +#define FLUSH_OP__MOVE 3 #define FLUSH_OP__ORDER 4 #define FLUSH_OP__MAX_OP 4 @@ -159,7 +159,7 @@ typedef struct flush_op * FLUSH_OP__NO_OP * FLUSH_OP__DIRTY * FLUSH_OP__RESIZE - * FLUSH_OP__RENAME + * FLUSH_OP__MOVE * FLUSH_OP__ORDER */ int type; /* type code of the cache entry that @@ -183,21 +183,21 @@ typedef struct flush_op * FLUSH_OP__DIRTY: TRUE iff the * target is pinned, and is to * be dirtied via the - * H5C_mark_pinned_entry_dirty() + * H5C_mark_entry_dirty() * call. * * FLUSH_OP__RESIZE: TRUE iff the * target is pinned, and is to * be resized via the - * H5C_mark_pinned_entry_dirty() + * H5C_resize_entry() * call. * - * FLUSH_OP__RENAME: TRUE iff the - * target is to be renamed to + * FLUSH_OP__MOVE: TRUE iff the + * target is to be moved to * its main address. */ size_t size; /* New target size in the - * FLUSH_OP__RENAME operation. + * FLUSH_OP__MOVE operation. * Unused elsewhere. */ unsigned * order_ptr; /* Pointer to outside counter for @@ -229,7 +229,7 @@ typedef struct test_entry_t haddr_t main_addr; /* initial location of the entry */ haddr_t alt_addr; /* location to which the entry - * can be relocated or "renamed" + * can be relocated or "moved" */ size_t size; /* how big the cache thinks this * entry is @@ -329,8 +329,8 @@ typedef struct test_entry_t unsigned notify_before_evict_count; /* Count of times that entry was removed in cache */ } test_entry_t; -/* The following is a cut down copy of the hash table manipulation - * macros from H5C.c, which have been further modified to avoid references +/* The following are cut down test versions of the hash table manipulation + * macros from H5Cpkg.h, which have been further modified to avoid references * to the error reporting macros. Needless to say, these macros must be * updated as necessary. */ @@ -339,14 +339,14 @@ typedef struct test_entry_t #define H5C__HASH_FCN(x) (int)(((x) & H5C__HASH_MASK) >> 3) #define H5C_TEST__PRE_HT_SEARCH_SC(cache_ptr, Addr) \ -if ( ( (cache_ptr) == NULL ) || \ - ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ - ( (cache_ptr)->index_size != \ +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 ) ) { \ - HDfprintf(stdout, "Pre HT search SC failed.\n"); \ + ( ! H5F_addr_defined(Addr) ) || \ + ( H5C__HASH_FCN(Addr) < 0 ) || \ + ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ + HDfprintf(stdout, "Pre HT search SC failed.\n"); \ } #define H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \ @@ -371,18 +371,18 @@ if ( ( (cache_ptr) == NULL ) || \ HDfprintf(stdout, "Post successful HT search SC failed.\n"); \ } -#define H5C_TEST__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k) \ +#define H5C_TEST__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k) \ if ( ( (cache_ptr) == NULL ) || \ ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ ( (entry_ptr)->ht_prev != NULL ) ) { \ HDfprintf(stdout, "Post HT shift to front failed.\n"); \ } -#define H5C_TEST__SEARCH_INDEX(cache_ptr, Addr, entry_ptr) \ +#define H5C_TEST__SEARCH_INDEX(cache_ptr, Addr, entry_ptr) \ { \ int k; \ int depth = 0; \ - H5C_TEST__PRE_HT_SEARCH_SC(cache_ptr, Addr) \ + H5C_TEST__PRE_HT_SEARCH_SC(cache_ptr, Addr) \ k = H5C__HASH_FCN(Addr); \ entry_ptr = ((cache_ptr)->index)[k]; \ while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \ @@ -392,7 +392,7 @@ if ( ( (cache_ptr) == NULL ) || \ } \ if ( entry_ptr ) \ { \ - H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \ + H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \ if ( entry_ptr != ((cache_ptr)->index)[k] ) \ { \ if ( (entry_ptr)->ht_next ) \ @@ -405,88 +405,85 @@ if ( ( (cache_ptr) == NULL ) || \ (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ (entry_ptr)->ht_prev = NULL; \ ((cache_ptr)->index)[k] = (entry_ptr); \ - H5C_TEST__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k) \ + H5C_TEST__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k) \ } \ } \ } - -/* misc type definitions */ - -struct flush_cache_test_spec -{ - int entry_num; - int entry_type; - int entry_index; - hbool_t insert_flag; - hbool_t dirty_flag; - unsigned int flags; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; - hbool_t expected_destroyed; -}; - -struct pe_flush_cache_test_spec -{ - int entry_num; - int entry_type; - int entry_index; - hbool_t insert_flag; - hbool_t dirty_flag; - unsigned int flags; - 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_destroyed; -}; +/* Macros used in H5AC level tests */ + +#define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \ + ( ( (a).version == (b).version ) && \ + ( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \ + ( (a).open_trace_file == (b).open_trace_file ) && \ + ( (a).close_trace_file == (b).close_trace_file ) && \ + ( ( (a).open_trace_file == FALSE ) || \ + ( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \ + ( (a).evictions_enabled == (b).evictions_enabled ) && \ + ( ( ! cmp_set_init ) || \ + ( (a).set_initial_size == (b).set_initial_size ) ) && \ + ( ( ! cmp_init_size ) || \ + ( (a).initial_size == (b).initial_size ) ) && \ + ( (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 ) && \ + ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ + ( (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 ) && \ + ( (a).flash_multiple == (b).flash_multiple ) && \ + ( (a).flash_threshold == (b).flash_threshold ) && \ + ( (a).decr_mode == (b).decr_mode ) && \ + ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ + ( (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 ) && \ + ( (a).empty_reserve == (b).empty_reserve ) ) + +#define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \ +{ \ + (i).version = H5C__CURR_AUTO_SIZE_CTL_VER; \ + if ( (e).rpt_fcn_enabled ) \ + (i).rpt_fcn = H5C_def_auto_resize_rpt_fcn; \ + else \ + (i).rpt_fcn = NULL; \ + (i).set_initial_size = (e).set_initial_size; \ + (i).initial_size = (e).initial_size; \ + (i).min_clean_fraction = (e).min_clean_fraction; \ + (i).max_size = (e).max_size; \ + (i).min_size = (e).min_size; \ + (i).epoch_length = (long int)((e).epoch_length); \ + (i).incr_mode = (e).incr_mode; \ + (i).lower_hr_threshold = (e).lower_hr_threshold; \ + (i).increment = (e).increment; \ + (i).apply_max_increment = (e).apply_max_increment; \ + (i).max_increment = (e).max_increment; \ + (i).flash_incr_mode = (e).flash_incr_mode; \ + (i).flash_multiple = (e).flash_multiple; \ + (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; \ + (i).epochs_before_eviction = (int)((e).epochs_before_eviction); \ + (i).apply_empty_reserve = (e).apply_empty_reserve; \ + (i).empty_reserve = (e).empty_reserve; \ +} -struct fo_flush_entry_check -{ - int entry_num; - int entry_type; - int entry_index; - size_t expected_size; - hbool_t in_cache; - hbool_t at_main_addr; - 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_destroyed; -}; +/* Epsilon for floating-point comparisons */ +#define FP_EPSILON 0.000001 -struct fo_flush_cache_test_spec -{ - int entry_num; - int entry_type; - int entry_index; - hbool_t insert_flag; - unsigned int flags; - size_t new_size; - int num_pins; - int pin_type[MAX_PINS]; - 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_destroyed; -}; - -struct rename_entry_test_spec -{ - int entry_type; - int entry_index; - hbool_t is_dirty; - hbool_t is_pinned; -}; + +/* misc type definitions */ struct expected_entry_status { @@ -525,16 +522,6 @@ extern hbool_t skip_long_tests; extern hbool_t run_full_test; extern const char *failure_mssg; -extern test_entry_t pico_entries[NUM_PICO_ENTRIES]; -extern test_entry_t nano_entries[NUM_NANO_ENTRIES]; -extern test_entry_t micro_entries[NUM_MICRO_ENTRIES]; -extern test_entry_t tiny_entries[NUM_TINY_ENTRIES]; -extern test_entry_t small_entries[NUM_SMALL_ENTRIES]; -extern test_entry_t medium_entries[NUM_MEDIUM_ENTRIES]; -extern test_entry_t large_entries[NUM_LARGE_ENTRIES]; -extern test_entry_t huge_entries[NUM_HUGE_ENTRIES]; -extern test_entry_t monster_entries[NUM_MONSTER_ENTRIES]; - extern test_entry_t * entries[NUMBER_OF_ENTRY_TYPES]; extern const int32_t max_indices[NUMBER_OF_ENTRY_TYPES]; extern const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES]; @@ -549,82 +536,6 @@ herr_t check_write_permitted(const H5F_t * f, hid_t dxpl_id, hbool_t * write_permitted_ptr); -herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest); - - -herr_t pico_dest(H5F_t * f, void * thing); -herr_t nano_dest(H5F_t * f, void * thing); -herr_t micro_dest(H5F_t * f, void * thing); -herr_t tiny_dest(H5F_t * f, void * thing); -herr_t small_dest(H5F_t * f, void * thing); -herr_t medium_dest(H5F_t * f, void * thing); -herr_t large_dest(H5F_t * f, void * thing); -herr_t huge_dest(H5F_t * f, void * thing); -herr_t monster_dest(H5F_t * f, void * thing); -herr_t variable_dest(H5F_t * f, void * thing); -herr_t notify_dest(H5F_t * f, void * thing); - - -herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); - - -void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); - - -herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); - -herr_t notify_notify(H5C_notify_action_t action, void *thing); /* callback table extern */ @@ -664,21 +575,15 @@ void expunge_entry(H5F_t * file_ptr, void insert_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - hbool_t dirty, unsigned int flags); -void mark_pinned_entry_dirty(int32_t type, - int32_t idx, - hbool_t size_changed, - size_t new_size); - -void mark_pinned_or_protected_entry_dirty(int32_t type, - int32_t idx); +void mark_entry_dirty(int32_t type, + int32_t idx); -void rename_entry(H5C_t * cache_ptr, - int32_t type, - int32_t idx, - hbool_t main_addr); +void move_entry(H5C_t * cache_ptr, + int32_t type, + int32_t idx, + hbool_t main_addr); void protect_entry(H5F_t * file_ptr, int32_t type, @@ -704,15 +609,10 @@ void create_pinned_entry_dependency(H5F_t * file_ptr, void reset_entries(void); void resize_entry(H5F_t * file_ptr, - int32_t type, - int32_t idx, - size_t new_size, - hbool_t resize_pin); - -void resize_pinned_entry(H5C_t * cache_ptr, - int32_t type, - int32_t idx, - size_t new_size); + int32_t type, + int32_t idx, + size_t new_size, + hbool_t in_cache); H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size); @@ -723,9 +623,8 @@ void row_major_scan_forward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, - hbool_t do_renames, - hbool_t rename_to_main_addr, + hbool_t do_moves, + hbool_t move_to_main_addr, hbool_t do_destroys, hbool_t do_mult_ro_protects, int dirty_destroys, @@ -737,8 +636,7 @@ void hl_row_major_scan_forward(H5F_t * file_ptr, hbool_t reset_stats, hbool_t display_stats, hbool_t display_detailed_stats, - hbool_t do_inserts, - hbool_t dirty_inserts); + hbool_t do_inserts); void row_major_scan_backward(H5F_t * file_ptr, int32_t lag, @@ -747,9 +645,8 @@ void row_major_scan_backward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, - hbool_t do_renames, - hbool_t rename_to_main_addr, + hbool_t do_moves, + hbool_t move_to_main_addr, hbool_t do_destroys, hbool_t do_mult_ro_protects, int dirty_destroys, @@ -761,8 +658,7 @@ void hl_row_major_scan_backward(H5F_t * file_ptr, hbool_t reset_stats, hbool_t display_stats, hbool_t display_detailed_stats, - hbool_t do_inserts, - hbool_t dirty_inserts); + hbool_t do_inserts); void col_major_scan_forward(H5F_t * file_ptr, int32_t lag, @@ -771,7 +667,6 @@ void col_major_scan_forward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects); void hl_col_major_scan_forward(H5F_t * file_ptr, @@ -781,7 +676,6 @@ void hl_col_major_scan_forward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects); void col_major_scan_backward(H5F_t * file_ptr, @@ -791,7 +685,6 @@ void col_major_scan_backward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects); void hl_col_major_scan_backward(H5F_t * file_ptr, @@ -801,7 +694,6 @@ void hl_col_major_scan_backward(H5F_t * file_ptr, hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - hbool_t dirty_inserts, int dirty_unprotects); void takedown_cache(H5F_t * file_ptr, @@ -819,15 +711,8 @@ void unpin_entry(int32_t type, void unprotect_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - int dirty, unsigned int flags); -void unprotect_entry_with_size_change(H5F_t * file_ptr, - int32_t type, - int32_t idx, - unsigned int flags, - size_t new_size); - void verify_clean(void); void verify_entry_status(H5C_t * cache_ptr, @@ -847,5 +732,28 @@ void destroy_flush_dependency(int32_t parent_type, int32_t child_type, int32_t child_idx); +/*** H5AC level utility functions ***/ + +hbool_t resize_configs_are_equal(const H5C_auto_size_ctl_t *a, + const H5C_auto_size_ctl_t *b, hbool_t compare_init); + +void check_and_validate_cache_hit_rate(hid_t file_id, + double * hit_rate_ptr, + hbool_t dump_data, + int64_t min_accesses, + double min_hit_rate); + +void check_and_validate_cache_size(hid_t file_id, + size_t * max_size_ptr, + size_t * min_clean_size_ptr, + size_t * cur_size_ptr, + int32_t * cur_num_entries_ptr, + hbool_t dump_data); + +void validate_mdc_config(hid_t file_id, + H5AC_cache_config_t * ext_config_ptr, + hbool_t compare_init, + int test_num); + #endif /* _CACHE_COMMON_H */ diff --git a/test/h5test.c b/test/h5test.c index 10ca47e..229efec 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -30,7 +30,7 @@ #ifdef _WIN32 #include #include -#include +#include #endif /* _WIN32 */ /* diff --git a/test/ohdr.c b/test/ohdr.c index db97805..dad06cf 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -512,6 +512,8 @@ main(void) HDputs("Accessing objects with unknown header messages:"); { hid_t file2; /* File ID for 'bogus' object file */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ const char *testfile = H5_get_srcdir_filename(FILE_BOGUS); TESTING("object with unknown header message and no flags set"); @@ -579,6 +581,22 @@ main(void) if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) TEST_ERROR + /* Create data space */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + + /* Create an attribute, to get the object header into write access */ + if((aid = H5Acreate2(dset, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close attribute */ + if(H5Aclose(aid) < 0) + FAIL_STACK_ERROR + /* Close the dataset */ if(H5Dclose(dset) < 0) TEST_ERROR diff --git a/test/set_extent.c b/test/set_extent.c index 9d669a2..0582c41 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -55,11 +55,10 @@ const char *FILENAME[] = { #define DO_RANKS_PRINT_CONFIG(TEST) { \ printf(" Config:\n"); \ printf(" Test: %s\n", TEST); \ - printf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" \ - : "no")); \ + printf(" Compression: %s\n", (config & CONFIG_COMPRESS ? "yes" : "no")); \ printf(" Fill value: %s\n", (do_fillvalue ? "yes" : "no")); \ - printf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC \ - ? "yes" : "no")); \ + printf(" Early allocation: %s\n", (config & CONFIG_EARLY_ALLOC ? "yes" \ + : "no")); \ } /* end DO_RANKS_PRINT_CONFIG */ #define RANK1 1 @@ -76,6 +75,7 @@ const char *FILENAME[] = { #define DIME2 7 #define ISTORE_IK 64 #define RAND4_NITER 100 +#define RAND4_SPARSE_SWITCH 10 #define RAND4_FAIL_DUMP(NDIM_SETS, J, K, L, M) { \ H5_FAILED(); AT(); \ test_random_rank4_dump(NDIM_SETS, dim_log, cdims, J, K, L, M); \ @@ -99,7 +99,8 @@ static int test_rank3( hid_t fapl, hbool_t set_istore_k); static int test_random_rank4( hid_t fapl, hid_t dcpl, - hbool_t do_fillvalue); + hbool_t do_fillvalue, + hbool_t do_sparse); static int test_external( hid_t fapl ); static int test_layouts( H5D_layout_t layout, hid_t fapl ); @@ -128,8 +129,11 @@ int main( void ) /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR + /* Set chunk cache so only part of the chunks can be cached on fapl */ + if(H5Pset_cache(fapl, 0, 8, 256 * sizeof(int), 0.75) < 0) TEST_ERROR + /* Disable chunk caching on fapl2 */ - if(H5Pset_cache(fapl2, 521, 0, 0, 0.) < 0) TEST_ERROR + if(H5Pset_cache(fapl2, 0, 0, 0, 0.) < 0) TEST_ERROR /* Set the "use the latest version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR @@ -320,11 +324,17 @@ static int do_ranks( hid_t fapl ) if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) TEST_ERROR - if(test_random_rank4(fapl, dcpl, do_fillvalue) < 0) { + if(test_random_rank4(fapl, dcpl, do_fillvalue, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Randomized rank 4") goto error; } /* end if */ + if(!(config & CONFIG_EARLY_ALLOC)) + if(test_random_rank4(fapl, dcpl, do_fillvalue, TRUE) < 0) { + DO_RANKS_PRINT_CONFIG("Randomized rank 4 with sparse allocation") + goto error; + } /* end if */ + /* Close dcpl */ if(H5Pclose(dcpl) < 0) TEST_ERROR @@ -2658,7 +2668,8 @@ error: * *------------------------------------------------------------------------- */ -static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue ) +static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, + hbool_t do_sparse ) { hid_t file = -1; hid_t dset = -1; @@ -2667,12 +2678,16 @@ static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue ) hid_t my_dcpl = -1; hsize_t dims[4]; /* Dataset's dimensions */ hsize_t old_dims[4]; /* Old dataset dimensions */ + hsize_t min_unwritten_dims[4]; /* Minimum dimensions since last write */ + hsize_t *valid_dims = old_dims; /* Dimensions of region still containing written data */ hsize_t cdims[4]; /* Chunk dimensions */ const hsize_t mdims[4] = {10, 10, 10, 10}; /* Memory buffer dimensions */ const hsize_t start[4] = {0, 0, 0, 0}; /* Start for hyperslabe operations on memory */ static int rbuf[10][10][10][10]; /* Read buffer */ static int wbuf[10][10][10][10]; /* Write buffer */ static hsize_t dim_log[RAND4_NITER+1][4]; /* Log of dataset dimensions */ + hbool_t zero_dim = FALSE; /* Whether a dimension is 0 */ + hbool_t writing = TRUE; /* Whether we're writing to the dset */ volatile unsigned i, j, k, l, m; /* Local indices */ char filename[NAME_BUF_SIZE]; @@ -2681,9 +2696,9 @@ static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue ) if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR - /* Generate random chunk dimensions, 2-6 */ + /* Generate random chunk dimensions, 2-4 */ for(i=0; i<4; i++) - cdims[i] = (hsize_t)((HDrandom() % 5) + 2); + cdims[i] = (hsize_t)((HDrandom() % 3) + 2); /* Generate initial dataset size, 1-10 */ for(i=0; i<4; i++) { @@ -2713,60 +2728,86 @@ static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue ) /* Main loop */ for(i=0; i= old_dims[0] || k >= old_dims[1] - || l >= old_dims[2] || m >= old_dims[3]) { - if(FILL_VALUE != rbuf[j][k][l][m]) - RAND4_FAIL_DUMP(i+2, (int)j, (int)k, (int)l, (int)m) - } /* end if */ - else + if(!zero_dim) { + /* Read data from resized dataset */ + if(H5Sselect_hyperslab(mspace, H5S_SELECT_SET, start, NULL, dims, + NULL) < 0) + RAND4_FAIL_DUMP(i+2, -1, -1, -1, -1) + if(H5Dread(dset, H5T_NATIVE_INT, mspace, H5S_ALL, H5P_DEFAULT, rbuf) + < 0) + RAND4_FAIL_DUMP(i+2, -1, -1, -1, -1) + + /* Verify correctness of read data */ + if(do_fillvalue) { + for(j=0; j= valid_dims[0] || k >= valid_dims[1] + || l >= valid_dims[2] + || m >= valid_dims[3]) { + if(FILL_VALUE != rbuf[j][k][l][m]) + RAND4_FAIL_DUMP(i+2, (int)j, (int)k, (int)l, (int)m) + } /* end if */ + else + if(wbuf[j][k][l][m] != rbuf[j][k][l][m]) + RAND4_FAIL_DUMP(i+2, (int)j, (int)k, (int)l, (int)m) + } /* end if */ + else { + for(j=0; j> $actual - if [ \( $expect_code -ne $ret_code \) ]; then + if [ $h5haveexitcode = 'yes' -a \( $expect_code -ne $ret_code \) ]; then echo "*FAILED*" echo " Expected exit code ($expect_code) differs from actual code ($ret_code)" nerrors="`expr $nerrors + 1`" @@ -234,6 +235,13 @@ case "$h5versmajor$h5versminor$h5versrelease" in ;; esac +# RUNSERIAL is used. Check if it can return exit code from executalbe correctly. +if [ -n "$RUNSERIAL_NOEXITCODE" ]; then + echo "***Warning*** Serial Exit Code is not passed back to shell corretly." + echo "***Warning*** Exit code checking is skipped." + h5haveexitcode=no +fi + # Three Categories of tests: # Normal: where the version numbers all matched (wrong_version == none). # Mismatched version numbers (could be Major or minor version diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt new file mode 100644 index 0000000..0eac602 --- /dev/null +++ b/testpar/CMakeLists.txt @@ -0,0 +1,66 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (H5_TEST_PAR) + +#----------------------------------------------------------------------------- +# Define Tests +#----------------------------------------------------------------------------- + +SET (testphdf5_SRCS + ${HDF5_TEST_PAR_SOURCE_DIR}/testphdf5.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_dset.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_file.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_mdset.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_ph5basic.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_coll_chunk.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_span_tree.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_chunk_alloc.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_filter_read.c +) + +#-- Adding test for testhdf5 +ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) +H5_NAMING (testphdf5) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testphdf5 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_TEST (NAME testphdf5 COMMAND $) + +MACRO (ADD_H5P_TEST file) + ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + H5_NAMING (${file}) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${file} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + + ADD_TEST (NAME ${file} COMMAND $) +ENDMACRO (ADD_H5P_TEST file) + +SET (H5P_TESTS + t_mpi + t_posix_compliant + t_cache + t_pflush1 + t_pflush2 +) + +FOREACH (testp ${H5P_TESTS}) + ADD_H5P_TEST(${testp}) +ENDFOREACH (testp ${H5P_TESTS}) + diff --git a/testpar/Makefile.in b/testpar/Makefile.in index bee63d0..2b4b00b 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -209,12 +209,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 476f110..9bcf09f 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -205,7 +205,7 @@ int virt_num_data_entries = NUM_DATA_ENTRIES; * The data_index array is an array of integer used to maintain a list * of instances of datum in the data array in increasing base_addr order. * - * This array is necessary, as rename operations can swap the values + * This array is necessary, as move operations can swap the values * of the base_addr fields of two instances of datum. Without this * array, we would no longer be able to use a binary search on a sorted * list to find the indexes of instances of datum given the values of @@ -342,40 +342,33 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = /* test utility functions */ -void expunge_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx); +void expunge_entry(H5F_t * file_ptr, int32_t idx); void insert_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx, unsigned int flags); -void local_pin_and_unpin_random_entries(H5C_t * cache_ptr, H5F_t * file_ptr, - int min_idx, int max_idx, - int min_count, int max_count); -void local_pin_random_entry(H5C_t * cache_ptr, H5F_t * file_ptr, - int min_idx, int max_idx); -void local_unpin_all_entries(H5C_t * cache_ptr, H5F_t * file_ptr, - hbool_t via_unprotect); -int local_unpin_next_pinned_entry(H5C_t * cache_ptr, H5F_t * file_ptr, - int start_idx, hbool_t via_unprotect); -void lock_and_unlock_random_entries(H5C_t * cache_ptr, H5F_t * file_ptr, - int min_idx, int max_idx, +void local_pin_and_unpin_random_entries(H5F_t * file_ptr, int min_idx, + int max_idx, int min_count, + int max_count); +void local_pin_random_entry(H5F_t * file_ptr, int min_idx, int max_idx); +void local_unpin_all_entries(H5F_t * file_ptr, hbool_t via_unprotect); +int local_unpin_next_pinned_entry(H5F_t * file_ptr, int start_idx, + hbool_t via_unprotect); +void lock_and_unlock_random_entries(H5F_t * file_ptr, int min_idx, int max_idx, int min_count, int max_count); -void lock_and_unlock_random_entry(H5C_t * cache_ptr, H5F_t * file_ptr, +void lock_and_unlock_random_entry(H5F_t * file_ptr, int min_idx, int max_idx); -void lock_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx); -void mark_pinned_entry_dirty(int32_t idx, hbool_t size_changed, size_t new_size); -void mark_pinned_or_protected_entry_dirty(int32_t idx); -void pin_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx, - hbool_t global, hbool_t dirty); +void lock_entry(H5F_t * file_ptr, int32_t idx); +void mark_entry_dirty(int32_t idx); +void pin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global, hbool_t dirty); void pin_protected_entry(int32_t idx, hbool_t global); -void rename_entry(H5C_t * cache_ptr, H5F_t * file_ptr, - int32_t old_idx, int32_t new_idx); +void move_entry(H5F_t * file_ptr, int32_t old_idx, int32_t new_idx); void resize_entry(int32_t idx, size_t new_size); hbool_t setup_cache_for_test(hid_t * fid_ptr, H5F_t ** file_ptr_ptr, H5C_t ** cache_ptr_ptr); void setup_rand(void); hbool_t take_down_cache(hid_t fid); -void unlock_entry(H5C_t * cache_ptr, H5F_t * file_ptr, - int32_t type, unsigned int flags); -void unpin_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx, - hbool_t global, hbool_t dirty, hbool_t via_unprotect); +void unlock_entry(H5F_t * file_ptr, int32_t type, unsigned int flags); +void unpin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global, + hbool_t dirty, hbool_t via_unprotect); /* test functions */ @@ -725,7 +718,7 @@ init_data(void) int j = 0; haddr_t addr = 512; - /* this must hold so renames don't change entry size. */ + /* this must hold so moves don't change entry size. */ HDassert( (NUM_DATA_ENTRIES / 2) % 20 == 0 ); HDassert( (virt_num_data_entries / 2) % 20 == 0 ); @@ -1657,6 +1650,7 @@ serve_write_request(struct mssg_t * mssg_ptr) /**************************** Call back functions ****************************/ /*****************************************************************************/ + /*------------------------------------------------------------------------- * Function: clear_datum * @@ -2184,8 +2178,7 @@ size_datum(H5F_t UNUSED * f, *****************************************************************************/ void -expunge_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +expunge_entry(H5F_t * file_ptr, int32_t idx) { const char * fcn_name = "expunge_entry()"; @@ -2193,7 +2186,6 @@ expunge_entry(H5C_t * cache_ptr, herr_t result; struct datum * entry_ptr; - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) ); HDassert( idx < virt_num_data_entries ); @@ -2375,8 +2367,7 @@ insert_entry(H5C_t * cache_ptr, *****************************************************************************/ void -local_pin_and_unpin_random_entries(H5C_t * cache_ptr, - H5F_t * file_ptr, +local_pin_and_unpin_random_entries(H5F_t * file_ptr, int min_idx, int max_idx, int min_count, @@ -2391,7 +2382,6 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr, int i; int idx; - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( 0 <= min_idx ); HDassert( min_idx < max_idx ); @@ -2407,7 +2397,7 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr, for ( i = 0; i < count; i++ ) { - local_pin_random_entry(cache_ptr, file_ptr, min_idx, max_idx); + local_pin_random_entry(file_ptr, min_idx, max_idx); } count = (HDrand() % (max_count - min_count)) + min_count; @@ -2421,8 +2411,7 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr, while ( ( i < count ) && ( idx >= 0 ) ) { via_unprotect = ( (((unsigned)i) & 0x0001) == 0 ); - idx = local_unpin_next_pinned_entry(cache_ptr, file_ptr, - idx, via_unprotect); + idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect); i++; } } @@ -2452,8 +2441,7 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr, *****************************************************************************/ void -local_pin_random_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +local_pin_random_entry(H5F_t * file_ptr, int min_idx, int max_idx) { @@ -2462,7 +2450,6 @@ local_pin_random_entry(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( 0 <= min_idx ); HDassert( min_idx < max_idx ); @@ -2477,7 +2464,7 @@ local_pin_random_entry(H5C_t * cache_ptr, } while ( data[idx].global_pinned || data[idx].local_pinned ); - pin_entry(cache_ptr, file_ptr, idx, FALSE, FALSE); + pin_entry(file_ptr, idx, FALSE, FALSE); } return; @@ -2502,8 +2489,7 @@ local_pin_random_entry(H5C_t * cache_ptr, *****************************************************************************/ void -local_unpin_all_entries(H5C_t * cache_ptr, - H5F_t * file_ptr, +local_unpin_all_entries(H5F_t * file_ptr, hbool_t via_unprotect) { /* const char * fcn_name = "local_unpin_all_entries()"; */ @@ -2512,14 +2498,13 @@ local_unpin_all_entries(H5C_t * cache_ptr, int idx; - HDassert( cache_ptr ); HDassert( file_ptr ); idx = 0; while ( idx >= 0 ) { - idx = local_unpin_next_pinned_entry(cache_ptr, file_ptr, + idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect); } } @@ -2549,8 +2534,7 @@ local_unpin_all_entries(H5C_t * cache_ptr, *****************************************************************************/ int -local_unpin_next_pinned_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +local_unpin_next_pinned_entry(H5F_t * file_ptr, int start_idx, hbool_t via_unprotect) { @@ -2560,7 +2544,6 @@ local_unpin_next_pinned_entry(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( 0 <= start_idx ); HDassert( start_idx < NUM_DATA_ENTRIES ); @@ -2580,7 +2563,7 @@ local_unpin_next_pinned_entry(H5C_t * cache_ptr, if ( data[idx].local_pinned ) { - unpin_entry(cache_ptr, file_ptr, idx, FALSE, FALSE, via_unprotect); + unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect); } else { @@ -2612,8 +2595,7 @@ local_unpin_next_pinned_entry(H5C_t * cache_ptr, *****************************************************************************/ void -lock_and_unlock_random_entries(H5C_t * cache_ptr, - H5F_t * file_ptr, +lock_and_unlock_random_entries(H5F_t * file_ptr, int min_idx, int max_idx, int min_count, @@ -2625,7 +2607,6 @@ lock_and_unlock_random_entries(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( 0 <= min_count ); HDassert( min_count < max_count ); @@ -2637,7 +2618,7 @@ lock_and_unlock_random_entries(H5C_t * cache_ptr, for ( i = 0; i < count; i++ ) { - lock_and_unlock_random_entry(cache_ptr, file_ptr, min_idx, max_idx); + lock_and_unlock_random_entry(file_ptr, min_idx, max_idx); } } @@ -2664,8 +2645,7 @@ lock_and_unlock_random_entries(H5C_t * cache_ptr, *****************************************************************************/ void -lock_and_unlock_random_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +lock_and_unlock_random_entry(H5F_t * file_ptr, int min_idx, int max_idx) { @@ -2674,7 +2654,6 @@ lock_and_unlock_random_entry(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( 0 <= min_idx ); HDassert( min_idx < max_idx ); @@ -2686,8 +2665,8 @@ lock_and_unlock_random_entry(H5C_t * cache_ptr, HDassert( min_idx <= idx ); HDassert( idx <= max_idx ); - lock_entry(cache_ptr, file_ptr, idx); - unlock_entry(cache_ptr, file_ptr, idx, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, idx); + unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET); } return; @@ -2716,8 +2695,7 @@ lock_and_unlock_random_entry(H5C_t * cache_ptr, *****************************************************************************/ void -lock_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +lock_entry(H5F_t * file_ptr, int32_t idx) { const char * fcn_name = "lock_entry()"; @@ -2726,7 +2704,6 @@ lock_entry(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) ); HDassert( idx < virt_num_data_entries ); @@ -2764,7 +2741,7 @@ lock_entry(H5C_t * cache_ptr, /***************************************************************************** - * Function: mark_pinned_entry_dirty() + * Function: mark_entry_dirty() * * Purpose: Mark dirty the entry indicated by the index, * @@ -2775,16 +2752,12 @@ lock_entry(H5C_t * cache_ptr, * Programmer: John Mainzer * 4/14/06 * - * Modifications: - * *****************************************************************************/ void -mark_pinned_entry_dirty(int32_t idx, - hbool_t size_changed, - size_t new_size) +mark_entry_dirty(int32_t idx) { - const char * fcn_name = "mark_pinned_entry_dirty()"; + const char * fcn_name = "mark_entry_dirty()"; herr_t result; struct datum * entry_ptr; @@ -2795,83 +2768,23 @@ mark_pinned_entry_dirty(int32_t idx, entry_ptr = &(data[idx]); - HDassert ( entry_ptr->global_pinned ); + HDassert ( entry_ptr->locked || entry_ptr->global_pinned ); HDassert ( ! (entry_ptr->local_pinned) ); (entry_ptr->ver)++; entry_ptr->dirty = TRUE; - result = H5AC_mark_pinned_entry_dirty((void *)entry_ptr, - size_changed, - new_size); + result = H5AC_mark_entry_dirty( (void *)entry_ptr); if ( result < 0 ) { nerrors++; if ( verbose ) { HDfprintf(stdout, - "%d:%s: error in H5AC_mark_pinned_entry_dirty().\n", + "%d:%s: error in H5AC_mark_entry_dirty().\n", world_mpi_rank, fcn_name); } } - else - { - global_dirty_pins++; - } - } - - return; - -} /* mark_pinned_entry_dirty() */ - - -/***************************************************************************** - * Function: mark_pinned_or_protected_entry_dirty() - * - * Purpose: Use the H5AC_mark_pinned_or_protected_entry_dirty() call to - * mark dirty the entry indicated by the index, - * - * Do nothing if nerrors is non-zero on entry. - * - * Return: void - * - * Programmer: John Mainzer - * 5/18/06 - * - * Modifications: - * - *****************************************************************************/ - -void -mark_pinned_or_protected_entry_dirty(int32_t idx) -{ - const char * fcn_name = "mark_pinned_or_protected_entry_dirty()"; - herr_t result; - struct datum * entry_ptr; - - if ( nerrors == 0 ) { - - HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) ); - HDassert( idx < virt_num_data_entries ); - - entry_ptr = &(data[idx]); - - HDassert ( entry_ptr->locked || entry_ptr->global_pinned ); - - (entry_ptr->ver)++; - entry_ptr->dirty = TRUE; - - result = H5AC_mark_pinned_or_protected_entry_dirty((void *)entry_ptr); - - if ( result < 0 ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: error in %s.\n", - world_mpi_rank, fcn_name, - "H5AC_mark_pinned_or_protected_entry_dirty()"); - } - } else if ( ! ( entry_ptr->locked ) ) { global_dirty_pins++; @@ -2880,7 +2793,7 @@ mark_pinned_or_protected_entry_dirty(int32_t idx) return; -} /* mark_pinned_or_protected_entry_dirty() */ +} /* mark_entry_dirty() */ /***************************************************************************** @@ -2900,8 +2813,7 @@ mark_pinned_or_protected_entry_dirty(int32_t idx) *****************************************************************************/ void -pin_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +pin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global, hbool_t dirty) @@ -2912,7 +2824,6 @@ pin_entry(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) ); HDassert( idx < virt_num_data_entries ); @@ -2923,14 +2834,14 @@ pin_entry(H5C_t * cache_ptr, HDassert ( ! (entry_ptr->local_pinned) ); HDassert ( ! ( dirty && ( ! global ) ) ); - lock_entry(cache_ptr, file_ptr, idx); + lock_entry(file_ptr, idx); if ( dirty ) { flags |= H5AC__DIRTIED_FLAG; } - unlock_entry(cache_ptr, file_ptr, idx, flags); + unlock_entry(file_ptr, idx, flags); HDassert( (entry_ptr->header).is_pinned ); HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) ); @@ -3031,9 +2942,9 @@ pin_protected_entry(int32_t idx, /***************************************************************************** - * Function: rename_entry() + * Function: move_entry() * - * Purpose: Rename the entry indicated old_idx to the entry indicated + * Purpose: Move the entry indicated old_idx to the entry indicated * by new_idex. Touch up the data array so that flush will * not choke. * @@ -3053,12 +2964,11 @@ pin_protected_entry(int32_t idx, *****************************************************************************/ void -rename_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, - int32_t old_idx, - int32_t new_idx) +move_entry(H5F_t * file_ptr, + int32_t old_idx, + int32_t new_idx) { - const char * fcn_name = "rename_entry()"; + const char * fcn_name = "move_entry()"; herr_t result; int tmp; size_t tmp_len; @@ -3069,7 +2979,6 @@ rename_entry(H5C_t * cache_ptr, if ( ( nerrors == 0 ) && ( old_idx != new_idx ) ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( ( 0 <= old_idx ) && ( old_idx < NUM_DATA_ENTRIES ) ); HDassert( old_idx < virt_num_data_entries ); @@ -3087,13 +2996,13 @@ rename_entry(H5C_t * cache_ptr, old_addr = old_entry_ptr->base_addr; new_addr = new_entry_ptr->base_addr; - result = H5AC_rename(file_ptr, &(types[0]), old_addr, new_addr); + result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr); if ( ( result < 0 ) || ( old_entry_ptr->header.addr != new_addr ) ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5AC_rename() failed.\n", + HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", world_mpi_rank, fcn_name); } @@ -3136,7 +3045,7 @@ rename_entry(H5C_t * cache_ptr, return; -} /* rename_entry() */ +} /* move_entry() */ /***************************************************************************** @@ -3175,7 +3084,6 @@ resize_entry(int32_t idx, entry_ptr = &(data[idx]); HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); - HDassert( !(entry_ptr->header.is_protected) ); HDassert( !(entry_ptr->locked) ); HDassert( ( entry_ptr->global_pinned ) && ( ! entry_ptr->local_pinned ) ); @@ -3184,13 +3092,13 @@ resize_entry(int32_t idx, HDassert( new_size > 0 ); HDassert( new_size <= entry_ptr->len ); - result = H5AC_resize_pinned_entry((void *)entry_ptr, new_size); + result = H5AC_resize_entry((void *)entry_ptr, new_size); if ( result < 0 ) { nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5AC_rename() failed.\n", + HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", world_mpi_rank, fcn_name); } @@ -3321,7 +3229,7 @@ setup_cache_for_test(hid_t * fid_ptr, config.rpt_fcn_enabled = TRUE; if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", @@ -3622,8 +3530,7 @@ take_down_cache(hid_t fid) *****************************************************************************/ void -unlock_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +unlock_entry(H5F_t * file_ptr, int32_t idx, unsigned int flags) { @@ -3634,7 +3541,6 @@ unlock_entry(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) ); HDassert( idx < virt_num_data_entries ); @@ -3652,8 +3558,7 @@ unlock_entry(H5C_t * cache_ptr, } result = H5AC_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), - entry_ptr->base_addr, - (void *)(&(entry_ptr->header)), flags); + entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags); if ( ( result < 0 ) || ( entry_ptr->header.type != &(types[0]) ) || @@ -3712,8 +3617,7 @@ unlock_entry(H5C_t * cache_ptr, *****************************************************************************/ void -unpin_entry(H5C_t * cache_ptr, - H5F_t * file_ptr, +unpin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global, hbool_t dirty, @@ -3726,7 +3630,6 @@ unpin_entry(H5C_t * cache_ptr, if ( nerrors == 0 ) { - HDassert( cache_ptr ); HDassert( file_ptr ); HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) ); HDassert( idx < virt_num_data_entries ); @@ -3741,20 +3644,20 @@ unpin_entry(H5C_t * cache_ptr, if ( via_unprotect ) { - lock_entry(cache_ptr, file_ptr, idx); + lock_entry(file_ptr, idx); if ( dirty ) { flags |= H5AC__DIRTIED_FLAG; } - unlock_entry(cache_ptr, file_ptr, idx, flags); + unlock_entry(file_ptr, idx, flags); } else { if ( dirty ) { - mark_pinned_entry_dirty(idx, FALSE, (size_t)0); + mark_entry_dirty(idx); } @@ -4086,26 +3989,24 @@ smoke_check_1(void) for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); } - /* rename the first half of the entries... */ + /* Move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); } - /* ...and then rename them back. */ + /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); } if ( fid >= 0 ) { @@ -4198,7 +4099,7 @@ smoke_check_1(void) * Added pinned entry tests. * * JRM -- 4/28/06 - * Modified test to rename pinned entries. + * Modified test to move pinned entries. * *****************************************************************************/ @@ -4254,8 +4155,7 @@ smoke_check_2(void) if ( i > 100 ) { - lock_and_unlock_random_entries(cache_ptr, file_ptr, - (i - 100), i, 0, 10); + lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10); } } @@ -4263,56 +4163,54 @@ smoke_check_2(void) { /* Make sure we don't step on any locally pinned entries */ if ( data[i].local_pinned ) { - unpin_entry(cache_ptr, file_ptr, i, FALSE, FALSE, FALSE); + unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); } - pin_entry(cache_ptr, file_ptr, i, TRUE, FALSE); + pin_entry(file_ptr, i, TRUE, FALSE); } for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-=2 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_and_unlock_random_entries(file_ptr, 0, (virt_num_data_entries / 20), 0, 100); - local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0, + local_pin_and_unpin_random_entries(file_ptr, 0, (virt_num_data_entries / 4), 0, 3); } for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, 0, (virt_num_data_entries / 10), 0, 100); } - /* we can't rename pinned entries, so release any local pins now. */ - local_unpin_all_entries(cache_ptr, file_ptr, FALSE); + /* we can't move pinned entries, so release any local pins now. */ + local_unpin_all_entries(file_ptr, FALSE); - /* rename the first half of the entries... */ + /* Move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, ((virt_num_data_entries / 50) - 1), 0, 100); } - /* ...and then rename them back. */ + /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, (virt_num_data_entries / 100), 0, 100); } @@ -4322,7 +4220,7 @@ smoke_check_2(void) hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 ); hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 ); - unpin_entry(cache_ptr, file_ptr, i, TRUE, dirty, via_unprotect); + unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); } if ( fid >= 0 ) { @@ -4498,8 +4396,7 @@ smoke_check_3(void) if ( i > 100 ) { - lock_and_unlock_random_entries(cache_ptr, file_ptr, - (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -4523,10 +4420,10 @@ smoke_check_3(void) hbool_t dirty = ( (i % 2) == 0); if ( data[i].local_pinned ) { - unpin_entry(cache_ptr, file_ptr, i, FALSE, FALSE, FALSE); + unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); } - pin_entry(cache_ptr, file_ptr, i, TRUE, dirty); + pin_entry(file_ptr, i, TRUE, dirty); HDassert( !dirty || data[i].header.is_dirty ); HDassert( data[i].header.is_pinned ); @@ -4536,13 +4433,12 @@ smoke_check_3(void) if ( i > 100 ) { - lock_and_unlock_random_entries(cache_ptr, file_ptr, - (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } - local_pin_and_unpin_random_entries(cache_ptr, file_ptr, - 0, virt_num_data_entries / 4, + local_pin_and_unpin_random_entries(file_ptr, 0, + virt_num_data_entries / 4, 0, (file_mpi_rank + 2)); } @@ -4584,17 +4480,17 @@ smoke_check_3(void) HDassert( data[i].global_pinned ); HDassert( ! data[i].local_pinned ); - unpin_entry(cache_ptr, file_ptr, i, TRUE, dirty, + unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); } if ( i % 2 == 0 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + local_pin_and_unpin_random_entries(file_ptr, 0, virt_num_data_entries / 2, 0, 2); - lock_and_unlock_random_entries(cache_ptr, file_ptr, + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } } @@ -4612,29 +4508,28 @@ smoke_check_3(void) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(cache_ptr, file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } /* 7 */ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* we can't rename pinned entries, so release any local pins now. */ - local_unpin_all_entries(cache_ptr, file_ptr, FALSE); + /* we can't move pinned entries, so release any local pins now. */ + local_unpin_all_entries(file_ptr, FALSE); min_count = 10 / (file_mpi_rank + 1); max_count = min_count + 100; - /* rename the first half of the entries... */ + /* move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, (virt_num_data_entries / 20), min_count, max_count); } @@ -4642,14 +4537,13 @@ smoke_check_3(void) /* 8 */ if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} - /* ...and then rename them back. */ + /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, (virt_num_data_entries / 40), min_count, max_count); } @@ -4665,17 +4559,16 @@ smoke_check_3(void) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0, + local_pin_and_unpin_random_entries(file_ptr, 0, (virt_num_data_entries / 2), 0, 5); - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); if ( i > 100 ) { - lock_and_unlock_random_entries(cache_ptr, file_ptr, - (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -4684,7 +4577,7 @@ smoke_check_3(void) if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} /* release any local pins before we take down the cache. */ - local_unpin_all_entries(cache_ptr, file_ptr, FALSE); + local_unpin_all_entries(file_ptr, FALSE); if ( fid >= 0 ) { @@ -4852,8 +4745,7 @@ smoke_check_4(void) if ( i > 100 ) { - lock_and_unlock_random_entries(cache_ptr, file_ptr, - (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -4877,7 +4769,7 @@ smoke_check_4(void) * entries are in fact pinned (which unpin_entry() should do). */ insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG); - unpin_entry(cache_ptr, file_ptr, i, TRUE, FALSE, FALSE); + unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); } if ( i % 59 == 0 ) { @@ -4885,10 +4777,10 @@ smoke_check_4(void) hbool_t dirty = ( (i % 2) == 0); if ( data[i].local_pinned ) { - unpin_entry(cache_ptr, file_ptr, i, FALSE, FALSE, FALSE); + unpin_entry(file_ptr, i, FALSE, FALSE, FALSE); } - pin_entry(cache_ptr, file_ptr, i, TRUE, dirty); + pin_entry(file_ptr, i, TRUE, dirty); HDassert( !dirty || data[i].header.is_dirty ); HDassert( data[i].header.is_pinned ); @@ -4898,12 +4790,11 @@ smoke_check_4(void) if ( i > 100 ) { - lock_and_unlock_random_entries(cache_ptr, file_ptr, - (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } - local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0, + local_pin_and_unpin_random_entries(file_ptr, 0, (virt_num_data_entries / 4), 0, (file_mpi_rank + 2)); } @@ -4935,14 +4826,14 @@ smoke_check_4(void) HDassert( data[i].global_pinned ); HDassert( ! data[i].local_pinned ); - unpin_entry(cache_ptr, file_ptr, i, TRUE, dirty, via_unprotect); + unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); } if ( i % 2 == 0 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - lock_and_unlock_random_entries(cache_ptr, file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } } @@ -4953,38 +4844,36 @@ smoke_check_4(void) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); - lock_and_unlock_random_entries(cache_ptr, file_ptr, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + lock_and_unlock_random_entries(file_ptr, min_idx, max_idx, 0, 100); } - /* we can't rename pinned entries, so release any local pins now. */ - local_unpin_all_entries(cache_ptr, file_ptr, FALSE); + /* we can't move pinned entries, so release any local pins now. */ + local_unpin_all_entries(file_ptr, FALSE); min_count = 10 * (file_mpi_rank % 4); max_count = min_count + 100; - /* rename the first half of the entries... */ + /* move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, (virt_num_data_entries / 20), min_count, max_count); } - /* ...and then rename them back. */ + /* ...and then move them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); - rename_entry(cache_ptr, file_ptr, i, - (i + (virt_num_data_entries / 2))); - lock_and_unlock_random_entries(cache_ptr, file_ptr, 0, + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); + move_entry(file_ptr, i, (i + (virt_num_data_entries / 2))); + lock_and_unlock_random_entries(file_ptr, 0, (virt_num_data_entries / 40), min_count, max_count); } @@ -4997,13 +4886,12 @@ smoke_check_4(void) for ( i = 0; i < (virt_num_data_entries / 2); i+=2 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); if ( i > 100 ) { - lock_and_unlock_random_entries(cache_ptr, file_ptr, - (i - 100), i, + lock_and_unlock_random_entries(file_ptr, (i - 100), i, min_count, max_count); } } @@ -5083,8 +4971,7 @@ smoke_check_4(void) * Function: smoke_check_5() * * Purpose: Similar to smoke check 1, but modified to verify that - * H5AC_mark_pinned_or_protected_entry_dirty() works in - * the parallel case. + * H5AC_mark_entry_dirty() works in the parallel case. * * Return: Success: TRUE * @@ -5096,7 +4983,7 @@ smoke_check_4(void) * * JRM -- 7/12/06 * Added test code for H5AC_expunge_entry() and - * H5AC_resize_pinned_entry(). + * H5AC_resize_entry(). * *****************************************************************************/ @@ -5198,24 +5085,24 @@ smoke_check_5(void) for ( i = 0; i < (virt_num_data_entries / 4); i++ ) { - lock_entry(cache_ptr, file_ptr, i); + lock_entry(file_ptr, i); if ( i % 2 == 0 ) { - mark_pinned_or_protected_entry_dirty(i); + mark_entry_dirty(i); } - unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); + unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET); if ( i % 2 == 1 ) { if ( i % 4 == 1 ) { - lock_entry(cache_ptr, file_ptr, i); - unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG); + lock_entry(file_ptr, i); + unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG); } - expunge_entry(cache_ptr, file_ptr, i); + expunge_entry(file_ptr, i); } } @@ -5228,7 +5115,7 @@ smoke_check_5(void) i >= (virt_num_data_entries / 4); i-- ) { - pin_entry(cache_ptr, file_ptr, i, TRUE, FALSE); + pin_entry(file_ptr, i, TRUE, FALSE); if ( i % 2 == 0 ) { @@ -5237,14 +5124,7 @@ smoke_check_5(void) resize_entry(i, data[i].len / 2); } - if ( i % 4 == 0 ) - { - mark_pinned_or_protected_entry_dirty(i); - } - else - { - mark_pinned_entry_dirty(i, FALSE, (size_t)0); - } + mark_entry_dirty(i); if ( i % 8 <= 4 ) { @@ -5252,7 +5132,7 @@ smoke_check_5(void) } } - unpin_entry(cache_ptr, file_ptr, i, TRUE, FALSE, FALSE); + unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); } /* 6 */ @@ -5364,16 +5244,15 @@ smoke_check_5(void) * * - H5AC_flush() * - H5AC_set() - * - H5AC_mark_pinned_entry_dirty() - * - H5AC_mark_pinned_or_protected_entry_dirty() - * H5AC_rename() + * - H5AC_mark_entry_dirty() + * H5AC_move_entry() * - H5AC_pin_protected_entry() * - H5AC_protect() * - H5AC_unpin_entry() * - H5AC_unprotect() * - H5AC_set_cache_auto_resize_config() * - H5AC_expunge_entry() - * - H5AC_resize_pinned_entry() + * - H5AC_resize_entry() * * This test is skipped if H5_METADATA_TRACE_FILE is undefined. * @@ -5387,7 +5266,7 @@ smoke_check_5(void) * * JRM -- 7/11/06 * Updated for H5AC_expunge_entry() and - * H5AC_resize_pinned_entry(). + * H5AC_resize_entry(). * *****************************************************************************/ @@ -5408,7 +5287,7 @@ trace_file_check(void) "H5AC_set 0x4 15 0x0 4 0\n", "H5AC_set 0x8 15 0x0 6 0\n", "H5AC_protect 0 15 H5AC_WRITE 2 1\n", - "H5AC_mark_pinned_or_protected_entry_dirty 0 0\n", + "H5AC_mark_entry_dirty 0 0\n", "H5AC_unprotect 0 15 0 0 0\n", "H5AC_protect 2 15 H5AC_WRITE 2 1\n", "H5AC_pin_protected_entry 2 0\n", @@ -5418,12 +5297,12 @@ trace_file_check(void) "H5AC_protect 4 15 H5AC_WRITE 4 1\n", "H5AC_pin_protected_entry 4 0\n", "H5AC_unprotect 4 15 0 0 0\n", - "H5AC_mark_pinned_entry_dirty 0x4 0 0 0\n", - "H5AC_resize_pinned_entry 0x4 2 0\n", - "H5AC_resize_pinned_entry 0x4 4 0\n", + "H5AC_mark_entry_dirty 0x4 0 0 0\n", + "H5AC_resize_entry 0x4 2 0\n", + "H5AC_resize_entry 0x4 4 0\n", "H5AC_unpin_entry 4 0\n", - "H5AC_rename 0 8a65 15 0\n", - "H5AC_rename 8a65 0 15 0\n", + "H5AC_move_entry 0 8a65 15 0\n", + "H5AC_move_entry 8a65 0 15 0\n", "H5AC_flush 0\n", NULL }; @@ -5498,7 +5377,7 @@ trace_file_check(void) strcpy(config.trace_file_name, "t_cache_trace.txt"); if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { nerrors++; HDfprintf(stdout, @@ -5513,27 +5392,27 @@ trace_file_check(void) insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET); insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET); - lock_entry(cache_ptr, file_ptr, 0); - mark_pinned_or_protected_entry_dirty(0); - unlock_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET); + lock_entry(file_ptr, 0); + mark_entry_dirty(0); + unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET); - lock_entry(cache_ptr, file_ptr, 1); + lock_entry(file_ptr, 1); pin_protected_entry(1, TRUE); - unlock_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET); - unpin_entry(cache_ptr, file_ptr, 1, TRUE, FALSE, FALSE); + unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET); + unpin_entry(file_ptr, 1, TRUE, FALSE, FALSE); - expunge_entry(cache_ptr,file_ptr, 1); + expunge_entry(file_ptr, 1); - lock_entry(cache_ptr, file_ptr, 2); + lock_entry(file_ptr, 2); pin_protected_entry(2, TRUE); - unlock_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET); - mark_pinned_entry_dirty(2, FALSE, 0); + unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET); + mark_entry_dirty(2); resize_entry(2, data[2].len / 2); resize_entry(2, data[2].len); - unpin_entry(cache_ptr, file_ptr, 2, TRUE, FALSE, FALSE); + unpin_entry(file_ptr, 2, TRUE, FALSE, FALSE); - rename_entry(cache_ptr, file_ptr, 0, 20); - rename_entry(cache_ptr, file_ptr, 0, 20); + move_entry(file_ptr, 0, 20); + move_entry(file_ptr, 0, 20); if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; @@ -5562,7 +5441,7 @@ trace_file_check(void) config.trace_file_name[0] = '\0'; if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config) - != SUCCEED ) { + != SUCCEED ) { nerrors++; HDfprintf(stdout, diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 0000000..8c6e41f --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# If testing was NOT enabled, then we need to build the tools library +# -------------------------------------------------------------------- +IF (NOT BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) +ENDIF (NOT BUILD_TESTING) + +#-- Add the h5diff and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) + +#-- Add the h5ls executable +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5ls) + +#-- Misc Executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/misc) + +#-- Add the h5import and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5import) + +#-- h5Repack executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5repack) + +#-- Add the h5dump and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5jam) + +#-- Add the h5copy and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5copy) + +#-- Add the h5stat and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5stat) + +#-- Add the h5dump and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5dump) diff --git a/tools/Makefile.in b/tools/Makefile.in index 2dc3fd3..e29c0ac 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -200,12 +200,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt new file mode 100644 index 0000000..61f5ef3 --- /dev/null +++ b/tools/h5copy/CMakeLists.txt @@ -0,0 +1,249 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5COPY) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5copy and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) +H5_NAMING (h5copy) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5copy + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5copy) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) + H5_NAMING (h5copygentest) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (h5copygentest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5copygentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + #h5copygentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + h5copy_extlinks_src.out.ls + h5copy_ref.out.ls + h5copytst.out.ls + ) + SET (HDF5_REFERENCE_TEST_FILES + h5copy_extlinks_src.h5 + h5copy_extlinks_trg.h5 + h5copy_ref.h5 + h5copytst.h5 + ) + + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + FOREACH (ls_file ${HDF5_REFERENCE_FILES}) + SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${ls_file}") + #MESSAGE (STATUS " Translating ${ls_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5copy + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${ls_file} ${lsdest} -l3 + ) + ENDFOREACH (ls_file ${HDF5_REFERENCE_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5copy + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + # Test files + SET (HDF_FILE1 h5copytst) + SET (HDF_FILE2 h5copy_ref) + SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) + SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) + + MACRO (ADD_H5_TEST testname resultcode testfile vparam srcname dstname) + + IF (NOT "${ARGN}" STREQUAL "") + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $ -f ${ARGN} -i ./testfiles/${testfile}.h5 -o ./testfiles/${testfile}.out.h5 -${vparam} -s ${srcname} -d ${dstname} + ) + ELSE (NOT "${ARGN}" STREQUAL "") + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $ -i ./testfiles/${testfile}.h5 -o ./testfiles/${testfile}.out.h5 -${vparam} -s ${srcname} -d ${dstname} + ) + ENDIF (NOT "${ARGN}" STREQUAL "") + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY-DIFF_${testname} + COMMAND $ -q ./testfiles/${testfile}.h5 ./testfiles/${testfile}.out.h5 ${srcname} ${dstname} + ) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-DIFF_${testname} PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST testname resultcode testfile vparam srcname dstname) + + + MACRO (ADD_H5LS_TEST file) + ADD_TEST ( + NAME H5COPY-H5LS_${file} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${file}.out.out" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=./testfiles/${file}.out.ls" + -D "TEST_MASK=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5LS_TEST file) + +############# COPY OBJECTS ############## + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${HDF_FILE1}.out.h5 + ./testfiles/${HDF_FILE1}.out.out + ) + + # "Test copying various forms of datasets" + ADD_H5_TEST (simple 0 ${HDF_FILE1} v simple simple) + ADD_H5_TEST (chunk 0 ${HDF_FILE1} v chunk chunk) + ADD_H5_TEST (compact 0 ${HDF_FILE1} v compact compact) + ADD_H5_TEST (compound 0 ${HDF_FILE1} v compound compound) + ADD_H5_TEST (compressed 0 ${HDF_FILE1} v compressed compressed) + ADD_H5_TEST (named_vl 0 ${HDF_FILE1} v named_vl named_vl) + ADD_H5_TEST (nested_vl 0 ${HDF_FILE1} v nested_vl nested_vl) + + # "Test copying dataset within group in source file to root of destination" + ADD_H5_TEST (simple_top 0 ${HDF_FILE1} v grp_dsets/simple simple_top) + + # "Test copying & renaming dataset" + ADD_H5_TEST (rename 0 ${HDF_FILE1} v compound rename) + + # "Test copying empty, 'full' & 'nested' groups" + ADD_H5_TEST (grp_empty 0 ${HDF_FILE1} v grp_empty grp_empty) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1} v grp_dsets grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1} v grp_nested grp_nested) + + # "Test copying dataset within group in source file to group in destination" + ADD_H5_TEST (simple_group 0 ${HDF_FILE1} v /grp_dsets/simple /grp_dsets/simple_group) + + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 1 ${HDF_FILE1} v grp_dsets grp_rename) + + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST (grp_dsets_rename 1 ${HDF_FILE1} v grp_dsets /grp_rename/grp_dsets) + + # "Test copying objects into group hier. that doesn't exist yet in destination file" + ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1} vp simple /A/B1/simple) + ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1} vp simple /A/B2/simple2) + ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1} vp /grp_dsets/simple /C/D/simple) + ADD_H5_TEST (E_F_grp_dsets 1 ${HDF_FILE1} vp /grp_dsets /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 1 ${HDF_FILE1} vp /grp_nested /G/H/grp_nested) + + # Verify that the file created above is correct + ADD_H5LS_TEST (${HDF_FILE1}) + +############# COPY REFERENCES ############## + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-refs + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${HDF_FILE2}.out.h5 + ./testfiles/${HDF_FILE2}.out.out + ) + + # "Test copying object and region references" + ADD_H5_TEST (region_ref 2 ${HDF_FILE2} v / /COPY ref) + + # Verify that the file created above is correct + ADD_H5LS_TEST (${HDF_FILE2}) + +############# COPY EXT LINKS ############## + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-ext-links + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 + ./testfiles/${HDF_EXT_SRC_FILE}.out.out + ) + + # "Test copying external link directly without -f ext" + ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_dset /copy1_dset) + + # "Test copying external link directly with -f ext" + ADD_H5_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_dset /copy2_dset ext) + + # "Test copying dangling external link (no obj) directly without -f ext" + ADD_H5_TEST (ext_dangle_noobj 0 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet1 /copy_dangle1_1) + + # "Test copying dangling external link (no obj) directly with -f ext" + ADD_H5_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet1 /copy_dangle1_2 ext) + + # "Test copying dangling external link (no file) directly without -f ext" + ADD_H5_TEST (ext_dangle_nofile 0 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet2 /copy_dangle2_1) + + # "Test copying dangling external link (no file) directly with -f ext" + ADD_H5_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet2 /copy_dangle2_2 ext) + + # "Test copying a group contains external links without -f ext" + ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE} v /group_ext /copy1_group) + + # "Test copying a group contains external links with -f ext" + ADD_H5_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE} v /group_ext /copy2_group ext) + + # Verify that the file created above is correct + ADD_H5LS_TEST (${HDF_EXT_SRC_FILE}) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5copy + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 48052b3..0ac4799 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -192,12 +192,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 0ea8e16..89cb5fb 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -19,8 +19,8 @@ #include #include -const char *progname="h5copy"; -int d_status; +/* Name of tool */ +#define PROGRAMNAME "h5copy" /* command-line options: short and long-named parameters */ static const char *s_opts = "d:f:hi:o:ps:vV"; @@ -176,7 +176,7 @@ static int parse_flag(const char* str_flag, unsigned *flag) } else { - error_msg(progname, "Error in input flag\n"); + error_msg("Error in input flag\n"); return -1; } @@ -216,7 +216,9 @@ main (int argc, const char *argv[]) int li_ret; h5tool_link_info_t linkinfo; - /* initialize h5tools lib */ + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); +/* initialize h5tools lib */ h5tools_init(); /* Check for no command line parameters */ @@ -266,7 +268,7 @@ main (int argc, const char *argv[]) break; case 'V': - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); break; @@ -286,28 +288,28 @@ main (int argc, const char *argv[]) if (fname_src==NULL) { - error_msg(progname, "Input file name missing\n"); + error_msg("Input file name missing\n"); usage(); leave(EXIT_FAILURE); } if (fname_dst==NULL) { - error_msg(progname, "Output file name missing\n"); + error_msg("Output file name missing\n"); usage(); leave(EXIT_FAILURE); } if (oname_src==NULL) { - error_msg(progname, "Source object name missing\n"); + error_msg("Source object name missing\n"); usage(); leave(EXIT_FAILURE); } if (oname_dst==NULL) { - error_msg(progname, "Destination object name missing\n"); + error_msg("Destination object name missing\n"); usage(); leave(EXIT_FAILURE); } @@ -324,7 +326,7 @@ main (int argc, const char *argv[]) *-------------------------------------------------------------------------*/ if (fid_src==-1) { - error_msg(progname, "Could not open input file <%s>...Exiting\n", fname_src); + error_msg("Could not open input file <%s>...Exiting\n", fname_src); if (fname_src) free(fname_src); leave(EXIT_FAILURE); @@ -347,7 +349,7 @@ main (int argc, const char *argv[]) *-------------------------------------------------------------------------*/ if (fid_dst==-1) { - error_msg(progname, "Could not open output file <%s>...Exiting\n", fname_dst); + error_msg("Could not open output file <%s>...Exiting\n", fname_dst); if (fname_src) free(fname_src); if (fname_dst) @@ -388,7 +390,7 @@ main (int argc, const char *argv[]) /* Create link creation property list */ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { - error_msg(progname, "Could not create link creation property list\n"); + error_msg("Could not create link creation property list\n"); goto error; } /* end if */ @@ -396,13 +398,13 @@ main (int argc, const char *argv[]) if(parents) { /* Set the intermediate group creation property */ if(H5Pset_create_intermediate_group(lcpl_id, 1) < 0) { - error_msg(progname, "Could not set property for creating parent groups\n"); + error_msg("Could not set property for creating parent groups\n"); goto error; } /* end if */ /* Display some output if requested */ if(verbose) - printf("%s: Creating parent groups\n", progname); + printf("%s: Creating parent groups\n", h5tools_getprogname()); } /* end if */ /*------------------------------------------------------------------------- diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index e52b700..26a2588 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -21,6 +21,9 @@ #include "H5private.h" #include "h5tools.h" +/* Name of tool */ +#define PROGRAMNAME "h5copygentest" + /* HDF file names */ #define HDF_FILE1 "h5copytst.h5" #define HDF_FILE1_NEW "h5copytst_new.h5" @@ -420,6 +423,10 @@ static herr_t gen_obj_ref(hid_t loc_id) hsize_t dims2[1]={2}; int data[3] = {10,20,30}; int status; + /*--------------------- + * create obj references to the previously created objects. + * Passing -1 as reference is an object.*/ + hobj_ref_t or_data[2]; /* write buffer */ herr_t ret = SUCCEED; /*-------------- @@ -462,11 +469,6 @@ static herr_t gen_obj_ref(hid_t loc_id) } H5Gclose(oid); - /*--------------------- - * create obj references to the previously created objects. - * Passing -1 as reference is an object.*/ - hobj_ref_t or_data[2]; /* write buffer */ - status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, -1); if (status < 0) { @@ -914,6 +916,9 @@ out: int main(void) { + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + Test_Obj_Copy(); Test_Ref_Copy(); Test_Extlink_Copy(); diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index ad731b6..029caf9 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -41,6 +41,7 @@ DIFF='diff -c' nerrors=0 verbose=yes +h5haveexitcode=yes # default is yes # The build (current) directory might be different than the source directory. if test -z "$srcdir"; then @@ -51,6 +52,13 @@ OUTDIR=./testfiles test -d $OUTDIR || mkdir $OUTDIR +# RUNSERIAL is used. Check if it can return exit code from executalbe correctly. +if [ -n "$RUNSERIAL_NOEXITCODE" ]; then + echo "***Warning*** Serial Exit Code is not passed back to shell corretly." + echo "***Warning*** Exit code checking is skipped." + h5haveexitcode=no +fi + # Print a "SKIP" message SKIP() { TESTING $H5COPY $@ @@ -200,7 +208,7 @@ H5DIFFTEST_FAIL() $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? - if [ $RET != 1 ] ; then + if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt new file mode 100644 index 0000000..9461875 --- /dev/null +++ b/tools/h5diff/CMakeLists.txt @@ -0,0 +1,674 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5DIFF) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5diff and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5diff + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c +) +H5_NAMING (h5diff) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5diff + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5diff) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + H5_NAMING (h5diffgentest) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (h5diffgentest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5diffgentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5diffgentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + h5diff_10.txt + h5diff_100.txt + #h5diff_101.txt + #h5diff_102.txt + h5diff_11.txt + h5diff_12.txt + h5diff_13.txt + h5diff_14.txt + h5diff_15.txt + h5diff_16_1.txt + h5diff_16_2.txt + h5diff_16_3.txt + h5diff_17.txt + h5diff_171.txt + h5diff_172.txt + h5diff_18_1.txt + h5diff_18.txt + h5diff_20.txt + h5diff_200.txt + h5diff_201.txt + h5diff_202.txt + h5diff_203.txt + h5diff_204.txt + h5diff_205.txt + h5diff_206.txt + h5diff_207.txt + h5diff_21.txt + h5diff_22.txt + h5diff_23.txt + h5diff_24.txt + h5diff_25.txt + h5diff_26.txt + h5diff_27.txt + h5diff_28.txt + h5diff_300.txt + h5diff_400.txt + h5diff_401.txt + h5diff_402.txt + h5diff_403.txt + h5diff_404.txt + h5diff_405.txt + h5diff_406.txt + h5diff_407.txt + h5diff_408.txt + h5diff_409.txt + h5diff_410.txt + h5diff_411.txt + h5diff_412.txt + h5diff_413.txt + h5diff_414.txt + h5diff_415.txt + h5diff_416.txt + h5diff_417.txt + h5diff_418.txt + h5diff_419.txt + h5diff_420.txt + h5diff_421.txt + h5diff_422.txt + h5diff_423.txt + h5diff_424.txt + h5diff_425.txt + h5diff_450.txt + h5diff_451.txt + h5diff_452.txt + h5diff_453.txt + h5diff_454.txt + h5diff_455.txt + h5diff_456.txt + h5diff_457.txt + h5diff_458.txt + h5diff_459.txt + h5diff_50.txt + h5diff_51.txt + h5diff_52.txt + h5diff_53.txt + h5diff_54.txt + h5diff_55.txt + h5diff_56.txt + h5diff_57.txt + h5diff_58.txt + h5diff_600.txt + h5diff_603.txt + h5diff_604.txt + h5diff_605.txt + h5diff_606.txt + h5diff_607.txt + h5diff_608.txt + h5diff_609.txt + h5diff_610.txt + h5diff_612.txt + h5diff_613.txt + h5diff_614.txt + h5diff_615.txt + h5diff_616.txt + h5diff_617.txt + h5diff_618.txt + h5diff_619.txt + h5diff_621.txt + h5diff_622.txt + h5diff_623.txt + h5diff_624.txt + h5diff_625.txt + h5diff_626.txt + h5diff_627.txt + h5diff_628.txt + h5diff_629.txt + h5diff_70.txt + h5diff_80.txt + h5diff_90.txt + ) + SET (HDF5_REFERENCE_TEST_FILES + h5diff_basic1.h5 + h5diff_basic2.h5 + h5diff_types.h5 + h5diff_dtypes.h5 + h5diff_attr1.h5 + h5diff_attr2.h5 + h5diff_dset1.h5 + h5diff_dset2.h5 + h5diff_hyper1.h5 + h5diff_hyper2.h5 + h5diff_empty.h5 + h5diff_links.h5 + h5diff_softlinks.h5 + h5diff_linked_softlink.h5 + h5diff_extlink_src.h5 + h5diff_extlink_trg.h5 + h5diff_ext2softlink_src.h5 + h5diff_ext2softlink_trg.h5 + h5diff_danglelinks1.h5 + h5diff_danglelinks2.h5 + ) + + FOREACH (txt_file ${HDF5_REFERENCE_FILES}) + SET (txtdest "${PROJECT_BINARY_DIR}/${txt_file}") + #MESSAGE (STATUS " Translating ${txt_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${txt_file} ${txtdest} + ) + ENDFOREACH (txt_file ${HDF5_REFERENCE_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + IF (WIN32) + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/h5diff_101.txt + ) + + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/h5diff_102.txt + ) + ELSE (WIN32) + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt ${PROJECT_BINARY_DIR}/h5diff_101.txt + ) + + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt ${PROJECT_BINARY_DIR}/h5diff_102.txt + ) + ENDIF (WIN32) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5DIFF-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + + +############################################################################### +## test file names +############################################################################### + +SET (FILE1 h5diff_basic1.h5) +SET (FILE2 h5diff_basic2.h5) +SET (FILE3 h5diff_types.h5) +SET (FILE4 h5diff_dtypes.h5) +SET (FILE5 h5diff_attr1.h5) +SET (FILE6 h5diff_attr2.h5) +SET (FILE7 h5diff_dset1.h5) +SET (FILE8 h5diff_dset2.h5) +SET (FILE9 h5diff_hyper1.h5) +SET (FILE10 h5diff_hyper2.h5) +SET (FILE11 h5diff_empty.h5) +SET (FILE12 h5diff_links.h5) +SET (FILE13 h5diff_softlinks.h5) +SET (FILE14 h5diff_linked_softlink.h5) +SET (FILE15 h5diff_extlink_src.h5) +SET (FILE16 h5diff_extlink_trg.h5) +SET (FILE17 h5diff_ext2softlink_src.h5) +SET (FILE18 h5diff_ext2softlink_trg.h5) +SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) +SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + +# ############################################################################ +# # Common usage +# ############################################################################ + +# 1.0 +ADD_H5_TEST (h5diff_10 0 -h) + +# 1.1 normal mode +ADD_H5_TEST (h5diff_11 1 ${FILE1} ${FILE2}) + +# 1.2 normal mode with objects +ADD_H5_TEST (h5diff_12 1 ${FILE1} ${FILE2} g1/dset1 g1/dset2) + +# 1.3 report mode +ADD_H5_TEST (h5diff_13 1 -r ${FILE1} ${FILE2}) + +# 1.4 report mode with objects +ADD_H5_TEST (h5diff_14 1 -r ${FILE1} ${FILE2} g1/dset1 g1/dset2) + +# 1.5 with -d +ADD_H5_TEST (h5diff_15 1 --report --delta=5 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 1.6.1 with -p (int) +ADD_H5_TEST (h5diff_16_1 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset5 g1/dset6) + +# 1.6.2 with -p (unsigned long_long) +ADD_H5_TEST (h5diff_16_2 1 --verbose --relative=0.02 ${FILE1} ${FILE1} g1/dset7 g1/dset8) + +# 1.6.3 with -p (double) +ADD_H5_TEST (h5diff_16_3 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset9 g1/dset10) + +# 1.7 verbose mode +ADD_H5_TEST (h5diff_17 1 -v ${FILE1} ${FILE2}) + +# 1.7 test 32-bit INFINITY +ADD_H5_TEST (h5diff_171 0 -v ${FILE1} ${FILE1} /g1/fp19) + +# 1.7 test 64-bit INFINITY +ADD_H5_TEST (h5diff_172 0 -v ${FILE1} ${FILE1} /g1/fp20) + +# 1.8 quiet mode +ADD_H5_TEST (h5diff_18 1 -q ${FILE1} ${FILE2}) + +# 1.8 -v and -q +ADD_H5_TEST (h5diff_18_1 2 -v -q ${FILE1} ${FILE2}) + + +# ############################################################################## +# # not comparable types +# ############################################################################## + +# 2.0 +ADD_H5_TEST (h5diff_20 0 -v ${FILE3} ${FILE3} dset g1) + +# 2.1 +ADD_H5_TEST (h5diff_21 0 -v ${FILE3} ${FILE3} dset l1) + +# 2.2 +ADD_H5_TEST (h5diff_22 0 -v ${FILE3} ${FILE3} dset t1) + +# ############################################################################## +# # compare groups, types, links (no differences and differences) +# ############################################################################## + +# 2.3 +ADD_H5_TEST (h5diff_23 0 -v ${FILE3} ${FILE3} g1 g1) + +# 2.4 +ADD_H5_TEST (h5diff_24 0 -v ${FILE3} ${FILE3} t1 t1) + +# 2.5 +ADD_H5_TEST (h5diff_25 0 -v ${FILE3} ${FILE3} l1 l1) + +# 2.6 +ADD_H5_TEST (h5diff_26 1 -v ${FILE3} ${FILE3} g1 g2) + +# 2.7 +ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2) + +# 2.8 +ADD_H5_TEST (h5diff_28 1 -v ${FILE3} ${FILE3} l1 l2) + + + +# ############################################################################## +# # Dataset datatypes +# ############################################################################## + +# 5.0 +ADD_H5_TEST (h5diff_50 1 -v ${FILE4} ${FILE4} dset0a dset0b) + +# 5.1 +ADD_H5_TEST (h5diff_51 1 -v ${FILE4} ${FILE4} dset1a dset1b) + +# 5.2 +ADD_H5_TEST (h5diff_52 1 -v ${FILE4} ${FILE4} dset2a dset2b) + +# 5.3 +ADD_H5_TEST (h5diff_53 1 -v ${FILE4} ${FILE4} dset3a dset4b) + +# 5.4 +ADD_H5_TEST (h5diff_54 1 -v ${FILE4} ${FILE4} dset4a dset4b) + +# 5.5 +ADD_H5_TEST (h5diff_55 1 -v ${FILE4} ${FILE4} dset5a dset5b) + +# 5.6 +ADD_H5_TEST (h5diff_56 1 -v ${FILE4} ${FILE4} dset6a dset6b) + +# 5.7 +ADD_H5_TEST (h5diff_57 0 -v ${FILE4} ${FILE4} dset7a dset7b) + +# 5.8 (region reference) +ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) + +# ############################################################################## +# # Error messages +# ############################################################################## + + +# 6.0: Check if the command line number of arguments is less than 3 +ADD_H5_TEST (h5diff_600 1 ${FILE1}) + + +# ############################################################################## +# # -d +# ############################################################################## + + +# 6.3: negative value +ADD_H5_TEST (h5diff_603 1 -d -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.4: zero +ADD_H5_TEST (h5diff_604 1 -d 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.5: non number +ADD_H5_TEST (h5diff_605 1 -d u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.6: hexadecimal +ADD_H5_TEST (h5diff_606 1 -d 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.7: string +ADD_H5_TEST (h5diff_607 1 -d "1" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.8: use system epsilon +ADD_H5_TEST (h5diff_608 1 --use-system-epsilon ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.9: number larger than biggest difference +ADD_H5_TEST (h5diff_609 0 -d 200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.10: number smaller than smallest difference +ADD_H5_TEST (h5diff_610 1 -d 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# ############################################################################## +# # -p +# ############################################################################## + +# 6.12: negative value +ADD_H5_TEST (h5diff_612 1 -p -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.13: zero +ADD_H5_TEST (h5diff_613 1 -p 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.14: non number +ADD_H5_TEST (h5diff_614 1 -p u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.15: hexadecimal +ADD_H5_TEST (h5diff_615 1 -p 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.16: string +ADD_H5_TEST (h5diff_616 1 -p "0.21" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.17: repeated option +ADD_H5_TEST (h5diff_617 1 -p 0.21 -p 0.22 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.18: number larger than biggest difference +ADD_H5_TEST (h5diff_618 0 -p 2 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.19: number smaller than smallest difference +ADD_H5_TEST (h5diff_619 1 -p 0.005 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + + +# ############################################################################## +# # -n +# ############################################################################## + +# 6.21: negative value +ADD_H5_TEST (h5diff_621 1 -n -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.22: zero +ADD_H5_TEST (h5diff_622 1 -n 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.23: non number +ADD_H5_TEST (h5diff_623 1 -n u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.24: hexadecimal +ADD_H5_TEST (h5diff_624 1 -n 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.25: string +ADD_H5_TEST (h5diff_625 1 -n "2" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.26: repeated option +ADD_H5_TEST (h5diff_626 1 -n 2 -n 3 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.27: number larger than biggest difference +ADD_H5_TEST (h5diff_627 1 --count=200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.28: number smaller than smallest difference +ADD_H5_TEST (h5diff_628 1 -n 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# Disabling this test as it hangs - LRK 20090618 +# 6.29 non valid files +#ADD_H5_TEST (h5diff_629 2 file1.h6 file2.h6) + +# ############################################################################## +# 7. attributes +# ############################################################################## +ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) + +# ############################################################################## +# 8. all dataset datatypes +# ############################################################################## +ADD_H5_TEST (h5diff_80 1 -v ${FILE7} ${FILE8}) + +# 9. compare a file with itself +ADD_H5_TEST (h5diff_90 0 -v ${FILE2} ${FILE2}) + +# 10. read by hyperslab, print indexes +#if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then +# # skip this test which sometimes hangs in some THG machines +# MESSAGE (STATUS "SKIP -v ${FILE9} ${FILE10}) +#else +# ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) +#fi + +# 11. floating point comparison +ADD_H5_TEST (h5diff_101 1 -v ${FILE1} ${FILE1} g1/d1 g1/d2) + +ADD_H5_TEST (h5diff_102 1 -v ${FILE1} ${FILE1} g1/fp1 g1/fp2) + + +# not comparable -c flag +ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2) + +ADD_H5_TEST (h5diff_201 0 -c ${FILE2} ${FILE2} g2/dset1 g2/dset2) + +ADD_H5_TEST (h5diff_202 0 -c ${FILE2} ${FILE2} g2/dset2 g2/dset3) + +ADD_H5_TEST (h5diff_203 0 -c ${FILE2} ${FILE2} g2/dset3 g2/dset4) + +ADD_H5_TEST (h5diff_204 0 -c ${FILE2} ${FILE2} g2/dset4 g2/dset5) + +ADD_H5_TEST (h5diff_205 0 -c ${FILE2} ${FILE2} g2/dset5 g2/dset6) + + +# not comparable in compound +ADD_H5_TEST (h5diff_206 0 -c ${FILE2} ${FILE2} g2/dset7 g2/dset8) + +ADD_H5_TEST (h5diff_207 0 -c ${FILE2} ${FILE2} g2/dset8 g2/dset9) + +# ############################################################################## +# # Links compare without --follow-symlinks nor --no-dangling-links +# ############################################################################## +# test for bug1749 +ADD_H5_TEST (h5diff_300 1 -v ${FILE12} ${FILE12} /link_g1 /link_g2) + +# ############################################################################## +# # Links compare with --follow-symlinks Only +# ############################################################################## +# soft links file to file +ADD_H5_TEST (h5diff_400 0 --follow-symlinks -v ${FILE13} ${FILE13}) + +# softlink vs dset" +ADD_H5_TEST (h5diff_401 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset1_1 /target_dset2) + +# dset vs softlink" +ADD_H5_TEST (h5diff_402 1 --follow-symlinks -v ${FILE13} ${FILE13} /target_dset2 /softlink_dset1_1) + +# softlink vs softlink" +ADD_H5_TEST (h5diff_403 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset1_1 /softlink_dset2) + +# extlink vs extlink (FILE)" +ADD_H5_TEST (h5diff_404 0 --follow-symlinks -v ${FILE15} ${FILE15}) + +# extlink vs dset" +ADD_H5_TEST (h5diff_405 1 --follow-symlinks -v ${FILE15} ${FILE16} /ext_link_dset1 /target_group2/x_dset) + +# dset vs extlink" +ADD_H5_TEST (h5diff_406 1 --follow-symlinks -v ${FILE16} ${FILE15} /target_group2/x_dset /ext_link_dset1) + +# extlink vs extlink" +ADD_H5_TEST (h5diff_407 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_dset2) + +# softlink vs extlink" +ADD_H5_TEST (h5diff_408 1 --follow-symlinks -v ${FILE13} ${FILE15} /softlink_dset1_1 /ext_link_dset2) + +# extlink vs softlink " +ADD_H5_TEST (h5diff_409 1 --follow-symlinks -v ${FILE15} ${FILE13} /ext_link_dset2 /softlink_dset1_1) + +# linked_softlink vs linked_softlink (FILE)" +ADD_H5_TEST (h5diff_410 0 --follow-symlinks -v ${FILE14} ${FILE14}) + +# dset2 vs linked_softlink_dset1" +ADD_H5_TEST (h5diff_411 1 --follow-symlinks -v ${FILE14} ${FILE14} /target_dset2 /softlink1_to_slink2) + +# linked_softlink_dset1 vs dset2" +ADD_H5_TEST (h5diff_412 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink1_to_slink2 /target_dset2) + +# linked_softlink_to_dset1 vs linked_softlink_to_dset2" +ADD_H5_TEST (h5diff_413 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink1_to_slink2 /softlink2_to_slink2) + +# group vs linked_softlink_group1" +ADD_H5_TEST (h5diff_414 1 --follow-symlinks -v ${FILE14} ${FILE14} /target_group /softlink3_to_slink2) + +# linked_softlink_group1 vs group" +ADD_H5_TEST (h5diff_415 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /target_group) + +# linked_softlink_to_group1 vs linked_softlink_to_group2" +ADD_H5_TEST (h5diff_416 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) + +# non-exist-softlink vs softlink" +ADD_H5_TEST (h5diff_417 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) + +# softlink vs non-exist-softlink" +ADD_H5_TEST (h5diff_418 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) + +# non-exist-extlink_file vs extlink" +ADD_H5_TEST (h5diff_419 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) + +# exlink vs non-exist-extlink_file" +ADD_H5_TEST (h5diff_420 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) + +# extlink vs non-exist-extlink_obj" +ADD_H5_TEST (h5diff_421 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) + +# non-exist-extlink_obj vs extlink" +ADD_H5_TEST (h5diff_422 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) + +# extlink_to_softlink_to_dset1 vs dset2" +ADD_H5_TEST (h5diff_423 1 --follow-symlinks -v ${FILE17} ${FILE18} /ext_link_to_slink1 /dset2) + +# dset2 vs extlink_to_softlink_to_dset1" +ADD_H5_TEST (h5diff_424 1 --follow-symlinks -v ${FILE18} ${FILE17} /dset2 /ext_link_to_slink1) + +# extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" +ADD_H5_TEST (h5diff_425 1 --follow-symlinks -v ${FILE17} ${FILE17} /ext_link_to_slink1 /ext_link_to_slink2) + + +# ############################################################################## +# # Dangling links compare (--follow-symlinks and --no-dangling-links) +# ############################################################################## +# dangling links --follow-symlinks (FILE to FILE) +ADD_H5_TEST (h5diff_450 1 --follow-symlinks -v ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) + +# dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) +ADD_H5_TEST (h5diff_451 2 --follow-symlinks -v --no-dangling-links ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) + +# try --no-dangling-links without --follow-symlinks options +ADD_H5_TEST (h5diff_452 2 --no-dangling-links ${FILE13} ${FILE13}) + +# dangling link found for soft links (FILE to FILE) +ADD_H5_TEST (h5diff_453 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13}) + +# dangling link found for soft links (obj to obj) +ADD_H5_TEST (h5diff_454 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) + +# dangling link found for soft links (obj to obj) Both dangle links +ADD_H5_TEST (h5diff_455 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) + +# dangling link found for ext links (FILE to FILE) +ADD_H5_TEST (h5diff_456 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15}) + +# dangling link found for ext links (obj to obj). target file exist +ADD_H5_TEST (h5diff_457 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) + +# dangling link found for ext links (obj to obj). target file NOT exist +ADD_H5_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) + +# dangling link found for ext links (obj to obj). Both dangle links +ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5diff + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 5d381ec..32f1a87 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -199,12 +199,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 75e1774..9b6037e 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -23,10 +23,6 @@ static int check_n_input( const char* ); static int check_p_input( const char* ); static int check_d_input( const char* ); - -/* module-scoped variables */ -const char *progname = "h5diff"; - /* * Command-line options: The user can specify short or long-named * parameters. @@ -44,7 +40,7 @@ static struct long_options l_opts[] = { { "nan", no_arg, 'N' }, { "compare", no_arg, 'c' }, { "use-system-epsilon", no_arg, 'e' }, - { "follow-links", no_arg, 'l' }, + { "follow-symlinks", no_arg, 'l' }, { "no-dangling-links", no_arg, 'x' }, { NULL, 0, '\0' } }; @@ -90,7 +86,7 @@ void parse_command_line(int argc, usage(); h5diff_exit(EXIT_SUCCESS); case 'V': - print_version(progname); + print_version(h5tools_getprogname()); h5diff_exit(EXIT_SUCCESS); case 'v': options->m_verbose = 1; @@ -174,7 +170,7 @@ void parse_command_line(int argc, /* check for file names to be processed */ if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { - error_msg(progname, "missing file names\n"); + error_msg("missing file names\n"); usage(); h5diff_exit(EXIT_FAILURE); } @@ -367,7 +363,7 @@ void usage(void) printf(" -r, --report Report mode. Print differences.\n"); printf(" -v, --verbose Verbose mode. Print differences, list of objects.\n"); printf(" -q, --quiet Quiet mode. Do not produce output.\n"); - printf(" --follow-links Follow symbolic links (soft links and external links)\n"); + printf(" --follow-symlinks Follow symbolic links (soft links and external links)\n"); printf(" and compare the links' target objects.\n"); printf(" If symbolic link(s) with the same name exist in the\n"); printf(" files being compared, then determine whether the \n"); @@ -378,13 +374,13 @@ void usage(void) printf(" - If both symbolic links are dangling links, they\n"); printf(" are treated as being the same; by default, h5diff\n"); printf(" returns an exit code of 0. If, however, \n"); - printf(" --no-dangling-links is used with --follow-links, \n"); + printf(" --no-dangling-links is used with --follow-symlinks,\n"); printf(" this situation is treated as an error and h5diff \n"); printf(" returns an exit code of 2.\n"); printf(" - If only one of the two links is a dangling link,\n"); printf(" they are treated as being different and h5diff \n"); printf(" returns an exit code of 1. If, however, \n"); - printf(" --no-dangling-links is used with --follow-links, \n"); + printf(" --no-dangling-links is used with --follow-symlinks,\n"); printf(" this situation is treated as an error and h5diff \n"); printf(" returns an exit code of 2.\n"); printf(" - If both symbolic links point to existing objects,\n"); @@ -392,7 +388,7 @@ void usage(void) printf(" If any symbolic link specified in the call to h5diff\n"); printf(" does not exist, h5diff treats it as an error and\n"); printf(" returns an exit code of 2.\n"); - printf(" --no-dangling-links Must be used with --follow-links option;\n"); + printf(" --no-dangling-links Must be used with --follow-symlinks option;\n"); printf(" otherwise, h5diff shows error message and returns\n"); printf(" an exit code of 2.\n"); printf(" Check for any symbolic links (soft links or external\n"); @@ -439,7 +435,7 @@ void usage(void) printf(" 2) groups: name string difference\n"); printf(" 3) datatypes: the return value of H5Tequal\n"); printf(" 4) links: name string difference of the linked value as default\n"); - printf(" (refer to --follow-links option).\n"); + printf(" (refer to --follow-symlinks option).\n"); printf("\n"); printf(" Exit code:\n"); printf(" 0 if no differences, 1 if differences found, 2 if error\n"); diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h index 2796bd5..5a601df 100644 --- a/tools/h5diff/h5diff_common.h +++ b/tools/h5diff/h5diff_common.h @@ -13,11 +13,25 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -extern unsigned char g_Parallel; -extern int g_nTasks; +#ifndef H5DIFFCOMMON_H__ +#define H5DIFFCOMMON_H__ + +#include "h5tools.h" + +#ifdef __cplusplus +extern "C" { +#endif + +H5TOOLS_DLLVAR unsigned char g_Parallel; +H5TOOLS_DLLVAR int g_nTasks; void usage(void); void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options); void h5diff_exit(int status); void print_info(diff_opt_t* options); +#ifdef __cplusplus +} +#endif + +#endif /* H5DIFFCOMMON_H__ */ diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 8089161..297eb48 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -20,6 +20,9 @@ #include "h5diff_common.h" #include "h5tools_utils.h" +/* Name of tool */ +#define PROGRAMNAME "h5diff" + /*------------------------------------------------------------------------- * Function: main * @@ -68,9 +71,6 @@ */ -/* module-scoped variables */ -int d_status = EXIT_SUCCESS; - int main(int argc, const char *argv[]) { int ret; @@ -81,6 +81,8 @@ int main(int argc, const char *argv[]) hsize_t nfound=0; diff_opt_t options; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); /*------------------------------------------------------------------------- * process the command-line *------------------------------------------------------------------------- diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 60d7f94..6e9b092 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -20,6 +20,9 @@ #include "h5tools.h" +/* Name of tool */ +#define PROGRAMNAME "h5diffgentest" + /*------------------------------------------------------------------------- * Program: h5diffgentest * @@ -117,9 +120,6 @@ static int gen_dataset_idx(const char *file, int format); *------------------------------------------------------------------------- */ -/* module-scoped variables */ -int d_status = EXIT_SUCCESS; - int main(void) { test_basic(FILE1, FILE2, FILE11); @@ -1432,7 +1432,7 @@ static int test_external_links(const char *fname1, const char *fname2) /*----------------------------------------------------------------------- * External Links *------------------------------------------------------------------------*/ - /*-------------- + /*--------------*/ /* source file */ status = H5Lcreate_external(fname2, "/target_group/x_dset", fid1, "ext_link_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 1990138..7a43c73 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -20,6 +20,9 @@ #include #include "h5diff_common.h" +/* Name of tool */ +#define PROGRAMNAME "h5diff" + static void ph5diff_worker(int ); /*------------------------------------------------------------------------- @@ -52,9 +55,6 @@ static void ph5diff_worker(int ); *------------------------------------------------------------------------- */ -/* module-scoped variables */ -int d_status = EXIT_SUCCESS; - int main(int argc, const char *argv[]) { int nID = 0; @@ -64,6 +64,9 @@ int main(int argc, const char *argv[]) const char *objname2 = NULL; diff_opt_t options; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + outBuffOffset = 0; g_Parallel = 1; diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index aeba845..d3ee9a6 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -10,7 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -21,13 +21,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -35,7 +35,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -78,7 +78,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_101w.txt b/tools/h5diff/testfiles/h5diff_101w.txt new file mode 100755 index 0000000..59176a2 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_101w.txt @@ -0,0 +1,10 @@ +dataset: and +size: [3x2] [3x2] +position d1 d2 difference +------------------------------------------------------------ +[ 0 1 ] 1e-009 2e-009 1e-009 +[ 1 0 ] 1e-009 9e-010 1e-010 +[ 1 1 ] 0 1e-009 1e-009 +[ 2 0 ] 1e-009 0 1e-009 +4 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_102w.txt b/tools/h5diff/testfiles/h5diff_102w.txt new file mode 100755 index 0000000..36a254e --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_102w.txt @@ -0,0 +1,10 @@ +dataset: and +size: [3x2] [3x2] +position fp1 fp2 difference +------------------------------------------------------------ +[ 0 1 ] 1e-005 2e-005 1e-005 +[ 1 0 ] 1e-005 9e-006 9.99999e-007 +[ 1 1 ] 0 1e-005 1e-005 +[ 2 0 ] 1e-005 0 1e-005 +4 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_452.txt b/tools/h5diff/testfiles/h5diff_452.txt index 76e4457..05403af 100644 --- a/tools/h5diff/testfiles/h5diff_452.txt +++ b/tools/h5diff/testfiles/h5diff_452.txt @@ -1,2 +1,2 @@ -Error: --no-dangling-links must be used along with --follow-links option. +Error: --no-dangling-links must be used along with --follow-symlinks option. EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt index f76d4d5..cf540ab 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -10,7 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -21,13 +21,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -35,7 +35,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -78,7 +78,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt index a5286df..2f2e93f 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt index ab8039e..3381406 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt index 686ff15..8c6051e 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt index cf779c5..b713c7b 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt index 041bb7b..ee23b90 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt index 923bab5..11e2ce1 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt index 405a211..f87d6db 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt index dc7c83b..4c9da26 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -11,7 +11,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences. -v, --verbose Verbose mode. Print differences, list of objects. -q, --quiet Quiet mode. Do not produce output. - --follow-links Follow symbolic links (soft links and external links) + --follow-symlinks Follow symbolic links (soft links and external links) and compare the links' target objects. If symbolic link(s) with the same name exist in the files being compared, then determine whether the @@ -22,13 +22,13 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] - If both symbolic links are dangling links, they are treated as being the same; by default, h5diff returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If only one of the two links is a dangling link, they are treated as being different and h5diff returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-links, + --no-dangling-links is used with --follow-symlinks, this situation is treated as an error and h5diff returns an exit code of 2. - If both symbolic links point to existing objects, @@ -36,7 +36,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] If any symbolic link specified in the call to h5diff does not exist, h5diff treats it as an error and returns an exit code of 2. - --no-dangling-links Must be used with --follow-links option; + --no-dangling-links Must be used with --follow-symlinks option; otherwise, h5diff shows error message and returns an exit code of 2. Check for any symbolic links (soft links or external @@ -79,7 +79,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] 2) groups: name string difference 3) datatypes: the return value of H5Tequal 4) links: name string difference of the linked value as default - (refer to --follow-links option). + (refer to --follow-symlinks option). Exit code: 0 if no differences, 1 if differences found, 2 if error diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 1ed6f88..12cf0f8 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -26,7 +26,7 @@ # Jonathan Kim: # Improved to use single line # Improved to check exit code (only serial mode, not necessary for parallel) -# Added test 400 - 425 (links with --follow-links option) +# Added test 400 - 425 (links with --follow-symlinks option) # Added test 450 - 459 (dangling links) @@ -69,6 +69,7 @@ DIFF='diff -c' nerrors=0 verbose=yes +h5haveexitcode=yes # default is yes pmode= # default to run h5diff tests mydomainname=`domainname 2>/dev/null` @@ -105,6 +106,13 @@ while [ $# -gt 0 ]; do esac done +# RUNSERIAL is used. Check if it can return exit code from executalbe correctly. +if [ -n "$RUNSERIAL_NOEXITCODE" ]; then + echo "***Warning*** Serial Exit Code is not passed back to shell corretly." + echo "***Warning*** Exit code checking is skipped." + h5haveexitcode=no +fi + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". # @@ -226,7 +234,7 @@ TOOLTEST() { # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in # serial mode, so the test is fullfilled. - if test -z "$pmode"; then + if test $h5haveexitcode = 'yes' -a -z "$pmode"; then echo "EXIT CODE: $EXIT_CODE" >> $actual fi @@ -236,7 +244,7 @@ TOOLTEST() { cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" - elif test -z "$pmode"; then + elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then echo "*FAILED*" echo " Expected result ($expect) differs from actual result ($actual)" nerrors="`expr $nerrors + 1`" @@ -560,91 +568,91 @@ TOOLTEST h5diff_206.txt -c $FILE2 $FILE2 g2/dset7 g2/dset8 TOOLTEST h5diff_207.txt -c $FILE2 $FILE2 g2/dset8 g2/dset9 # ############################################################################## -# # Links compare without --follow-links nor --no-dangling-links +# # Links compare without --follow-symlinks nor --no-dangling-links # ############################################################################## # test for bug1749 TOOLTEST h5diff_300.txt -v $FILE12 $FILE12 /link_g1 /link_g2 # ############################################################################## -# # Links compare with --follow-links Only +# # Links compare with --follow-symlinks Only # ############################################################################## # soft links file to file -TOOLTEST h5diff_400.txt --follow-links -v $FILE13 $FILE13 +TOOLTEST h5diff_400.txt --follow-symlinks -v $FILE13 $FILE13 # softlink vs dset" -TOOLTEST h5diff_401.txt --follow-links -v $FILE13 $FILE13 /softlink_dset1_1 /target_dset2 +TOOLTEST h5diff_401.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset1_1 /target_dset2 # dset vs softlink" -TOOLTEST h5diff_402.txt --follow-links -v $FILE13 $FILE13 /target_dset2 /softlink_dset1_1 +TOOLTEST h5diff_402.txt --follow-symlinks -v $FILE13 $FILE13 /target_dset2 /softlink_dset1_1 # softlink vs softlink" -TOOLTEST h5diff_403.txt --follow-links -v $FILE13 $FILE13 /softlink_dset1_1 /softlink_dset2 +TOOLTEST h5diff_403.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset1_1 /softlink_dset2 # extlink vs extlink (FILE)" -TOOLTEST h5diff_404.txt --follow-links -v $FILE15 $FILE15 +TOOLTEST h5diff_404.txt --follow-symlinks -v $FILE15 $FILE15 # extlink vs dset" -TOOLTEST h5diff_405.txt --follow-links -v $FILE15 $FILE16 /ext_link_dset1 /target_group2/x_dset +TOOLTEST h5diff_405.txt --follow-symlinks -v $FILE15 $FILE16 /ext_link_dset1 /target_group2/x_dset # dset vs extlink" -TOOLTEST h5diff_406.txt --follow-links -v $FILE16 $FILE15 /target_group2/x_dset /ext_link_dset1 +TOOLTEST h5diff_406.txt --follow-symlinks -v $FILE16 $FILE15 /target_group2/x_dset /ext_link_dset1 # extlink vs extlink" -TOOLTEST h5diff_407.txt --follow-links -v $FILE15 $FILE15 /ext_link_dset1 /ext_link_dset2 +TOOLTEST h5diff_407.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset1 /ext_link_dset2 # softlink vs extlink" -TOOLTEST h5diff_408.txt --follow-links -v $FILE13 $FILE15 /softlink_dset1_1 /ext_link_dset2 +TOOLTEST h5diff_408.txt --follow-symlinks -v $FILE13 $FILE15 /softlink_dset1_1 /ext_link_dset2 # extlink vs softlink " -TOOLTEST h5diff_409.txt --follow-links -v $FILE15 $FILE13 /ext_link_dset2 /softlink_dset1_1 +TOOLTEST h5diff_409.txt --follow-symlinks -v $FILE15 $FILE13 /ext_link_dset2 /softlink_dset1_1 # linked_softlink vs linked_softlink (FILE)" -TOOLTEST h5diff_410.txt --follow-links -v $FILE14 $FILE14 +TOOLTEST h5diff_410.txt --follow-symlinks -v $FILE14 $FILE14 # dset2 vs linked_softlink_dset1" -TOOLTEST h5diff_411.txt --follow-links -v $FILE14 $FILE14 /target_dset2 /softlink1_to_slink2 +TOOLTEST h5diff_411.txt --follow-symlinks -v $FILE14 $FILE14 /target_dset2 /softlink1_to_slink2 # linked_softlink_dset1 vs dset2" -TOOLTEST h5diff_412.txt --follow-links -v $FILE14 $FILE14 /softlink1_to_slink2 /target_dset2 +TOOLTEST h5diff_412.txt --follow-symlinks -v $FILE14 $FILE14 /softlink1_to_slink2 /target_dset2 # linked_softlink_to_dset1 vs linked_softlink_to_dset2" -TOOLTEST h5diff_413.txt --follow-links -v $FILE14 $FILE14 /softlink1_to_slink2 /softlink2_to_slink2 +TOOLTEST h5diff_413.txt --follow-symlinks -v $FILE14 $FILE14 /softlink1_to_slink2 /softlink2_to_slink2 # group vs linked_softlink_group1" -TOOLTEST h5diff_414.txt --follow-links -v $FILE14 $FILE14 /target_group /softlink3_to_slink2 +TOOLTEST h5diff_414.txt --follow-symlinks -v $FILE14 $FILE14 /target_group /softlink3_to_slink2 # linked_softlink_group1 vs group" -TOOLTEST h5diff_415.txt --follow-links -v $FILE14 $FILE14 /softlink3_to_slink2 /target_group +TOOLTEST h5diff_415.txt --follow-symlinks -v $FILE14 $FILE14 /softlink3_to_slink2 /target_group # linked_softlink_to_group1 vs linked_softlink_to_group2" -TOOLTEST h5diff_416.txt --follow-links -v $FILE14 $FILE14 /softlink3_to_slink2 /softlink4_to_slink2 +TOOLTEST h5diff_416.txt --follow-symlinks -v $FILE14 $FILE14 /softlink3_to_slink2 /softlink4_to_slink2 # non-exist-softlink vs softlink" -TOOLTEST h5diff_417.txt --follow-links -v $FILE13 $FILE13 /softlink_noexist /softlink_dset2 +TOOLTEST h5diff_417.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_noexist /softlink_dset2 # softlink vs non-exist-softlink" -TOOLTEST h5diff_418.txt --follow-links -v $FILE13 $FILE13 /softlink_dset2 /softlink_noexist +TOOLTEST h5diff_418.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset2 /softlink_noexist # non-exist-extlink_file vs extlink" -TOOLTEST h5diff_419.txt --follow-links -v $FILE15 $FILE15 /ext_link_noexist2 /ext_link_dset2 +TOOLTEST h5diff_419.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_noexist2 /ext_link_dset2 # exlink vs non-exist-extlink_file" -TOOLTEST h5diff_420.txt --follow-links -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist2 +TOOLTEST h5diff_420.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist2 # extlink vs non-exist-extlink_obj" -TOOLTEST h5diff_421.txt --follow-links -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist1 +TOOLTEST h5diff_421.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist1 # non-exist-extlink_obj vs extlink" -TOOLTEST h5diff_422.txt --follow-links -v $FILE15 $FILE15 /ext_link_noexist1 /ext_link_dset2 +TOOLTEST h5diff_422.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_noexist1 /ext_link_dset2 # extlink_to_softlink_to_dset1 vs dset2" -TOOLTEST h5diff_423.txt --follow-links -v $FILE17 $FILE18 /ext_link_to_slink1 /dset2 +TOOLTEST h5diff_423.txt --follow-symlinks -v $FILE17 $FILE18 /ext_link_to_slink1 /dset2 # dset2 vs extlink_to_softlink_to_dset1" -TOOLTEST h5diff_424.txt --follow-links -v $FILE18 $FILE17 /dset2 /ext_link_to_slink1 +TOOLTEST h5diff_424.txt --follow-symlinks -v $FILE18 $FILE17 /dset2 /ext_link_to_slink1 # extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" -TOOLTEST h5diff_425.txt --follow-links -v $FILE17 $FILE17 /ext_link_to_slink1 /ext_link_to_slink2 +TOOLTEST h5diff_425.txt --follow-symlinks -v $FILE17 $FILE17 /ext_link_to_slink1 /ext_link_to_slink2 # ############################################################################## # 19. The comparision for the two datasets between the 2 files should be the same @@ -654,37 +662,37 @@ TOOLTEST h5diff_425.txt --follow-links -v $FILE17 $FILE17 /ext_link_to_slink1 /e TOOLTEST h5diff_idx.txt -v $FILE19 $FILE20 # ############################################################################## -# # Dangling links compare (--follow-links and --no-dangling-links) +# # Dangling links compare (--follow-symlinks and --no-dangling-links) # ############################################################################## -# dangling links --follow-links (FILE to FILE) -TOOLTEST h5diff_450.txt --follow-links -v $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2 +# dangling links --follow-symlinks (FILE to FILE) +TOOLTEST h5diff_450.txt --follow-symlinks -v $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2 -# dangling links --follow-links and --no-dangling-links (FILE to FILE) -TOOLTEST h5diff_451.txt --follow-links -v --no-dangling-links $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2 +# dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) +TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2 -# try --no-dangling-links without --follow-links options +# try --no-dangling-links without --follow-symlinks options TOOLTEST h5diff_452.txt --no-dangling-links $FILE13 $FILE13 # dangling link found for soft links (FILE to FILE) -TOOLTEST h5diff_453.txt --follow-links -v --no-dangling-links $FILE13 $FILE13 +TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 # dangling link found for soft links (obj to obj) -TOOLTEST h5diff_454.txt --follow-links -v --no-dangling-links $FILE13 $FILE13 /softlink_dset2 /softlink_noexist +TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 /softlink_dset2 /softlink_noexist # dangling link found for soft links (obj to obj) Both dangle links -TOOLTEST h5diff_455.txt --follow-links -v --no-dangling-links $FILE13 $FILE13 /softlink_noexist /softlink_noexist +TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 /softlink_noexist /softlink_noexist # dangling link found for ext links (FILE to FILE) -TOOLTEST h5diff_456.txt --follow-links -v --no-dangling-links $FILE15 $FILE15 +TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 # dangling link found for ext links (obj to obj). target file exist -TOOLTEST h5diff_457.txt --follow-links -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist1 +TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist1 # dangling link found for ext links (obj to obj). target file NOT exist -TOOLTEST h5diff_458.txt --follow-links -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist2 +TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist2 # dangling link found for ext links (obj to obj). Both dangle links -TOOLTEST h5diff_459.txt --follow-links -v --no-dangling-links $FILE15 $FILE15 /ext_link_noexist1 /ext_link_noexist2 +TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_noexist1 /ext_link_noexist2 # ############################################################################## diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt new file mode 100644 index 0000000..eb54e00 --- /dev/null +++ b/tools/h5dump/CMakeLists.txt @@ -0,0 +1,628 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5DUMP) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5dump and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c) +H5_NAMING (h5dump) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5dump + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5dump) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + H5_NAMING (h5dumpgentest) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (h5dumpgentest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5dumpgentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5dumpgentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + tall-1.ddl + tall-2.ddl + tall-2A.ddl + tall-2B.ddl + tall-3.ddl + tall-4s.ddl + tall-5s.ddl + tallfilters.ddl + tarray1.ddl + tarray2.ddl + tarray3.ddl + tarray4.ddl + tarray5.ddl + tarray6.ddl + tarray7.ddl + tarray8.ddl + tattr-1.ddl + tattr-2.ddl + tattr-3.ddl + tattrreg.ddl + tattrregR.ddl + tbigdims.ddl + tboot1.ddl + tboot2.ddl + tchar1.ddl + tchunked.ddl + tcomp-1.ddl + tcomp-2.ddl + tcomp-3.ddl + tcomp-4.ddl + tcompact.ddl + tcontents.ddl + tcontiguos.ddl + tdatareg.ddl + tdataregR.ddl + tdeflate.ddl + tdset-1.ddl + tdset-2.ddl + tdset-3s.ddl + tempty.ddl + texternal.ddl + textlinksrc.ddl + textlinkfar.ddl + tfamily.ddl + tfill.ddl + tfletcher32.ddl + tfpformat.ddl + tgroup-1.ddl + tgroup-2.ddl + tgrp_comments.ddl + thlink-1.ddl + thlink-2.ddl + thlink-3.ddl + thlink-4.ddl + thlink-5.ddl + thyperslab.ddl + tindicesno.ddl + tindicessub1.ddl + tindicessub2.ddl + tindicessub3.ddl + tindicessub4.ddl + tindicesyes.ddl + tlarge_objname.ddl + #tldouble.ddl + tlonglinks.ddl + tloop-1.ddl + tmulti.ddl + tnamed_dtype_attr.ddl + tnestcomp-1.ddl + tnbit.ddl + tnofilename.ddl + tnullspace.ddl + tordergr1.ddl + tordergr2.ddl + tordergr3.ddl + tordergr4.ddl + tordergr5.ddl + torderattr1.ddl + torderattr2.ddl + torderattr3.ddl + torderattr4.ddl + tperror.ddl + treference.ddl + tsaf.ddl + tscaleoffset.ddl + tshuffle.ddl + tslink-1.ddl + tslink-2.ddl + tsplit_file.ddl + tstr-1.ddl + tstr-2.ddl + tstring.ddl + tstring2.ddl + tstringe.ddl + tszip.ddl + tudlink-1.ddl + tudlink-2.ddl + tuserfilter.ddl + tvldtypes1.ddl + tvldtypes2.ddl + tvldtypes3.ddl + tvldtypes4.ddl + tvldtypes5.ddl + tvlstr.ddl + tvms.ddl + ) + SET (HDF5_REFERENCE_TEST_FILES + tbin1.ddl + tbin1.ddl + tbin2.ddl + tbin3.ddl + tbin4.ddl + out3.h5import + taindices.h5 + tall.h5 + tarray1.h5 + tarray2.h5 + tarray3.h5 + tarray4.h5 + tarray5.h5 + tarray6.h5 + tarray7.h5 + tarray8.h5 + tattr.h5 + tattr2.h5 + tattrreg.h5 + tbigdims.h5 + tbinary.h5 + tchar.h5 + tcompound.h5 + tcompound_complex.h5 + tdatareg.h5 + tdset.h5 + tempty.h5 + textlinkfar.h5 + textlinksrc.h5 + textlinktar.h5 + tfamily00000.h5 + tfamily00001.h5 + tfamily00002.h5 + tfamily00003.h5 + tfamily00004.h5 + tfamily00005.h5 + tfamily00006.h5 + tfamily00007.h5 + tfamily00008.h5 + tfamily00009.h5 + tfamily00010.h5 + tfcontents1.h5 + tfcontents2.h5 + tfilters.h5 + tfpformat.h5 + tfvalues.h5 + tgroup.h5 + tgrp_comments.h5 + thlink.h5 + thyperslab.h5 + tlarge_objname.h5 + #tldouble.h5 + tlonglinks.h5 + tloop.h5 + tmulti-b.h5 + tmulti-g.h5 + tmulti-l.h5 + tmulti-o.h5 + tmulti-r.h5 + tmulti-s.h5 + tnamed_dtype_attr.h5 + tnestedcomp.h5 + tnullspace.h5 + torderattr.h5 + tordergr.h5 + tsaf.h5 + tslink.h5 + tsplit_file-m.h5 + tsplit_file-r.h5 + tstr.h5 + tstr2.h5 + tstr3.h5 + tudlink.h5 + tvldtypes1.h5 + tvldtypes2.h5 + tvldtypes3.h5 + tvldtypes4.h5 + tvldtypes5.h5 + tvlstr.h5 + tvms.h5 + ) + + FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #MESSAGE (STATUS " Translating ${ddl_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} -l3 + ) + ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/tbin1LE.ddl + ) + + MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) + IF (${testtype} STREQUAL "SKIP") + MESSAGE (STATUS "SKIP ${skipresultfile} ${ARGN}") + ELSE (${testtype} STREQUAL "SKIP") + ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_SKIP_H5_TEST) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + + # Determine which filters are available + SET (USE_FILTER_SZIP H5_HAVE_FILTER_SZIP) + SET (USE_FILTER_DEFLATE H5_HAVE_FILTER_DEFLATE) + SET (USE_FILTER_SHUFFLE H5_HAVE_FILTER_SHUFFLE) + SET (USE_FILTER_FLETCHER32 H5_HAVE_FILTER_FLETCHER32) + SET (USE_FILTER_NBIT H5_HAVE_FILTER_NBIT) + SET (USE_FILTER_SCALEOFFSET H5_HAVE_FILTER_SCALEOFFSET) + +# Determine if H5dump packed bits feature is included + SET (USE_PACKED_BITS HDF5_USE_H5DUMP_PACKED_BITS) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + # test for displaying groups + ADD_H5_TEST (tgroup-1 0 tgroup.h5) + # test for displaying the selected groups + ADD_H5_TEST (tgroup-2 1 --group=/g2 --group / -g /y tgroup.h5) + + # test for displaying simple space datasets + ADD_H5_TEST (tdset-1 0 tdset.h5) + # test for displaying selected datasets + ADD_H5_TEST (tdset-2 1 -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) + + # test for displaying attributes + ADD_H5_TEST (tattr-1 0 tattr.h5) + # test for displaying the selected attributes of string type and scalar space + ADD_H5_TEST (tattr-2 0 -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) + # test for header and error messages + ADD_H5_TEST (tattr-3 1 --header -a /attr2 --attribute=/attr tattr.h5) + # test for displaying attributes in shared datatype (also in group and dataset) + ADD_H5_TEST (tnamed_dtype_attr 0 tnamed_dtype_attr.h5) + + # test for displaying soft links and user-defined links + ADD_H5_TEST (tslink-1 0 tslink.h5) + ADD_H5_TEST (tudlink-1 0 tudlink.h5) + # test for displaying the selected link + ADD_H5_TEST (tslink-2 0 -l slink2 tslink.h5) + ADD_H5_TEST (tudlink-2 0 -l udlink2 tudlink.h5) + + # tests for hard links + ADD_H5_TEST (thlink-1 0 thlink.h5) + ADD_H5_TEST (thlink-2 0 -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5) + ADD_H5_TEST (thlink-3 0 -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5) + ADD_H5_TEST (thlink-4 0 -g /g1 thlink.h5) + ADD_H5_TEST (thlink-5 0 -d /dset1 -g /g2 -d /g1/dset2 thlink.h5) + + # tests for compound data types + ADD_H5_TEST (tcomp-1 0 tcompound.h5) + # test for named data types + ADD_H5_TEST (tcomp-2 0 -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) + # test for unamed type + #ADD_H5_TEST (tcomp-3 0 -t /#6632 -g /group2 tcompound.h5) + # test complicated compound datatype + ADD_H5_TEST (tcomp-4 0 tcompound_complex.h5) + + #test for the nested compound type + ADD_H5_TEST (tnestcomp-1 0 tnestedcomp.h5) + + # test for options + ADD_H5_TEST (tall-1 0 tall.h5) + ADD_H5_TEST (tall-2 0 --header -g /g1/g1.1 -a attr2 tall.h5) + ADD_H5_TEST (tall-3 0 -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) + + # test for loop detection + ADD_H5_TEST (tloop-1 0 tloop.h5) + + # test for string + ADD_H5_TEST (tstr-1 0 tstr.h5) + ADD_H5_TEST (tstr-2 0 tstr2.h5) + + # test for file created by Lib SAF team + ADD_H5_TEST (tsaf 0 tsaf.h5) + + # test for file with variable length data + ADD_H5_TEST (tvldtypes1 0 tvldtypes1.h5) + ADD_H5_TEST (tvldtypes2 0 tvldtypes2.h5) + ADD_H5_TEST (tvldtypes3 0 tvldtypes3.h5) + ADD_H5_TEST (tvldtypes4 0 tvldtypes4.h5) + ADD_H5_TEST (tvldtypes5 0 tvldtypes5.h5) + + #test for file with variable length string data + ADD_H5_TEST (tvlstr 0 tvlstr.h5) + + # test for files with array data + ADD_H5_TEST (tarray1 0 tarray1.h5) + ADD_H5_TEST (tarray2 0 tarray2.h5) + ADD_H5_TEST (tarray3 0 tarray3.h5) + ADD_H5_TEST (tarray4 0 tarray4.h5) + ADD_H5_TEST (tarray5 0 tarray5.h5) + ADD_H5_TEST (tarray6 0 tarray6.h5) + ADD_H5_TEST (tarray7 0 tarray7.h5) + ADD_H5_TEST (tarray8 0 tarray8.h5) + + # test for files with empty data + ADD_H5_TEST (tempty 0 tempty.h5) + + # test for files with groups that have comments + ADD_H5_TEST (tgrp_comments 0 tgrp_comments.h5) + + # test the --filedriver flag + ADD_H5_TEST (tsplit_file 0 --filedriver=split tsplit_file) + ADD_H5_TEST (tfamily 0 --filedriver=family tfamily%05d.h5) + ADD_H5_TEST (tmulti 0 --filedriver=multi tmulti) + + # test for files with group names which reach > 1024 bytes in size + ADD_H5_TEST (tlarge_objname 0 -w157 tlarge_objname.h5) + + # test '-A' to suppress data but print attr's + ADD_H5_TEST (tall-2A 0 -A tall.h5) + + # test '-r' to print attributes in ASCII instead of decimal + ADD_H5_TEST (tall-2B 0 -A -r tall.h5) + + # test Subsetting + ADD_H5_TEST (tall-4s 0 --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5) + ADD_H5_TEST (tall-5s 0 -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5) + ADD_H5_TEST (tdset-3s 0 -d "/dset1[1,1;;;]" tdset.h5) + + # test printing characters in ASCII instead of decimal + ADD_H5_TEST (tchar1 0 -r tchar.h5) + + # test failure handling + # Missing file name + IF (${USE_PACKED_BITS}) + ADD_H5_TEST (tnofilename-with-packed-bits 1) + ELSE (${USE_PACKED_BITS}) + ADD_H5_TEST (tnofilename 1) + ENDIF (${USE_PACKED_BITS}) + + # rev. 2004 + + # tests for super block + ADD_H5_TEST (tboot1 0 -H -B -d dset tfcontents1.h5) + ADD_H5_TEST (tboot2 0 -B tfcontents2.h5) + + # test -p with a non existing dataset + ADD_H5_TEST (tperror 1 -p -d bogus tfcontents1.h5) + + # test for file contents + ADD_H5_TEST (tcontents 0 -n tfcontents1.h5) + + # tests for storage layout + # compact + ADD_H5_TEST (tcompact 0 -H -p -d compact tfilters.h5) + # contiguous + ADD_H5_TEST (tcontiguos 0 -H -p -d contiguous tfilters.h5) + # chunked + ADD_H5_TEST (tchunked 0 -H -p -d chunked tfilters.h5) + # external + ADD_H5_TEST (texternal 0 -H -p -d external tfilters.h5) + + # fill values + ADD_H5_TEST (tfill 0 -p tfvalues.h5) + + # several datatype, with references , print path + ADD_H5_TEST (treference 0 tattr2.h5) + + # escape/not escape non printable characters + ADD_H5_TEST (tstringe 0 -e tstr3.h5) + ADD_H5_TEST (tstring 0 tstr3.h5) + # char data as ASCII with non escape + ADD_H5_TEST (tstring2 0 -r -d str4 tstr3.h5) + + # array indices print/not print + ADD_H5_TEST (tindicesyes 0 taindices.h5) + ADD_H5_TEST (tindicesno 0 -y taindices.h5) + + ########## array indices with subsetting + # 1D case + ADD_H5_TEST (tindicessub1 0 -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5) + + # 2D case + ADD_H5_TEST (tindicessub2 0 -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5) + + # 3D case + ADD_H5_TEST (tindicessub3 0 -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5) + + # 4D case + ADD_H5_TEST (tindicessub4 0 -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5) + + # tests for filters + # SZIP + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP) + ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} -H -p -d szip tfilters.h5) + + # deflate + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} -H -p -d deflate tfilters.h5) + + # shuffle + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} -H -p -d shuffle tfilters.h5) + + # fletcher32 + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} -H -p -d fletcher32 tfilters.h5) + + # nbit + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} -H -p -d nbit tfilters.h5) + + # scaleoffset + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} -H -p -d scaleoffset tfilters.h5) + + # all + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} -H -p -d all tfilters.h5) + + # user defined + ADD_H5_TEST (tuserfilter 0 -H -p -d myfilter tfilters.h5) + + # test for displaying objects with very long names + ADD_H5_TEST (tlonglinks 0 tlonglinks.h5) + + # dimensions over 4GB, print boundary + ADD_H5_TEST (tbigdims 0 -d dset4gb -s 4294967284 -c 22 tbigdims.h5) + + # hyperslab read + ADD_H5_TEST (thyperslab 0 thyperslab.h5) + + # test for displaying dataset and attribute of null space + ADD_H5_TEST (tnullspace 0 tnullspace.h5) + + # test for long double (some systems do not have long double) + #ADD_H5_TEST (tldouble 0 tldouble.h5) + + # test for vms + ADD_H5_TEST (tvms 0 tvms.h5) + + # test for binary output + ADD_H5_TEST (tbin1LE 0 -d integer -o out1LE.bin -b LE tbinary.h5) + + # NATIVE default. the NATIVE test can be validated with h5import/h5diff + ADD_H5_TEST (tbin1 0 -d integer -o out1.bin -b tbinary.h5) + ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove out1.h5) + ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) + ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) + + ADD_H5_TEST (tbin2 0 -b BE -d float -o out2.bin tbinary.h5) + + # the NATIVE test can be validated with h5import/h5diff + ADD_H5_TEST (tbin3 0 -d integer -o out3.bin -b NATIVE tbinary.h5) + ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove out3.h5) + ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) + ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) + + ADD_H5_TEST (tbin4 0 -d double -b FILE -o out4.bin tbinary.h5) + + # Clean up binary output files + IF (NOT HDF5_NOCLEANUP) + ADD_TEST ( + NAME H5DUMP-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + out1.bin + out1LE.bin + out2.bin + out3.bin + out4.bin + out1.h5 + out3.h5 + ) + ENDIF (NOT HDF5_NOCLEANUP) + + # test for dataset region references + ADD_H5_TEST (tdatareg 0 tdatareg.h5) + ADD_H5_TEST (tdataregR 0 -R tdatareg.h5) + ADD_H5_TEST (tattrreg 0 tattrreg.h5) + ADD_H5_TEST (tattrregR 0 -R tattrreg.h5) + + # tests for group creation order + # "1" tracked, "2" name, root tracked + ADD_H5_TEST (tordergr1 0 --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5) + ADD_H5_TEST (tordergr2 0 --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5) + ADD_H5_TEST (tordergr3 0 -g 2 -q name -z ascending tordergr.h5) + ADD_H5_TEST (tordergr4 0 -g 2 -q name -z descending tordergr.h5) + ADD_H5_TEST (tordergr5 0 -q creation_order tordergr.h5) + + # tests for attribute order + ADD_H5_TEST (torderattr1 0 -H --sort_by=name --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr2 0 -H --sort_by=name --sort_order=descending torderattr.h5) + ADD_H5_TEST (torderattr3 0 -H --sort_by=creation_order --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr4 0 -H --sort_by=creation_order --sort_order=descending torderattr.h5) + + # tests for floating point user defined printf format + ADD_H5_TEST (tfpformat 0 -m %.7f tfpformat.h5) + + # tests for traversal of external links + ADD_H5_TEST (textlinksrc 0 textlinksrc.h5) + ADD_H5_TEST (textlinkfar 0 textlinkfar.h5) + + # test for dataset packed bits + SET (TESTTYPE "TEST") + IF (NOT ${USE_PACKED_BITS}) + SET (TESTTYPE "SKIP") + ENDIF (NOT ${USE_PACKED_BITS}) + ADD_SKIP_H5_TEST (tpackedbits 0 ${TESTTYPE} -d /dset1 -M 0,2 tdset.h5) + ADD_SKIP_H5_TEST (tpackedbits2 0 ${TESTTYPE} -d /dset1 -M 0,2,2,1 tdset.h5) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5dump + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 0cb51f8..517608b 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -197,12 +197,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 3156ba6..e4c5231 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -22,9 +22,8 @@ #include "h5tools_ref.h" #include "h5trav.h" - -/* module-scoped variables */ -const char *progname = "h5dump"; +/* Name of tool */ +#define PROGRAMNAME "h5dump" /* Macros for displaying objects */ #define begin_obj(obj,name,begin) \ @@ -68,7 +67,6 @@ typedef struct h5dump_table_list_t { } *tables; } h5dump_table_list_t; -int d_status = EXIT_SUCCESS; static int unamedtype = 0; /* shared datatype with no name */ static h5dump_table_list_t table_list = {0, 0, NULL}; static table_t *group_table = NULL, *dset_table = NULL, *type_table = NULL; @@ -819,7 +817,7 @@ table_list_free(void) for(u = 0; u < table_list.nused; u++) { /* Release object id */ if(H5Idec_ref(table_list.tables[u].oid) < 0) - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); /* Free each table */ free_table(table_list.tables[u].group_table); @@ -881,8 +879,8 @@ print_datatype(hid_t type,unsigned in_group) else printf("\"%s\"", obj->objname); } else { - error_msg(progname, "unknown committed type.\n"); - d_status = EXIT_FAILURE; + error_msg("unknown committed type.\n"); + h5tools_setstatus(EXIT_FAILURE); } } else { switch(H5Tget_class(type)) { @@ -1121,7 +1119,7 @@ print_datatype(hid_t type,unsigned in_group) /* Type doesn't match any of above. */ printf("unknown_one_character_type;\n "); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); done: H5Tclose(str_type); @@ -1151,7 +1149,7 @@ print_datatype(hid_t type,unsigned in_group) printf("H5T_STD_B64LE"); } else { printf("undefined bitfield"); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } break; @@ -1258,7 +1256,7 @@ print_datatype(hid_t type,unsigned in_group) default: printf("unknown datatype"); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); break; } } /* end else */ @@ -1401,11 +1399,11 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo if((attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT)) < 0) { indentation(indent + COL); - error_msg(progname, "unable to open attribute \"%s\"\n", attr_name); + error_msg("unable to open attribute \"%s\"\n", attr_name); indentation(indent); end_obj(dump_header_format->attributeend, dump_header_format->attributeblockend); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else { hid_t type, space; @@ -1477,9 +1475,9 @@ dump_selected_attr(hid_t loc_id, const char *name) /* Open the object with the attribute */ if((oid = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) { indentation(COL); - error_msg(progname, "unable to open object \"%s\"\n", obj_name); + error_msg("unable to open object \"%s\"\n", obj_name); end_obj(dump_header_format->attributeend, dump_header_format->attributeblockend); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); return FAIL; } /* end if */ @@ -1504,14 +1502,14 @@ dump_selected_attr(hid_t loc_id, const char *name) dump_header_format->attributeblockend); } else { indentation(COL); - error_msg(progname, "unable to open attribute \"%s\"\n", obj_name); + error_msg("unable to open attribute \"%s\"\n", obj_name); end_obj(dump_header_format->attributeend, dump_header_format->attributeblockend); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } /* Close object */ if(H5Oclose(oid) < 0) { - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); return FAIL; } /* end if */ @@ -1559,8 +1557,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED /* Stat the object */ if(H5Oget_info_by_name(group, name, &oinfo, H5P_DEFAULT) < 0) { - error_msg(progname, "unable to get object information for \"%s\"\n", name); - d_status = EXIT_FAILURE; + error_msg("unable to get object information for \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; goto done; } /* end if */ @@ -1570,8 +1568,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED case H5O_TYPE_GROUP: if((obj = H5Gopen2(group, name, H5P_DEFAULT)) < 0) { - error_msg(progname, "unable to dump group \"%s\"\n", name); - d_status = EXIT_FAILURE; + error_msg("unable to dump group \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else @@ -1609,13 +1607,13 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED begin_obj(dump_header_format->datasetbegin, name, dump_header_format->datasetblockbegin); indentation(indent + COL); - error_msg(progname, + error_msg(h5tools_getprogname(), "internal error (file %s:line %d)\n", __FILE__, __LINE__); indentation(indent); end_obj(dump_header_format->datasetend, dump_header_format->datasetblockend); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; H5Dclose(obj); goto done; @@ -1678,16 +1676,16 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED dump_function_table->dump_dataset_function(obj, name, NULL); H5Dclose(obj); } else { - error_msg(progname, "unable to dump dataset \"%s\"\n", name); - d_status = EXIT_FAILURE; + error_msg("unable to dump dataset \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } break; case H5O_TYPE_NAMED_DATATYPE: if((obj = H5Topen2(group, name, H5P_DEFAULT)) < 0) { - error_msg(progname, "unable to dump datatype \"%s\"\n", name); - d_status = EXIT_FAILURE; + error_msg("unable to dump datatype \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else { dump_function_table->dump_named_datatype_function(obj, name); @@ -1696,8 +1694,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED break; default: - error_msg(progname, "unknown object \"%s\"\n", name); - d_status = EXIT_FAILURE; + error_msg("unknown object \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } } /* end if */ @@ -1717,8 +1715,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED } if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg(progname, "unable to get link value\n"); - d_status = EXIT_FAILURE; + error_msg("unable to get link value\n"); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else { /* print the value of a soft link */ @@ -1808,8 +1806,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED begin_obj(dump_header_format->extlinkbegin, name, dump_header_format->extlinkblockbegin); if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg(progname, "unable to get external link value\n"); - d_status = EXIT_FAILURE; + error_msg("unable to get external link value\n"); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } /* end if */ else { @@ -1817,8 +1815,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED const char *targname; if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { - error_msg(progname, "unable to unpack external link value\n"); - d_status = EXIT_FAILURE; + error_msg("unable to unpack external link value\n"); + h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } /* end if */ else { @@ -1950,20 +1948,20 @@ dump_named_datatype(hid_t tid, const char *name) if ((tcpl_id = H5Tget_create_plist(tid)) < 0) { - error_msg(progname, "error in getting creation property list ID\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); } /* query the creation properties for attributes */ if (H5Pget_attr_creation_order(tcpl_id, &attr_crt_order_flags) < 0) { - error_msg(progname, "error in getting creation properties\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); } if(H5Pclose(tcpl_id) < 0) { - error_msg(progname, "error in closing creation property list ID\n"); - d_status = EXIT_FAILURE; + error_msg("error in closing creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); } @@ -1982,9 +1980,9 @@ dump_named_datatype(hid_t tid, const char *name) found_obj = search_obj(type_table, oinfo.addr); if (found_obj == NULL) { - error_msg(progname, "internal error (file %s:line %d)\n", + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); goto done; } else if (found_obj->displayed) { @@ -2007,14 +2005,14 @@ dump_named_datatype(hid_t tid, const char *name) if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(tid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end if */ else { if(H5Aiterate2(tid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end else */ @@ -2056,27 +2054,27 @@ dump_group(hid_t gid, const char *name) if ((gcpl_id = H5Gget_create_plist(gid)) < 0) { - error_msg(progname, "error in getting group creation property list ID\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); } /* query the group creation properties for attributes */ if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) { - error_msg(progname, "error in getting group creation properties\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); } /* query the group creation properties */ if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) { - error_msg(progname, "error in getting group creation properties\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); } if(H5Pclose(gcpl_id) < 0) { - error_msg(progname, "error in closing group creation property list ID\n"); - d_status = EXIT_FAILURE; + error_msg("error in closing group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); } @@ -2118,9 +2116,9 @@ dump_group(hid_t gid, const char *name) if (found_obj == NULL) { indentation(indent); - error_msg(progname, "internal error (file %s:line %d)\n", + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } else if (found_obj->displayed) { indentation(indent); @@ -2133,14 +2131,14 @@ dump_group(hid_t gid, const char *name) if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end if */ else { if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end else */ @@ -2164,14 +2162,14 @@ dump_group(hid_t gid, const char *name) if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end if */ else { if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end else */ @@ -2218,15 +2216,15 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) if ((dcpl_id = H5Dget_create_plist(did)) < 0) { - error_msg(progname, "error in getting creation property list ID\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); } /* query the creation properties for attributes */ if (H5Pget_attr_creation_order(dcpl_id, &attr_crt_order_flags) < 0) { - error_msg(progname, "error in getting creation properties\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); } indentation(indent); @@ -2280,14 +2278,14 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(did, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end if */ else { if(H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end else */ @@ -2598,8 +2596,8 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) if (status == FAIL) { indentation(indent + COL); - error_msg(progname, "unable to print data\n"); - d_status = EXIT_FAILURE; + error_msg("unable to print data\n"); + h5tools_setstatus(EXIT_FAILURE); } indentation(indent); @@ -3569,10 +3567,10 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis begin_obj(dump_header_format->datasetbegin, real_name, dump_header_format->datasetblockbegin); indentation(COL); - error_msg(progname, "unable to open dataset \"%s\"\n", real_name); + error_msg("unable to open dataset \"%s\"\n", real_name); end_obj(dump_header_format->datasetend, dump_header_format->datasetblockend); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } return; } /* end if */ @@ -3639,8 +3637,8 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if ( sset->stride[i] < sset->block[i] ) { - error_msg(progname, "wrong subset selection; blocks overlap\n"); - d_status = EXIT_FAILURE; + error_msg("wrong subset selection; blocks overlap\n"); + h5tools_setstatus(EXIT_FAILURE); return; } @@ -3674,13 +3672,13 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis } } else - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } else dump_dataset(dsetid, real_name, sset); if(H5Dclose(dsetid) < 0) - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } /*------------------------------------------------------------------------- @@ -3716,9 +3714,9 @@ handle_groups(hid_t fid, const char *group, void UNUSED * data, int pe, const ch { begin_obj(dump_header_format->groupbegin, real_name, dump_header_format->groupblockbegin); indentation(COL); - error_msg(progname, "unable to open group \"%s\"\n", real_name); + error_msg("unable to open group \"%s\"\n", real_name); end_obj(dump_header_format->groupend, dump_header_format->groupblockend); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } } else @@ -3736,7 +3734,7 @@ handle_groups(hid_t fid, const char *group, void UNUSED * data, int pe, const ch dump_group(gid, real_name); if(H5Gclose(gid) < 0) - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } /* end else */ } /* end handle_groups() */ @@ -3760,11 +3758,11 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co H5L_info_t linfo; if(H5Lget_info(fid, links, &linfo, H5P_DEFAULT) < 0) { - error_msg(progname, "unable to get link info from \"%s\"\n", links); - d_status = EXIT_FAILURE; + error_msg("unable to get link info from \"%s\"\n", links); + h5tools_setstatus(EXIT_FAILURE); } else if(linfo.type == H5L_TYPE_HARD) { - error_msg(progname, "\"%s\" is a hard link\n", links); - d_status = EXIT_FAILURE; + error_msg("\"%s\" is a hard link\n", links); + h5tools_setstatus(EXIT_FAILURE); } else { char *buf = HDmalloc(linfo.u.val_size); @@ -3776,9 +3774,9 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) printf("LINKTARGET \"%s\"\n", buf); else { - error_msg(progname, "h5dump error: unable to get link value for \"%s\"\n", + error_msg("h5dump error: unable to get link value for \"%s\"\n", links); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } end_obj(dump_header_format->softlinkend, dump_header_format->softlinkblockend); @@ -3802,12 +3800,12 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co indentation(COL); printf("TARGETPATH \"%s\"\n", elink_path); } else { - error_msg(progname, "h5dump error: unable to unpack external link value for \"%s\"\n", links); - d_status = EXIT_FAILURE; + error_msg("h5dump error: unable to unpack external link value for \"%s\"\n", links); + h5tools_setstatus(EXIT_FAILURE); } } else { - error_msg(progname, "h5dump error: unable to get external link value for \"%s\"\n", links); - d_status = EXIT_FAILURE; + error_msg("h5dump error: unable to get external link value for \"%s\"\n", links); + h5tools_setstatus(EXIT_FAILURE); } end_obj(dump_header_format->extlinkend, dump_header_format->extlinkblockend); @@ -3883,10 +3881,10 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const begin_obj(dump_header_format->datatypebegin, real_name, dump_header_format->datatypeblockbegin); indentation(COL); - error_msg(progname, "unable to open datatype \"%s\"\n", real_name); + error_msg("unable to open datatype \"%s\"\n", real_name); end_obj(dump_header_format->datatypeend, dump_header_format->datatypeblockend); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } } else @@ -3903,7 +3901,7 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const dump_named_datatype(type_id, real_name); if(H5Tclose(type_id) < 0) - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } } @@ -3935,7 +3933,7 @@ parse_command_line(int argc, const char *argv[]) /* no arguments */ if (argc == 1) { - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } @@ -3985,7 +3983,7 @@ parse_start: display_char = TRUE; break; case 'V': - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); break; case 'w': @@ -4061,13 +4059,13 @@ parse_start: case 'o': if ( bin_output ) { if (set_output_file(opt_arg, 1) < 0) { - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } } else { if (set_output_file(opt_arg, 0) < 0) { - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } } @@ -4081,7 +4079,7 @@ parse_start: if ( opt_arg != NULL) { if ( ( bin_form = set_binary_form(opt_arg)) < 0) { /* failed to set binary form */ - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } } @@ -4089,7 +4087,7 @@ parse_start: if (outfname!=NULL) { if (set_output_file(outfname, 1) < 0) { /* failed to set output file */ - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } @@ -4100,7 +4098,7 @@ parse_start: case 'q': if ( ( sort_by = set_sort_by(opt_arg)) < 0) { /* failed to set "sort by" form */ - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } break; @@ -4108,7 +4106,7 @@ parse_start: case 'z': if ( ( sort_order = set_sort_order(opt_arg)) < 0) { /* failed to set "sort order" form */ - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } break; @@ -4146,7 +4144,7 @@ parse_start: /* specify XML namespace (default="hdf5:"), or none */ /* To Do: check format of this value? */ if (!useschema) { - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } if (strcmp(opt_arg,":") == 0) { @@ -4165,7 +4163,7 @@ parse_start: struct subset_t *s; if (!last_was_dset) { - error_msg(progname, + error_msg(h5tools_getprogname(), "option `-%c' can only be used after --dataset option\n", opt); leave(EXIT_FAILURE); @@ -4213,11 +4211,11 @@ end_collect: /** end subsetting parameters **/ case 'h': - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_SUCCESS); case '?': default: - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } } @@ -4225,8 +4223,8 @@ end_collect: parse_end: /* check for file name to be processed */ if (argc <= opt_ind) { - error_msg(progname, "missing file name\n"); - usage(progname); + error_msg("missing file name\n"); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } return hand; @@ -4320,6 +4318,8 @@ main(int argc, const char *argv[]) int i; unsigned u; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); dump_header_format = &standardformat; dump_function_table = &ddl_function_table; @@ -4333,43 +4333,43 @@ main(int argc, const char *argv[]) if ( bin_output && outfname == NULL ) { - error_msg(progname, "binary output requires a file name, use -o \n"); + error_msg("binary output requires a file name, use -o \n"); leave(EXIT_FAILURE); } /* Check for conflicting options */ if (doxml) { if (!display_all) { - error_msg(progname, "option \"%s\" not available for XML\n", + error_msg("option \"%s\" not available for XML\n", "to display selected objects"); leave(EXIT_FAILURE); } else if (display_bb) { - error_msg(progname, "option \"%s\" not available for XML\n", + error_msg("option \"%s\" not available for XML\n", "--boot-block"); leave(EXIT_FAILURE); } else if (display_oid == 1) { - error_msg(progname, "option \"%s\" not available for XML\n", + error_msg("option \"%s\" not available for XML\n", "--object-ids"); leave(EXIT_FAILURE); } else if (display_char == TRUE) { - error_msg(progname, "option \"%s\" not available for XML\n", + error_msg("option \"%s\" not available for XML\n", "--string"); leave(EXIT_FAILURE); } else if (usingdasho) { - error_msg(progname, "option \"%s\" not available for XML\n", + error_msg("option \"%s\" not available for XML\n", "--output"); leave(EXIT_FAILURE); } } else { if (xml_dtd_uri) { - warn_msg(progname, "option \"%s\" only applies with XML: %s\n", + warn_msg("option \"%s\" only applies with XML: %s\n", "--xml-dtd", xml_dtd_uri); } } if (argc <= opt_ind) { - error_msg(progname, "missing file name\n"); - usage(progname); + error_msg("missing file name\n"); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } fname = HDstrdup(argv[opt_ind]); @@ -4377,7 +4377,7 @@ main(int argc, const char *argv[]) fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0); if (fid < 0) { - error_msg(progname, "unable to open file \"%s\"\n", fname); + error_msg("unable to open file \"%s\"\n", fname); leave(EXIT_FAILURE); } @@ -4403,7 +4403,7 @@ main(int argc, const char *argv[]) } } else { if (useschema && strcmp(xmlnsprefix,"")) { - error_msg(progname, "Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); + error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); leave(EXIT_FAILURE); } } @@ -4412,15 +4412,15 @@ main(int argc, const char *argv[]) /* Get object info for root group */ if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) { - error_msg(progname, "internal error (file %s:line %d)\n", __FILE__, __LINE__); - d_status = EXIT_FAILURE; + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); goto done; } /* Initialize object tables */ if(table_list_add(fid, oi.fileno) < 0) { - error_msg(progname, "internal error (file %s:line %d)\n", __FILE__, __LINE__); - d_status = EXIT_FAILURE; + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); goto done; } group_table = table_list.tables[0].group_table; @@ -4482,8 +4482,8 @@ main(int argc, const char *argv[]) { if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { - error_msg(progname, "unable to open root group\n"); - d_status = EXIT_FAILURE; + error_msg("unable to open root group\n"); + h5tools_setstatus(EXIT_FAILURE); } else { @@ -4494,8 +4494,8 @@ main(int argc, const char *argv[]) if(H5Gclose(gid) < 0) { - error_msg(progname, "unable to close root group\n"); - d_status = EXIT_FAILURE; + error_msg("unable to close root group\n"); + h5tools_setstatus(EXIT_FAILURE); } @@ -4504,8 +4504,8 @@ main(int argc, const char *argv[]) { /* Note: this option is not supported for XML */ if(doxml) { - error_msg(progname, "internal error (file %s:line %d)\n", __FILE__, __LINE__); - d_status = EXIT_FAILURE; + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); goto done; } /* end if */ @@ -4525,7 +4525,7 @@ done: table_list_free(); if (H5Fclose(fid) < 0) - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); free_handler(hand, argc); @@ -4536,7 +4536,7 @@ done: H5Eset_auto2(H5E_DEFAULT, func, edata); - leave(d_status); + leave(h5tools_getstatus()); } /*------------------------------------------------------------------------- @@ -4949,7 +4949,7 @@ xml_print_datatype(hid_t type, unsigned in_group) free(dtxid); } else { printf("\n"); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } } else { @@ -5253,7 +5253,7 @@ xml_print_datatype(hid_t type, unsigned in_group) default: printf(""); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); break; } } /* end else */ @@ -5635,7 +5635,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, printf("\n"); indentation(indent); printf("\n", xmlnsprefix ); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); return FAIL; } } @@ -5710,9 +5710,9 @@ xml_dump_named_datatype(hid_t type, const char *name) if (found_obj == NULL) { indentation(indent); - error_msg(progname, "internal error (file %s:line %d)\n", + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); goto done; } else if(found_obj->displayed) { /* We have already printed this named datatype, print it as a @@ -5791,27 +5791,27 @@ xml_dump_group(hid_t gid, const char *name) if ((gcpl_id = H5Gget_create_plist(gid)) < 0) { - error_msg(progname, "error in getting group creation property list ID\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); } /* query the group creation properties for attributes */ if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) { - error_msg(progname, "error in getting group creation properties\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); } /* query the group creation properties */ if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) { - error_msg(progname, "error in getting group creation properties\n"); - d_status = EXIT_FAILURE; + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); } if(H5Pclose(gcpl_id) < 0) { - error_msg(progname, "error in closing group creation property list ID\n"); - d_status = EXIT_FAILURE; + error_msg("error in closing group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); } if(HDstrcmp(name, "/") == 0) { @@ -5843,9 +5843,9 @@ xml_dump_group(hid_t gid, const char *name) if (found_obj == NULL) { indentation(indent); - error_msg(progname, "internal error (file %s:line %d)\n", + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } else { char *t_name = xml_escape_the_name(name); char *grpxid = malloc(100); @@ -5910,14 +5910,14 @@ xml_dump_group(hid_t gid, const char *name) if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end if */ else { if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end else */ @@ -5982,14 +5982,14 @@ xml_dump_group(hid_t gid, const char *name) if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end if */ else { if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end else */ @@ -6648,14 +6648,14 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if(H5Aiterate2(did, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end if */ else { if(H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg(progname, "error getting attribute information\n"); - d_status = EXIT_FAILURE; + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ } /* end else */ @@ -7088,7 +7088,7 @@ static int dump_extlink(hid_t group, const char *linkname, const char *objname) handle_datatypes(group, linkname, NULL, 0, objname); break; default: - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); } indent -= 2*COL; @@ -7103,7 +7103,7 @@ static int dump_extlink(hid_t group, const char *linkname, const char *objname) } /* end if */ if (H5Idec_ref(oid) < 0) - d_status = EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); return SUCCEED; diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index ccc0f22..a466739 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -28,10 +28,14 @@ #include "H5private.h" #include "h5tools.h" +/* Name of tool */ +#define PROGRAMNAME "h5dumpgentest" + #define FILE1 "tgroup.h5" #define FILE2 "tdset.h5" #define FILE3 "tattr.h5" #define FILE4 "tslink.h5" +#define FILE4_1 "tsoftlinks.h5" #define FILE5 "thlink.h5" #define FILE6 "tcompound.h5" #define FILE7 "tall.h5" @@ -91,7 +95,7 @@ #define FILE61 "textlinksrc.h5" #define FILE62 "textlinktar.h5" #define FILE63 "textlinkfar.h5" -#define FILE64 "tarray8.h5" +/*#define FILE64 "tarray8.h5"*/ #define FILE65 "tattrreg.h5" #define FILE66 "file_space.h5" #define FILE67 "tdset_idx.h5" @@ -211,7 +215,8 @@ typedef struct s1_t { #define ARRAY3_DIM2 3 /* VL string datatype name */ -#define VLSTR_TYPE "vl_string_type" +/* TODO remove complier error not used, remove the link when everything is OK */ +/* #define VLSTR_TYPE "vl_string_type" */ /* "File 41" macros */ /* Name of dataset to create in datafile */ @@ -474,6 +479,246 @@ static void gent_softlink(void) H5Fclose(fid); } +/*------------------------------------------------------------------------- + * Function: gent_softlink2 + * + * Purpose: Create soft links to various objects. + * Return: + * SUCCEED + * FAIL + * Programmer: Jonathan Kim + * Date: May 26, 2010 + *-------------------------------------------------------------------------*/ +#define NX 4 +#define NY 2 +static int gent_softlink2(void) +{ + hid_t fileid1; + hid_t gid1=0, gid2=0; + hid_t tid; + hid_t dset1, dset2; + hid_t datatype, dataspace; + hsize_t dimsf[2]; /* dataset dimensions */ + herr_t status=SUCCEED; + int data1[NX][NY] = {{0,0},{1,1},{2,2},{3,3}}; + int data2[NX][NY] = {{0,0},{0,1},{0,2},{3,3}}; + + /*----------------------------------------------------------------------- + * FILE + *------------------------------------------------------------------------*/ + /* Create a new file */ + fileid1 = H5Fcreate(FILE4_1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fileid1 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * Groups + *------------------------------------------------------------------------*/ + gid1 = H5Gcreate2(fileid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid1 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + gid2 = H5Gcreate2(fileid1, "group_empty", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid2 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * Named datatype + *------------------------------------------------------------------------*/ + tid = H5Tcopy(H5T_NATIVE_INT); + status = H5Tcommit2(fileid1, "dtype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * Datasets + *------------------------------------------------------------------------*/ + /* + * Describe the size of the array and create the data space for fixed + * size dataset. + */ + dimsf[0] = NX; + dimsf[1] = NY; + dataspace = H5Screate_simple(2, dimsf, NULL); + + /* + * Define datatype for the data in the file. + * We will store little endian INT numbers. + */ + datatype = H5Tcopy(H5T_NATIVE_INT); + + /*--------------- + * dset1 + */ + /* Create a new dataset as sample object */ + dset1 = H5Dcreate2(fileid1, "/dset1", datatype, dataspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (dset1 < 0) + { + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + status = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /*--------------- + * dset2 + */ + /* Create a new dataset as sample object */ + dset2 = H5Dcreate2(fileid1, "/dset2", datatype, dataspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (dset2 < 0) + { + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + status = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * Soft links + *------------------------------------------------------------------------*/ + /* + * create various soft links under '/' root + */ + /* link to dset1 */ + status = H5Lcreate_soft("/dset1", fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* link to data type */ + status = H5Lcreate_soft("/dtype", fileid1, "soft_dtype", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* link to group1 */ + status = H5Lcreate_soft("/group1", fileid1, "soft_group1", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* link to empty group */ + status = H5Lcreate_soft("/group_empty", fileid1, "soft_empty_grp", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* dangling link */ + status = H5Lcreate_soft("not_yet", fileid1, "soft_dangle", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /*----------------------------------------- + * create various soft links under a group + */ + /* link to dset1 */ + status = H5Lcreate_soft("/dset1", gid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* link to dset2 */ + status = H5Lcreate_soft("/dset2", gid1, "soft_dset2", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* link to data type */ + status = H5Lcreate_soft("/dtype", gid1, "soft_dtype", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* link to empty group */ + status = H5Lcreate_soft("/group_empty", gid1, "soft_empty_grp", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + + /* dangling link */ + status = H5Lcreate_soft("not_yet", gid1, "soft_dangle", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", FILE4_1); + status = FAIL; + goto out; + } + +out: + /* + * Close/release resources. + */ + H5Sclose(dataspace); + H5Gclose(gid1); + H5Gclose(gid2); + H5Tclose(datatype); + H5Dclose(dset1); + H5Dclose(dset2); + H5Fclose(fileid1); + + return status; +} + /* / @@ -1669,7 +1914,7 @@ static void gent_objref(void) hid_t sid1; /* Dataspace ID */ hid_t tid1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; - hobj_ref_t *wbuf, /* buffer to write to disk */ + hobj_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temp. buffer read from disk */ uint32_t *tu32; /* Temporary pointer to uint32 data */ @@ -1677,9 +1922,9 @@ static void gent_objref(void) const char *write_comment = "Foo!"; /* Comments for group */ /* Allocate write & read buffers */ - wbuf = malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - rbuf = malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - tbuf = malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + wbuf = (hobj_ref_t*) malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + rbuf = (hobj_ref_t*) malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + tbuf = (hobj_ref_t*) malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE16, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1787,10 +2032,10 @@ static void gent_datareg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf=calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf=malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); - dwbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - drbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); + wbuf = (hdset_reg_ref_t*) calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t*) malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); + dwbuf = (uint8_t*) malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); + drbuf = (uint8_t*) calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE17, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1896,10 +2141,10 @@ static void gent_attrreg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf=calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf=malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); - dwbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - drbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); + wbuf = (hdset_reg_ref_t*) calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t*) malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); + dwbuf = (uint8_t*) malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); + drbuf = (uint8_t*) calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE65, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2969,7 +3214,7 @@ static void gent_array8(void) hsize_t sdims[] = {F64_DIM0}; hsize_t tdims[] = {F64_DIM1}; int wdata[(F64_DIM1) * sizeof(int)]; /* Write buffer */ - int i; + unsigned int i; /* * Initialize data. i is the element in the dataspace, j and k the @@ -5663,7 +5908,7 @@ static void gent_longlinks(void) assert(gid >= 0); /* Construct very long file name */ - objname = HDmalloc((size_t)(F51_MAX_NAME_LEN + 1)); + objname = (char*) HDmalloc((size_t)(F51_MAX_NAME_LEN + 1)); assert(objname); for(u = 0; u < F51_MAX_NAME_LEN; u++) objname[u] = 'a'; @@ -5927,7 +6172,7 @@ gent_hyperslab(void) double *buf; int i, ret; - buf = malloc(32 * 4097 * sizeof(double) ); + buf = (double*) malloc(32 * 4097 * sizeof(double) ); for(i = 0; i < 32 * 4097; i++) buf[i] = 1; @@ -6613,6 +6858,7 @@ int main(void) gent_group(); gent_attribute(); gent_softlink(); + gent_softlink2(); gent_dataset(); gent_hardlink(); gent_extlink(); diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt new file mode 100644 index 0000000..8eea2c1 --- /dev/null +++ b/tools/h5import/CMakeLists.txt @@ -0,0 +1,61 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5IMPORT) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5import and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) +H5_NAMING (h5import) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5import + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5import) + +IF (BUILD_TESTING) + ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) + H5_NAMING (h5importtest) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5importtest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + ADD_TEST (NAME h5importtest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + h5importtest + ) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5import + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index c59b2cb..cd93184 100755 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -192,12 +192,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 24428cb..82b92d2 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -23,6 +23,9 @@ #include "h5tools_utils.h" +/* Name of tool */ +#define PROGRAMNAME "h5import" + int main(int argc, char *argv[]) { struct Options opt; @@ -42,6 +45,9 @@ int main(int argc, char *argv[]) const char *err8 = "Invalid size of data - %s.\n"; const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n"; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + (void)HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0); (void)HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0); diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh index d8b54a7..6dbec84 100755 --- a/tools/h5import/h5importtestutil.sh +++ b/tools/h5import/h5importtestutil.sh @@ -120,7 +120,7 @@ TOOLTEST $srcdir/testfiles/in64.txt -c $srcdir/testfiles/textpfe.conf -o test15. -rm -f *.txt *.bin *.h5 +rm -f txtin32.txt txtin16.txt *.bin *.h5 rm -rf tmp_testfiles else echo "** h5import or h5importtest not available ***" diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt new file mode 100644 index 0000000..166d272 --- /dev/null +++ b/tools/h5jam/CMakeLists.txt @@ -0,0 +1,108 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5JAM) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5jam and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) +H5_NAMING (h5jam) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5jam + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) +H5_NAMING (getub) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (getub + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) +H5_NAMING (tellub) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (tellub + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) +H5_NAMING (h5unjam) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5unjam + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES + h5jam + getub + tellub + h5unjam +) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) + H5_NAMING (h5jamgentest) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (h5jamgentest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5jamgentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5jamgentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5jam h5unjam + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5jam/Makefile.am b/tools/h5jam/Makefile.am index 2f9bc00..c6ccebf 100644 --- a/tools/h5jam/Makefile.am +++ b/tools/h5jam/Makefile.am @@ -39,7 +39,7 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) # Temporary files. *.h5 are generated by jamgentest. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES+=*.h5 *.txt +CHECK_CLEANFILES+=*.h5 DISTCLEANFILES=testh5jam.sh include $(top_srcdir)/config/conclude.am diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 2c89e4f..bf5219a 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -206,12 +206,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ @@ -373,7 +373,7 @@ TRACE = perl $(top_srcdir)/bin/trace # Temporary files. *.h5 are generated by jamgentest. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.txt +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 # Include src and tools/lib directories INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 2fb5833..293aa17 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -28,7 +28,8 @@ void parse_command_line (int argc, const char *argv[]); #define TRUE 1 #define FALSE 0 -static const char *progname="getub"; +/* Name of tool */ +#define PROGRAMNAME "getub" char *nbytes = NULL; static const char *s_opts = "c:"; /* add more later ? */ @@ -89,15 +90,15 @@ parse_command_line (int argc, const char *argv[]) break; case '?': default: - usage (progname); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } } if (argc <= opt_ind) { - error_msg (progname, "missing file name\n"); - usage (progname); + error_msg("missing file name\n"); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } } @@ -111,19 +112,22 @@ main (int argc, const char *argv[]) long res; char *buf; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + parse_command_line (argc, argv); if (nbytes == NULL) { /* missing arg */ - error_msg (progname, "missing size\n"); - usage (progname); + error_msg("missing size\n"); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } if (argc <= (opt_ind)) { - error_msg (progname, "missing file name\n"); - usage (progname); + error_msg("missing file name\n"); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } filename = HDstrdup (argv[opt_ind]); @@ -133,15 +137,15 @@ main (int argc, const char *argv[]) if (res == EOF) { /* fail */ - error_msg (progname, "missing file name\n"); - usage (progname); + error_msg("missing file name\n"); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } fd = HDopen (filename, O_RDONLY, 0); if (fd < 0) { - error_msg (progname, "can't open file %s\n", filename); + error_msg("can't open file %s\n", filename); exit (EXIT_FAILURE); } diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index cceed75..17b1384 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -24,6 +24,9 @@ #include "H5private.h" #include "h5tools_utils.h" +/* Name of tool */ +#define PROGRAMNAME "h5jam" + #define TRUE 1 #define FALSE 0 @@ -32,8 +35,6 @@ hsize_t compute_user_block_size (hsize_t); hsize_t copy_some_to_file (int, int, hsize_t, hsize_t, ssize_t); void parse_command_line (int, const char *[]); -const char *progname = "h5jam"; -int d_status = EXIT_SUCCESS; int do_clobber = FALSE; char *output_file = NULL; char *input_file = NULL; @@ -131,14 +132,14 @@ parse_command_line (int argc, const char *argv[]) do_clobber = TRUE; break; case 'h': - usage (progname); + usage (h5tools_getprogname()); exit (EXIT_SUCCESS); case 'V': - print_version (progname); + print_version (h5tools_getprogname()); exit (EXIT_SUCCESS); case '?': default: - usage (progname); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } } @@ -180,6 +181,9 @@ main (int argc, const char *argv[]) struct stat sbuf2; int res; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -189,16 +193,16 @@ main (int argc, const char *argv[]) if (ub_file == NULL) { /* no user block */ - error_msg (progname, "no user block file name\n"); - usage (progname); + error_msg("no user block file name\n"); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } if (input_file == NULL) { /* no user block */ - error_msg (progname, "no HDF5 file\n"); - usage (progname); + error_msg("no HDF5 file\n"); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } @@ -206,7 +210,7 @@ main (int argc, const char *argv[]) if (testval <= 0) { - error_msg (progname, "Input HDF5 file is not HDF \"%s\"\n", input_file); + error_msg("Input HDF5 file is not HDF \"%s\"\n", input_file); exit (EXIT_FAILURE); } @@ -214,14 +218,14 @@ main (int argc, const char *argv[]) if (ifile < 0) { - error_msg (progname, "Can't open input HDF5 file \"%s\"\n", input_file); + error_msg("Can't open input HDF5 file \"%s\"\n", input_file); exit (EXIT_FAILURE); } plist = H5Fget_create_plist (ifile); if (plist < 0) { - error_msg (progname, "Can't get file creation plist for file \"%s\"\n", + error_msg("Can't get file creation plist for file \"%s\"\n", input_file); exit (EXIT_FAILURE); } @@ -229,7 +233,7 @@ main (int argc, const char *argv[]) status = H5Pget_userblock (plist, &usize); if (status < 0) { - error_msg (progname, "Can't get user block for file \"%s\"\n", + error_msg("Can't get user block for file \"%s\"\n", input_file); exit (EXIT_FAILURE); } @@ -241,7 +245,7 @@ main (int argc, const char *argv[]) if (ufid < 0) { - error_msg (progname, "unable to open user block file \"%s\"\n", + error_msg("unable to open user block file \"%s\"\n", ub_file); exit (EXIT_FAILURE); } @@ -250,7 +254,7 @@ main (int argc, const char *argv[]) if (res < 0) { - error_msg (progname, "Can't stat file \"%s\"\n", ub_file); + error_msg("Can't stat file \"%s\"\n", ub_file); exit (EXIT_FAILURE); } @@ -260,7 +264,7 @@ main (int argc, const char *argv[]) if (h5fid < 0) { - error_msg (progname, "unable to open HDF5 file for read \"%s\"\n", + error_msg("unable to open HDF5 file for read \"%s\"\n", input_file); exit (EXIT_FAILURE); } @@ -269,7 +273,7 @@ main (int argc, const char *argv[]) if (res < 0) { - error_msg (progname, "Can't stat file \"%s\"\n", input_file); + error_msg("Can't stat file \"%s\"\n", input_file); exit (EXIT_FAILURE); } @@ -281,7 +285,7 @@ main (int argc, const char *argv[]) if (ofid < 0) { - error_msg (progname, "unable to open output file \"%s\"\n", + error_msg("unable to open output file \"%s\"\n", output_file); exit (EXIT_FAILURE); } @@ -292,7 +296,7 @@ main (int argc, const char *argv[]) if (ofid < 0) { - error_msg (progname, "unable to create output file \"%s\"\n", + error_msg("unable to create output file \"%s\"\n", output_file); exit (EXIT_FAILURE); } @@ -346,7 +350,7 @@ main (int argc, const char *argv[]) HDclose (h5fid); HDclose (ofid); - return d_status; + return h5tools_getstatus(); } /*------------------------------------------------------------------------- @@ -395,7 +399,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, if (startin > startout) { /* this case is prohibited */ - error_msg (progname, "copy_some_to_file: panic: startin > startout?\n"); + error_msg("copy_some_to_file: panic: startin > startout?\n"); exit (EXIT_FAILURE); } @@ -405,7 +409,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, if (res < 0) { - error_msg (progname, "Can't stat file \n"); + error_msg("Can't stat file \n"); exit (EXIT_FAILURE); } diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 5e4d864..8e31ce1 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -26,6 +26,9 @@ #include "H5private.h" #include "h5tools_utils.h" +/* Name of tool */ +#define PROGRAMNAME "h5unjam" + #define TRUE 1 #define FALSE 0 #define COPY_BUF_SIZE 1024 @@ -34,8 +37,6 @@ hsize_t write_pad( int , hsize_t ); hsize_t compute_pad( hsize_t ); herr_t copy_to_file( int , int , ssize_t, ssize_t ); -const char *progname = "h5unjam"; -int d_status = EXIT_SUCCESS; int do_delete = FALSE; char *output_file = NULL; char *input_file = NULL; @@ -125,14 +126,14 @@ parse_command_line(int argc, const char *argv[]) do_delete = TRUE; break; case 'h': - usage(progname); + usage(h5tools_getprogname()); exit(EXIT_SUCCESS); case 'V': - print_version (progname); + print_version (h5tools_getprogname()); exit (EXIT_SUCCESS); case '?': default: - usage(progname); + usage(h5tools_getprogname()); exit(EXIT_FAILURE); } } @@ -140,8 +141,8 @@ parse_command_line(int argc, const char *argv[]) /* check for file name to be processed */ /* if (argc <= opt_ind+2) { - error_msg(progname, "missing file name\n"); - usage(progname); + error_msg("missing file name\n"); + usage(h5tools_getprogname()); exit(EXIT_FAILURE); } */ @@ -178,6 +179,9 @@ main(int argc, const char *argv[]) int res; struct stat sbuf; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -187,32 +191,32 @@ main(int argc, const char *argv[]) testval = H5Fis_hdf5(input_file); if (testval <= 0) { - error_msg(progname, "Input HDF5 file is not HDF \"%s\"\n", input_file); + error_msg("Input HDF5 file is not HDF \"%s\"\n", input_file); exit(EXIT_FAILURE); } ifile = H5Fopen(input_file, H5F_ACC_RDONLY , H5P_DEFAULT); if (ifile < 0) { - error_msg(progname, "Can't open input HDF5 file \"%s\"\n", input_file); + error_msg("Can't open input HDF5 file \"%s\"\n", input_file); exit(EXIT_FAILURE); } plist = H5Fget_create_plist(ifile); if (plist < 0) { - error_msg(progname, "Can't get file creation plist for file \"%s\"\n", input_file); + error_msg("Can't get file creation plist for file \"%s\"\n", input_file); exit(EXIT_FAILURE); } status = H5Pget_userblock(plist, & usize ); if (status < 0) { - error_msg(progname, "Can't get user block for file \"%s\"\n", input_file); + error_msg("Can't get user block for file \"%s\"\n", input_file); exit(EXIT_FAILURE); } if (usize == 0) { /* no user block to remove: message? */ - error_msg(progname, "\"%s\" has no user block: no change to file\n", input_file); + error_msg("\"%s\" has no user block: no change to file\n", input_file); exit(EXIT_SUCCESS); } @@ -220,7 +224,7 @@ main(int argc, const char *argv[]) res = stat(input_file, &sbuf); if (res < 0) { - error_msg(progname, "Can't stat file \"%s\"\n", input_file); + error_msg("Can't stat file \"%s\"\n", input_file); exit(EXIT_FAILURE); } @@ -229,12 +233,12 @@ main(int argc, const char *argv[]) ifid = HDopen(input_file,O_RDONLY,0); if (ifid < 0) { - error_msg(progname, "unable to open input HDF5 file \"%s\"\n", input_file); + error_msg("unable to open input HDF5 file \"%s\"\n", input_file); exit(EXIT_FAILURE); } if (do_delete && (ub_file != NULL)) { - error_msg(progname, "??\"%s\"\n", ub_file); + error_msg("??\"%s\"\n", ub_file); exit(EXIT_FAILURE); } @@ -245,7 +249,7 @@ main(int argc, const char *argv[]) ufid = HDopen(ub_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); if (ufid < 0) { - error_msg(progname, "unable to open user block file for output\"%s\"\n", ub_file); + error_msg("unable to open user block file for output\"%s\"\n", ub_file); exit(EXIT_FAILURE); } } @@ -254,14 +258,14 @@ main(int argc, const char *argv[]) h5fid = HDopen(input_file,O_WRONLY, 0); if (h5fid < 0) { - error_msg(progname, "unable to open output HDF5 file \"%s\"\n", input_file); + error_msg("unable to open output HDF5 file \"%s\"\n", input_file); exit(EXIT_FAILURE); } } else { h5fid = HDopen(output_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); if (h5fid < 0) { - error_msg(progname, "unable to open output HDF5 file \"%s\"\n", output_file); + error_msg("unable to open output HDF5 file \"%s\"\n", output_file); exit(EXIT_FAILURE); } } @@ -270,7 +274,7 @@ main(int argc, const char *argv[]) /* copy from 0 to 'usize - 1' into ufid */ if (!do_delete) { if(copy_to_file(ifid, ufid, 0, (ssize_t) usize) < 0) { - error_msg(progname, "unable to copy user block to output file \"%s\"\n", ub_file); + error_msg("unable to copy user block to output file \"%s\"\n", ub_file); exit(EXIT_FAILURE); } } @@ -279,7 +283,7 @@ main(int argc, const char *argv[]) * starting at end of user block if present */ if(copy_to_file(ifid, h5fid, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize)) < 0) { - error_msg(progname, "unable to copy hdf5 data to output file \"%s\"\n", output_file); + error_msg("unable to copy hdf5 data to output file \"%s\"\n", output_file); exit(EXIT_FAILURE); } @@ -288,7 +292,7 @@ main(int argc, const char *argv[]) HDclose(h5fid); HDclose(ifid); - return d_status; + return h5tools_getstatus(); } /* diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index d39b958..2cf30e2 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -26,7 +26,8 @@ #define TRUE 1 #define FALSE 0 -const char *progname = "tellub"; +/* Name of tool */ +#define PROGRAMNAME "tellub" /* * Command-line options: The user can specify short or long-named @@ -91,11 +92,11 @@ parse_command_line (int argc, const char *argv[]) switch ((char) opt) { case 'h': - usage (progname); + usage (h5tools_getprogname()); exit (EXIT_SUCCESS); case '?': default: - usage (progname); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } } @@ -103,8 +104,8 @@ parse_command_line (int argc, const char *argv[]) /* check for file name to be processed */ if (argc <= opt_ind) { - error_msg (progname, "missing file name\n"); - usage (progname); + error_msg(h5tools_getprogname(), "missing file name\n"); + usage (h5tools_getprogname()); exit (EXIT_FAILURE); } } @@ -135,6 +136,9 @@ main (int argc, const char *argv[]) herr_t status; hid_t plist; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -143,8 +147,8 @@ main (int argc, const char *argv[]) if (argc <= (opt_ind)) { - error_msg (progname, "missing file name\n"); - usage (progname); + error_msg("missing file name\n"); + usage (h5tools_getprogname()); return (EXIT_FAILURE); } @@ -154,7 +158,7 @@ main (int argc, const char *argv[]) if (testval <= 0) { - error_msg (progname, "Input HDF5 file is not HDF \"%s\"\n", ifname); + error_msg("Input HDF5 file is not HDF \"%s\"\n", ifname); return (EXIT_FAILURE); } @@ -162,14 +166,14 @@ main (int argc, const char *argv[]) if (ifile < 0) { - error_msg (progname, "Can't open input HDF5 file \"%s\"\n", ifname); + error_msg("Can't open input HDF5 file \"%s\"\n", ifname); return (EXIT_FAILURE); } plist = H5Fget_create_plist (ifile); if (plist < 0) { - error_msg (progname, "Can't get file creation plist for file \"%s\"\n", + error_msg("Can't get file creation plist for file \"%s\"\n", ifname); return (EXIT_FAILURE); } @@ -177,7 +181,7 @@ main (int argc, const char *argv[]) status = H5Pget_userblock (plist, &usize); if (status < 0) { - error_msg (progname, "Can't get user block for file \"%s\"\n", ifname); + error_msg("Can't get user block for file \"%s\"\n", ifname); return (EXIT_FAILURE); } diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt new file mode 100644 index 0000000..c2d9100 --- /dev/null +++ b/tools/h5ls/CMakeLists.txt @@ -0,0 +1,245 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5LS) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# If testing was NOT enabled, then we need to build the tools library +# -------------------------------------------------------------------- +#-- Add the h5ls executable +ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) +H5_NAMING (h5ls) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5ls + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES + h5ls +) + +IF (BUILD_TESTING) + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + help-1.ls + help-2.ls + help-3.ls + nosuchfile.ls + tall-1.ls + tall-2.ls + tarray1.ls + tattr2.ls + tcomp-1.ls + tdataregbe.ls + tdataregle.ls + tdset-1.ls + tempty.ls + textlink-1.ls + textlinksrc-1.ls + textlinksrc-2.ls + textlinksrc-3.ls + textlinksrc-4.ls + textlinksrc-5.ls + textlinksrc-6.ls + textlinksrc-7.ls + textlinksrc-1-old.ls + textlinksrc-2-old.ls + textlinksrc-3-old.ls + textlinksrc-6-old.ls + textlinksrc-7-old.ls + tsoftlinks-1.ls + tsoftlinks-2.ls + tsoftlinks-3.ls + tsoftlinks-4.ls + tsoftlinks-5.ls + tgroup.ls + tgroup-1.ls + tgroup-2.ls + tgroup-3.ls + thlink-1.ls + tloop-1.ls + tnestcomp-1.ls + tsaf.ls + tslink-1.ls + tstr-1.ls + tudlink-1.ls + tvldtypes1.ls + tvldtypes2le.ls + tvldtypes2be.ls + ) + SET (HDF5_REFERENCE_TEST_FILES + tall.h5 + tarray1.h5 + tattr2.h5 + tcompound.h5 + tdatareg.h5 + tdset.h5 + tempty.h5 + textlink.h5 + textlinksrc.h5 + textlinktar.h5 + tgroup.h5 + thlink.h5 + tloop.h5 + tnestedcomp.h5 + tsaf.h5 + tslink.h5 + tsoftlinks.h5 + tstr.h5 + tudlink.h5 + tvldtypes1.h5 + ) + + FOREACH (ls_file ${HDF5_REFERENCE_FILES}) + SET (lsdest "${PROJECT_BINARY_DIR}/${ls_file}") + #MESSAGE (STATUS " Translating ${ls_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5ls + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${ls_file} ${lsdest} -l3 + ) + ENDFOREACH (ls_file ${HDF5_REFERENCE_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5ls + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5LS-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + + # test the help syntax + ADD_H5_TEST (help-1 0 -w80 -h) + ADD_H5_TEST (help-2 0 -w80 --help) + ADD_H5_TEST (help-3 0 -w80 -?) + + # test simple command + ADD_H5_TEST (tall-1 0 -w80 tall.h5) + ADD_H5_TEST (tall-2 0 -w80 -r -d tall.h5) + ADD_H5_TEST (tgroup 0 -w80 tgroup.h5) + ADD_H5_TEST (tgroup-3 0 -w80 tgroup.h5/g1) + + # test for displaying groups + # The following combination of arguments is expected to return an error message + # and return value 1 + ADD_H5_TEST (tgroup-1 1 -w80 -r -g tgroup.h5) + ADD_H5_TEST (tgroup-2 0 -w80 -g tgroup.h5/g1) + + # test for displaying simple space datasets + ADD_H5_TEST (tdset-1 0 -w80 -r -d tdset.h5) + + # test for displaying soft links (dangle) + ADD_H5_TEST (tslink-1 0 -w80 -r tslink.h5) + + # test for displaying more soft links with --follow-symlinks + ADD_H5_TEST (tsoftlinks-1 0 --follow-symlinks tsoftlinks.h5) + ADD_H5_TEST (tsoftlinks-2 0 --follow-symlinks -r tsoftlinks.h5) + ADD_H5_TEST (tsoftlinks-3 0 --follow-symlinks tsoftlinks.h5/group1) + ADD_H5_TEST (tsoftlinks-4 0 --follow-symlinks -r tsoftlinks.h5/group1) + ADD_H5_TEST (tsoftlinks-5 0 --follow-symlinks tsoftlinks.h5/soft_dset1) + + # test for displaying external and user-defined links with --follow-symlinks + ADD_H5_TEST (textlink-1 0 -w80 -r textlink.h5) + ADD_H5_TEST (textlinksrc-1 0 -w80 --follow-symlinks -r textlinksrc.h5) + ADD_H5_TEST (textlinksrc-2 0 -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5) + ADD_H5_TEST (textlinksrc-3 0 -w80 --follow-symlinks -r textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-4 0 -w80 -r textlinksrc.h5) + ADD_H5_TEST (textlinksrc-5 0 -w80 -r textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-6 0 -w80 --follow-symlinks textlinksrc.h5) + ADD_H5_TEST (textlinksrc-7 0 -w80 --follow-symlinks textlinksrc.h5/ext_link1) + ADD_H5_TEST (tudlink-1 0 -w80 -r tudlink.h5) + + # test for displaying external links with -E + # the option -E will be depriciated but keep it for backward compatibility + ADD_H5_TEST (textlinksrc-1-old 0 -w80 -Er textlinksrc.h5) + ADD_H5_TEST (textlinksrc-2-old 0 -w80 -Erv textlinksrc.h5/ext_link5) + ADD_H5_TEST (textlinksrc-3-old 0 -w80 -Er textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-6-old 0 -w80 -E textlinksrc.h5) + ADD_H5_TEST (textlinksrc-7-old 0 -w80 -E textlinksrc.h5/ext_link1) + + # tests for hard links + ADD_H5_TEST (thlink-1 0 -w80 thlink.h5) + + # tests for compound data types + ADD_H5_TEST (tcomp-1 0 -w80 -r -d tcompound.h5) + + #test for the nested compound type + ADD_H5_TEST (tnestcomp-1 0 -w80 -r -d tnestedcomp.h5) + + # test for loop detection + ADD_H5_TEST (tloop-1 0 -w80 -r -d tloop.h5) + + # test for string + ADD_H5_TEST (tstr-1 0 -w80 -r -d tstr.h5) + + # test test file created from lib SAF team + ADD_H5_TEST (tsaf 0 -w80 -r -d tsaf.h5) + + # test for variable length data types + ADD_H5_TEST (tvldtypes1 0 -w80 -r -d tvldtypes1.h5) + + # test for array data types + ADD_H5_TEST (tarray1 0 -w80 -r -d tarray1.h5) + + # test for empty data + ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) + + # test for all dataset types written to attributes + # enable -S for avoiding printing NATIVE types + ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5) + + # test for non-existing file + ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) + + IF (WORDS_BIGENDIAN) + # test for variable length data types in verbose mode + ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) + # test for dataset region references data types in verbose mode + ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) + ELSE (WORDS_BIGENDIAN) + ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) + ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) + ENDIF (WORDS_BIGENDIAN) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5ls + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 54a9324..4949f8b 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -186,12 +186,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index ab3a110..789e02a 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -29,25 +29,29 @@ #include "h5tools_utils.h" #include "h5trav.h" +/* Name of tool */ +#define PROGRAMNAME "h5ls" + #define NAME_BUF_SIZE 2048 -/* Struct to keep track of external link targets visited */ -typedef struct elink_trav_t { +/* Struct to keep track of symbolic link targets visited */ +typedef struct symlink_trav_t { size_t nalloc; size_t nused; struct { + H5L_type_t type; char *file; char *path; } *objs; -} elink_trav_t; +} symlink_trav_t; /* Struct to pass through to visitors */ typedef struct { const char *fname; /* Filename */ hid_t fid; /* File ID */ hid_t gid; /* Group ID */ - hbool_t ext_target; /* Whether this is the target of an external link */ - elink_trav_t *elink_list; /* List of visited external links */ + hbool_t symlink_target; /* Whether this is the target of an symbolic link */ + symlink_trav_t *symlink_list; /* List of visited symbolic links */ int base_len; /* Length of base path name, if not root */ int name_start; /* # of leading characters to strip off path names on output */ }iter_t; @@ -61,6 +65,7 @@ static hbool_t label_g = FALSE; /* label compound values? */ static hbool_t string_g = FALSE; /* print 1-byte numbers as ASCII? */ static hbool_t fullname_g = FALSE; /* print full path names */ static hbool_t recursive_g = FALSE; /* recursive descent listing */ +static hbool_t follow_symlink_g = FALSE; /* follow symbolic links */ static hbool_t follow_elink_g = FALSE; /* follow external links */ static hbool_t grp_literal_g = FALSE; /* list group, not contents */ static hbool_t hexdump_g = FALSE; /* show data as raw hexadecimal */ @@ -88,9 +93,6 @@ static struct dispatch_t { static void display_type(hid_t type, int ind); static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); -const char *progname="h5ls"; -int d_status; - /*------------------------------------------------------------------------- * Function: usage @@ -111,31 +113,47 @@ usage (void) { fprintf(stderr, "\ usage: %s [OPTIONS] [OBJECTS...]\n\ - OPTIONS\n\ - -h, -?, --help Print a usage message and exit\n\ - -a, --address Print addresses for raw data\n\ - -d, --data Print the values of datasets\n\ - -e, --errors Show all HDF5 error reporting\n\ - -E, --external Allow traversal into external files\n\ - -f, --full Print full path names instead of base names\n\ - -g, --group Show information about a group, not its contents\n\ - -l, --label Label members of compound datasets\n\ - -r, --recursive List all groups recursively, avoiding cycles\n\ - -s, --string Print 1-byte integer datasets as ASCII\n\ - -S, --simple Use a machine-readable output format\n\ - -wN, --width=N Set the number of columns of output\n\ - -v, --verbose Generate more verbose output\n\ - -V, --version Print version number and exit\n\ - --vfd=DRIVER Use the specified virtual file driver\n\ - -x, --hexdump Show raw data in hexadecimal format\n\ + OPTIONS\n\ + -h, -?, --help Print a usage message and exit\n\ + -a, --address Print addresses for raw data\n\ + -d, --data Print the values of datasets\n\ + -e, --errors Show all HDF5 error reporting\n\ + --follow-symlinks Follow symbolic links (soft links and external links)\n\ + to display target object information.\n\ + Without this option, h5ls identifies a symbolic link\n\ + as a soft link or external link and prints the value\n\ + assigned to the symbolic link; it does not provide any\n\ + information regarding the target object or determine\n\ + whether the link is a dangling link.\n\ + -f, --full Print full path names instead of base names\n\ + -g, --group Show information about a group, not its contents\n\ + -l, --label Label members of compound datasets\n\ + -r, --recursive List all groups recursively, avoiding cycles\n\ + -s, --string Print 1-byte integer datasets as ASCII\n\ + -S, --simple Use a machine-readable output format\n\ + -wN, --width=N Set the number of columns of output\n\ + -v, --verbose Generate more verbose output\n\ + -V, --version Print version number and exit\n\ + --vfd=DRIVER Use the specified virtual file driver\n\ + -x, --hexdump Show raw data in hexadecimal format\n\ +\n\ + OBJECTS\n\ + Each object consists of an HDF5 file name optionally followed by a\n\ + slash and an object name within the file (if no object is specified\n\ + within the file then the contents of the root group are displayed).\n\ + The file name may include a printf(3C) integer format such as\n\ + \"%%05d\" to open a file family.\n\ \n\ - OBJECTS\n\ - Each object consists of an HDF5 file name optionally followed by a\n\ - slash and an object name within the file (if no object is specified\n\ - within the file then the contents of the root group are displayed).\n\ - The file name may include a printf(3C) integer format such as\n\ - \"%%05d\" to open a file family.\n", - progname); + Deprecated Options\n\ + The following options have been deprecated in HDF5. While they remain\n\ + available, they have been superseded as indicated and may be removed\n\ + from HDF5 in the future. Use the indicated replacement option in all\n\ + new work; where possible, existing scripts, et cetera, should also be\n\ + updated to use the replacement option.\n\ +\n\ + -E or --external Follow external links.\n\ + Replaced by --follow-symlinks.\n", + h5tools_getprogname()); } @@ -152,6 +170,8 @@ usage: %s [OPTIONS] [OBJECTS...]\n\ * Thursday, November 5, 1998 * * Modifications: + * Add _H5LS_CONVERT_SPECIAL_CHAR_ #ifdef section and make it not to + * convert special chars to visible chars. (Jonathan Kim 06/24/2010) * *------------------------------------------------------------------------- */ @@ -160,6 +180,27 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) { int nprint=0; +#ifdef _H5LS_CONVERT_SPECIAL_CHAR_ + /*------------------------------------------------------------------- + * _H5LS_CONVERT_SPECIAL_CHAR_ is not defined, so this code section + * will not be compiled. + * This code section is due to be removed after verifying no problem + * at customer sites. (However we may keep it just for the future + * reference as it survived over ten years) + * + * Reason for Obsolete: + * This portion of code converts special characters or '\' to string, + * so when those characters are in object or attribute name, h5ls display + * as visible characters. + * However if a user come up with object or attribute name with special + * character in programming, this code takes away control over '\' + * (escape character) from the user and causes confusion for the output, + * also it’s not possible to handle all the cases in this way. + * This also causes discrepancy from how the string data saved in + * HDF5 file. + * Also other HDF tools don’t convert characters like this, so this + * causes inconsistent output among tools. + *-------------------------------------------------------------/ for (/*void*/; s && *s; s++) { switch (*s) { case '"': @@ -212,6 +253,17 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) break; } } +#else + if (stream) + { + nprint = fprintf(stream,s); + } + else + { + nprint = strlen(s); + } +#endif /* _H5LS_CONVERT_SPECIAL_CHAR_ */ + return nprint; } @@ -469,6 +521,9 @@ display_precision(hid_t type, int ind) case H5T_NPAD: plsb_s = "unknown"; break; + default: + ; + break; } } if (H5Tget_offset(type)+prec<8*H5Tget_size(type)) { @@ -486,6 +541,9 @@ display_precision(hid_t type, int ind) case H5T_NPAD: pmsb_s = "unknown"; break; + default: + ; + break; } } if (plsb_s || pmsb_s) { @@ -646,6 +704,9 @@ display_float_type(hid_t type, int ind) case H5T_NORM_ERROR: norm_s = ", unknown normalization"; break; + default: + ; + break; } printf("\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos, @@ -672,6 +733,9 @@ display_float_type(hid_t type, int ind) case H5T_NPAD: pad_s = "unknown"; break; + default: + ; + break; } printf("\n%*s(internal padding bits are %s)", ind, "", pad_s); } @@ -786,7 +850,7 @@ display_enum_type(hid_t type, int ind) /* Get the names and raw values of all members */ name = calloc(nmembs, sizeof(char*)); - value = calloc(nmembs, MAX(H5Tget_size(type), dst_size)); + value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size)); for (i=0; iext_target) + if(!iter->symlink_target) display_obj_name(stdout, iter, name, ""); /* Check object information */ @@ -1709,7 +1779,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void printf("Unknown type(%d)", (int)oinfo->type); obj_type = H5O_TYPE_UNKNOWN; } - if(iter->ext_target) + if(iter->symlink_target) fputc('{', stdout); if(obj_type >= 0 && dispatch_g[obj_type].name) fputs(dispatch_g[obj_type].name, stdout); @@ -1718,7 +1788,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void if(first_seen) { printf(", same as "); display_string(stdout, first_seen, TRUE); - if(!iter->ext_target) + if(!iter->symlink_target) printf("\n"); } /* end if */ else { @@ -1735,7 +1805,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void /* List the first line of information for the object. */ if(obj_type >= 0 && dispatch_g[obj_type].list1) (dispatch_g[obj_type].list1)(obj); - if(!iter->ext_target || (verbose_g > 0)) + if(!iter->symlink_target || (verbose_g > 0)) putchar('\n'); /* Show detailed information about the object, beginning with information @@ -1787,18 +1857,18 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void } /* end else */ done: - if(iter->ext_target) { + if(iter->symlink_target) { fputs("}\n", stdout); - iter->ext_target = FALSE; + iter->symlink_target = FALSE; } return 0; } /* end list_obj() */ /*------------------------------------------------------------------------- - * Function: elink_trav_add + * Function: symlink_visit_add * - * Purpose: Add an external link to visited data structure + * Purpose: Add an symbolic link to visited data structure * * Return: 0 on success, -1 on failure * @@ -1807,16 +1877,26 @@ done: * * Date: September 5, 2008 * + * Modified: + * Jonathan Kim + * - Renamed from elink_trav_add to symlink_visit_add for both soft and + * external links. (May 25, 2010) + * - Add type parameter to distingush between soft and external link for + * sure, which prevent from mixing up visited link when the target names + * are same between the soft and external link, as code marks with the + * target name. (May 25,2010) + * *------------------------------------------------------------------------- */ static herr_t -elink_trav_add(elink_trav_t *visited, const char *file, const char *path) +symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path) { size_t idx; /* Index of address to use */ void *tmp_ptr; /* Allocate space if necessary */ - if(visited->nused == visited->nalloc) { + if(visited->nused == visited->nalloc) + { visited->nalloc = MAX(1, visited->nalloc * 2); if(NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(visited->objs[0])))) return -1; @@ -1825,24 +1905,36 @@ elink_trav_add(elink_trav_t *visited, const char *file, const char *path) /* Append it */ idx = visited->nused++; - if(NULL == (visited->objs[idx].file = HDstrdup(file))) { - visited->nused--; - return -1; + + visited->objs[idx].type = type; + visited->objs[idx].file = NULL; + visited->objs[idx].path = NULL; + + if (type == H5L_TYPE_EXTERNAL) + { + if(NULL == (visited->objs[idx].file = HDstrdup(file))) + { + visited->nused--; + return -1; + } } - if(NULL == (visited->objs[idx].path = HDstrdup(path))) { + + if(NULL == (visited->objs[idx].path = HDstrdup(path))) + { visited->nused--; - HDfree (visited->objs[idx].file); + if (visited->objs[idx].file) + HDfree (visited->objs[idx].file); return -1; } return 0; -} /* end elink_trav_add() */ +} /* end symlink_visit_add() */ /*------------------------------------------------------------------------- - * Function: elink_trav_visited + * Function: symlink_is_visited * - * Purpose: Check if an external link has already been visited + * Purpose: Check if an symbolic link has already been visited * * Return: TRUE/FALSE * @@ -1851,22 +1943,41 @@ elink_trav_add(elink_trav_t *visited, const char *file, const char *path) * * Date: September 5, 2008 * + * Modified: + * Jonathan Kim + * - Renamed from elink_trav_visited to symlink_is_visited for both soft and + * external links. (May 25, 2010) + * - Add type parameter to distingush between soft and external link for + * sure, which prevent from mixing up visited link when the target names + * are same between the soft and external link, as code marks with the + * target name. (May 25,2010) + * *------------------------------------------------------------------------- */ static hbool_t -elink_trav_visited(elink_trav_t *visited, const char *file, const char *path) +symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path) { - size_t u; /* Local index variable */ + size_t u; /* Local index variable */ - /* Look for elink */ + /* Look for symlink */ for(u = 0; u < visited->nused; u++) - /* Check for elink value already in array */ - if(!HDstrcmp(visited->objs[u].file, file) && !HDstrcmp(visited->objs[u].path, path)) - return(TRUE); - - /* Didn't find elink */ + { + /* Check for symlink values already in array */ + /* check type and path pair to distingush between symbolic links */ + if ((visited->objs[u].type == type) && !HDstrcmp(visited->objs[u].path, path)) + { + /* if external link, file need to be matched as well */ + if (visited->objs[u].type == H5L_TYPE_EXTERNAL) + { + if (!HDstrcmp(visited->objs[u].file, file)) + return (TRUE); + } + return (TRUE); + } + } + /* Didn't find symlink */ return(FALSE); -} /* end elink_trav_visited() */ +} /* end symlink_is_visited() */ /*------------------------------------------------------------------------- @@ -1886,7 +1997,7 @@ elink_trav_visited(elink_trav_t *visited, const char *file, const char *path) static herr_t list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) { - char *buf; + char *buf=NULL; iter_t *iter = (iter_t*)_iter; /* Print the link's name, either full name or base name */ @@ -1894,18 +2005,52 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) switch(linfo->type) { case H5L_TYPE_SOFT: - if((buf = HDmalloc(linfo->u.val_size)) == NULL) + if((buf = (char*)HDmalloc(linfo->u.val_size)) == NULL) goto done; if(H5Lget_val(iter->fid, name, buf, linfo->u.val_size, H5P_DEFAULT) < 0) { - HDfree(buf); goto done; } /* end if */ HDfputs("Soft Link {", stdout); HDfputs(buf, stdout); - HDfree(buf); - HDfputs("}\n", stdout); + HDfputc('}', stdout); + if(follow_symlink_g) + { + hbool_t orig_grp_literal = grp_literal_g; + HDfputc(' ', stdout); + + /* Check if we have already seen this softlink */ + if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf)) + { + HDfputs("{Already Visited}\n", stdout); + goto done; + } + + /* Add this link to the list of seen softlinks */ + if(symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0) + goto done; + + /* Adjust user data to specify that we are operating on the + * target of an soft link */ + iter->symlink_target = TRUE; + + /* Prevent recursive listing of soft link target if + * recursive_g is off */ + if(!recursive_g) + grp_literal_g = TRUE; + /* Recurse through the soft link */ + if(visit_obj(iter->fid, name, iter) < 0) + { + grp_literal_g = orig_grp_literal; + goto done; + } + + grp_literal_g = orig_grp_literal; + } + else + HDfputc('\n', stdout); + break; case H5L_TYPE_EXTERNAL: @@ -1913,16 +2058,13 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) const char *filename; const char *path; - if((buf = HDmalloc(linfo->u.val_size)) == NULL) + if((buf = (char*)HDmalloc(linfo->u.val_size)) == NULL) goto done; - if(H5Lget_val(iter->fid, name, buf, linfo->u.val_size, H5P_DEFAULT) < 0) { - HDfree(buf); + if(H5Lget_val(iter->fid, name, buf, linfo->u.val_size, H5P_DEFAULT) < 0) goto done; - } /* end if */ - if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) { - HDfree(buf); + + if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) goto done; - } /* end if */ HDfputs("External Link {", stdout); HDfputs(filename, stdout); @@ -1933,27 +2075,28 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) HDfputc('}', stdout); /* Recurse through the external link */ - if(follow_elink_g) { + /* keep the follow_elink_g for backward compatibility with -E */ + if(follow_symlink_g || follow_elink_g) + { hbool_t orig_grp_literal = grp_literal_g; - HDfputc(' ', stdout); /* Check if we have already seen this elink */ - if(elink_trav_visited(iter->elink_list, filename, path)) { + if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path)) + { HDfputs("{Already Visited}\n", stdout); - HDfree(buf); goto done; } /* Add this link to the list of seen elinks */ - if(elink_trav_add(iter->elink_list, filename, path) < 0) { - HDfree(buf); + if(symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0) + { goto done; } /* Adjust user data to specify that we are operating on the * target of an external link */ - iter->ext_target = TRUE; + iter->symlink_target = TRUE; /* Prevent recursive listing of external link target if * recursive_g is off */ @@ -1962,7 +2105,6 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) /* Recurse through the external link */ if(visit_obj(iter->fid, name, iter) < 0) { - HDfree(buf); grp_literal_g = orig_grp_literal; goto done; } @@ -1972,7 +2114,6 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) else HDfputc('\n', stdout); - HDfree(buf); } break; @@ -1982,6 +2123,8 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) } /* end switch */ done: + if (buf) + HDfree(buf); return 0; } /* end list_lnk() */ @@ -2008,9 +2151,9 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) /* Retrieve info for object to list */ if(H5Oget_info_by_name(file, oname, &oi, H5P_DEFAULT) < 0) { - if(iter->ext_target) { + if(iter->symlink_target) { HDfputs("{**NOT FOUND**}\n", stdout); - iter->ext_target = FALSE; + iter->symlink_target = FALSE; } else display_obj_name(stdout, iter, oname, "**NOT FOUND**"); @@ -2020,7 +2163,7 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) /* Check for group iteration */ if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) { /* Get ID for group */ - if(!iter->ext_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) { + if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) { fprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname); return 0; /* Previously "continue", when this code was in main(). * We don't "continue" here in order to close the file @@ -2032,10 +2175,10 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) iter->name_start = iter->base_len; /* Specified name is a group. List the complete contents of the group. */ - h5trav_visit(file, oname, (hbool_t) (display_root_g || iter->ext_target), recursive_g, list_obj, list_lnk, iter); + h5trav_visit(file, oname, (hbool_t) (display_root_g || iter->symlink_target), recursive_g, list_obj, list_lnk, iter); /* Close group */ - if(!iter->ext_target) + if(!iter->symlink_target) H5Gclose(iter->gid); } /* end if */ else { @@ -2182,6 +2325,9 @@ main(int argc, const char *argv[]) const char *preferred_driver = NULL; int err_openfile = 0; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ h5tools_init(); @@ -2208,6 +2354,8 @@ main(int argc, const char *argv[]) data_g = TRUE; } else if(!HDstrcmp(argv[argno], "--errors")) { show_errors_g = TRUE; + } else if(!HDstrcmp(argv[argno], "--follow-symlinks")) { + follow_symlink_g = TRUE; } else if(!HDstrcmp(argv[argno], "--external")) { follow_elink_g = TRUE; } else if(!HDstrcmp(argv[argno], "--full")) { @@ -2249,7 +2397,7 @@ main(int argc, const char *argv[]) } else if(!HDstrcmp(argv[argno], "--verbose")) { verbose_g++; } else if(!HDstrcmp(argv[argno], "--version")) { - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); } else if(!HDstrcmp(argv[argno], "--hexdump")) { hexdump_g = TRUE; @@ -2325,7 +2473,7 @@ main(int argc, const char *argv[]) break; case 'V': /* --version */ - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); case 'x': /* --hexdump */ @@ -2378,7 +2526,7 @@ main(int argc, const char *argv[]) while(argno < argc) { H5L_info_t li; iter_t iter; - elink_trav_t elink_list; + symlink_trav_t symlink_list; size_t u; fname = HDstrdup(argv[argno++]); @@ -2440,12 +2588,12 @@ main(int argc, const char *argv[]) iter.fname = fname; iter.fid = file; iter.gid = -1; - iter.ext_target = FALSE; - iter.elink_list = &elink_list; + iter.symlink_target = FALSE; + iter.symlink_list = &symlink_list; - /* Initialize list of visited external links */ - elink_list.nused = elink_list.nalloc = 0; - elink_list.objs = NULL; + /* Initialize list of visited symbolic links */ + symlink_list.nused = symlink_list.nalloc = 0; + symlink_list.objs = NULL; /* Check for root group as object name */ if(HDstrcmp(oname, root_name)) { @@ -2474,11 +2622,14 @@ main(int argc, const char *argv[]) if(x) HDfree(oname); - for(u=0; u < elink_list.nused; u++) { - HDfree(elink_list.objs[u].file); - HDfree(elink_list.objs[u].path); + for(u=0; u < symlink_list.nused; u++) + { + if (symlink_list.objs[u].type == H5L_TYPE_EXTERNAL) + HDfree(symlink_list.objs[u].file); + + HDfree(symlink_list.objs[u].path); } - HDfree(elink_list.objs); + HDfree(symlink_list.objs); } /* end while */ if (err_openfile) diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index 5c81b6d..2f681ac 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -15,6 +15,10 @@ # # Tests for the h5ls tool +TESTNAME=h5ls +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + H5LS=h5ls # The tool name H5LS_BIN=`pwd`/$H5LS # The path of the tool binary @@ -26,6 +30,7 @@ WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" nerrors=0 verbose=yes +h5haveexitcode=yes # default is yes # The build (current) directory might be different than the source directory. if test -z "$srcdir"; then @@ -33,6 +38,13 @@ if test -z "$srcdir"; then fi test -d ../testfiles || mkdir ../testfiles +# RUNSERIAL is used. Check if it can return exit code from executalbe correctly. +if [ -n "$RUNSERIAL_NOEXITCODE" ]; then + echo "***Warning*** Serial Exit Code is not passed back to shell corretly." + echo "***Warning*** Exit code checking is skipped." + h5haveexitcode=no +fi + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". TESTING() { @@ -70,7 +82,7 @@ TOOLTEST() { exitcode=$? cat $actual_err >> $actual - if [ $exitcode -ne $retvalexpect ]; then + if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" if [ yes = "$verbose" ]; then @@ -129,17 +141,32 @@ TOOLTEST tdset-1.ls 0 -w80 -r -d tdset.h5 # test for displaying soft links TOOLTEST tslink-1.ls 0 -w80 -r tslink.h5 -# test for displaying external and user-defined links +# test for displaying more soft links with --follow-symlinks +TOOLTEST tsoftlinks-1.ls 0 --follow-symlinks tsoftlinks.h5 +TOOLTEST tsoftlinks-2.ls 0 --follow-symlinks -r tsoftlinks.h5 +TOOLTEST tsoftlinks-3.ls 0 --follow-symlinks tsoftlinks.h5/group1 +TOOLTEST tsoftlinks-4.ls 0 --follow-symlinks -r tsoftlinks.h5/group1 +TOOLTEST tsoftlinks-5.ls 0 --follow-symlinks tsoftlinks.h5/soft_dset1 + +# test for displaying external and user-defined links with --follow-symlinks TOOLTEST textlink-1.ls 0 -w80 -r textlink.h5 -TOOLTEST textlinksrc-1.ls 0 -w80 -Er textlinksrc.h5 -TOOLTEST textlinksrc-2.ls 0 -w80 -Erv textlinksrc.h5/ext_link5 -TOOLTEST textlinksrc-3.ls 0 -w80 -Er textlinksrc.h5/ext_link1 +TOOLTEST textlinksrc-1.ls 0 -w80 --follow-symlinks -r textlinksrc.h5 +TOOLTEST textlinksrc-2.ls 0 -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5 +TOOLTEST textlinksrc-3.ls 0 -w80 --follow-symlinks -r textlinksrc.h5/ext_link1 TOOLTEST textlinksrc-4.ls 0 -w80 -r textlinksrc.h5 TOOLTEST textlinksrc-5.ls 0 -w80 -r textlinksrc.h5/ext_link1 -TOOLTEST textlinksrc-6.ls 0 -w80 -E textlinksrc.h5 -TOOLTEST textlinksrc-7.ls 0 -w80 -E textlinksrc.h5/ext_link1 +TOOLTEST textlinksrc-6.ls 0 -w80 --follow-symlinks textlinksrc.h5 +TOOLTEST textlinksrc-7.ls 0 -w80 --follow-symlinks textlinksrc.h5/ext_link1 TOOLTEST tudlink-1.ls 0 -w80 -r tudlink.h5 +# test for displaying external links with -E +# the option -E will be depriciated but keep it for backward compatibility +TOOLTEST textlinksrc-1-old.ls 0 -w80 -Er textlinksrc.h5 +TOOLTEST textlinksrc-2-old.ls 0 -w80 -Erv textlinksrc.h5/ext_link5 +TOOLTEST textlinksrc-3-old.ls 0 -w80 -Er textlinksrc.h5/ext_link1 +TOOLTEST textlinksrc-6-old.ls 0 -w80 -E textlinksrc.h5 +TOOLTEST textlinksrc-7-old.ls 0 -w80 -E textlinksrc.h5/ext_link1 + # tests for hard links TOOLTEST thlink-1.ls 0 -w80 thlink.h5 @@ -194,7 +221,9 @@ fi TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5 if test $nerrors -eq 0 ; then - echo "All h5ls tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt new file mode 100644 index 0000000..cbf40a5 --- /dev/null +++ b/tools/h5repack/CMakeLists.txt @@ -0,0 +1,563 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5REPACK) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add h5Repack executables and tests +# -------------------------------------------------------------------- +SET (REPACK_COMMON_SRCS + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_copy.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_filters.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_opttable.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_parse.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_refs.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_verify.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack.c +) +INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR}) +ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) +H5_NAMING (h5repack) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5repack + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5repack) + +IF (BUILD_TESTING) + ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) + H5_NAMING (testh5repack_detect_szip) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testh5repack_detect_szip + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + + ADD_TEST (NAME testh5repack_detect_szip COMMAND $) + IF (HDF5_ENABLE_SZIP_SUPPORT) + SET (passRegex "yes") + SET_TESTS_PROPERTIES (testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") + ELSE (HDF5_ENABLE_SZIP_SUPPORT) + SET (passRegex "no") + SET_TESTS_PROPERTIES (testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + + ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) + H5_NAMING (h5repacktest) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5repacktest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + + ADD_TEST (NAME h5repacktest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + h5repacktest + testh5repack_detect_szip + ) + + + SET (INFO_FILE testfiles/h5repack.info) + + SET (FILE0 h5repack_fill.h5) + SET (FILE1 h5repack_objs.h5) + SET (FILE2 h5repack_attr.h5) + SET (FILE3 h5repack_hlink.h5) + SET (FILE4 h5repack_layout.h5) + SET (FILE5 h5repack_early.h5) + SET (FILE7 h5repack_szip.h5) + SET (FILE8 h5repack_deflate.h5) + SET (FILE9 h5repack_shuffle.h5) + SET (FILE10 h5repack_fletcher.h5) + SET (FILE11 h5repack_filters.h5) + SET (FILE12 h5repack_nbit.h5) + SET (FILE13 h5repack_soffset.h5) + SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) + SET (FILE15 h5repack_named_dtypes.h5) + SET (FILE16 tfamily%05d.h5) # located in common testfiles folder + SET (FILE_REF h5repack_refs.h5) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_TEST_FILES + h5repack_ext.bin + ublock.bin + h5repack.info + h5repack_attr.h5 + h5repack_deflate.h5 + h5repack_early.h5 + h5repack_ext.h5 + h5repack_fill.h5 + h5repack_filters.h5 + h5repack_fletcher.h5 + h5repack_hlink.h5 + h5repack_layout.h5 + h5repack_layouto.h5 + h5repack_named_dtypes.h5 + h5repack_nbit.h5 + h5repack_objs.h5 + h5repack_refs.h5 + h5repack_shuffle.h5 + h5repack_soffset.h5 + h5repack_szip.h5 + ) + SET (HDF5_COMMON_TEST_FILES + tfamily00000.h5 + tfamily00001.h5 + tfamily00002.h5 + tfamily00003.h5 + tfamily00004.h5 + tfamily00005.h5 + tfamily00006.h5 + tfamily00007.h5 + tfamily00008.h5 + tfamily00009.h5 + tfamily00010.h5 + ) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5repack + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + FOREACH (h5c_file ${HDF5_COMMON_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5c_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5repack + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5c_file} ${dest} + ) + ENDFOREACH (h5c_file ${HDF5_COMMON_TEST_FILES}) + + + MACRO (ADD_H5_TEST testname testtype testfile) + IF (${testtype} STREQUAL "SKIP") + MESSAGE (STATUS "SKIP ${testfile} ${ARGN}") + ELSE (${testtype} STREQUAL "SKIP") + ADD_TEST ( + NAME H5REPACK-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + ) + ADD_TEST ( + NAME H5REPACK-DIFF_${testname} + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + ) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_H5_TEST testname testfile testtype) + +# +# The tests +# We use the files generated by h5repacktst +# Each run generates ".out.h5" and the tool h5diff is used to +# compare the input and output files +# +# the tests are the same as the program h5repacktst, but run from the CLI +# + +# See which filters are usable (and skip tests for filters we +# don't have). Do this by searching H5pubconf.h to see which +# filters are defined. + +# detect whether the encoder is present. +SET (USE_FILTER_SZIP_ENCODER "no") +IF (HDF5_ENABLE_SZIP_ENCODING) + SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) +ENDIF (HDF5_ENABLE_SZIP_ENCODING) + +IF (H5_HAVE_FILTER_DEFLATE) + SET (USE_FILTER_DEFLATE "true") +ENDIF (H5_HAVE_FILTER_DEFLATE) + +IF (H5_HAVE_FILTER_SZIP) + SET (USE_FILTER_SZIP "true") +ENDIF (H5_HAVE_FILTER_SZIP) + +IF (H5_HAVE_FILTER_SHUFFLE) + SET (USE_FILTER_SHUFFLE "true") +ENDIF (H5_HAVE_FILTER_SHUFFLE) + +IF (H5_HAVE_FILTER_FLETCHER32) + SET (USE_FILTER_FLETCHER32 "true") +ENDIF (H5_HAVE_FILTER_FLETCHER32) + +IF (H5_HAVE_FILTER_NBIT) + SET (USE_FILTER_NBIT "true") +ENDIF (H5_HAVE_FILTER_NBIT) + +IF (H5_HAVE_FILTER_SCALEOFFSET) + SET (USE_FILTER_SCALEOFFSET "true") +ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + +# copy files (these files have no filters) +ADD_H5_TEST (fill "TEST" ${FILE0}) +ADD_H5_TEST (objs "TEST" ${FILE1}) +ADD_H5_TEST (attr "TEST" ${FILE2}) +ADD_H5_TEST (hlink "TEST" ${FILE3}) +ADD_H5_TEST (layout "TEST" ${FILE4}) +ADD_H5_TEST (early "TEST" ${FILE5}) + +# use $FILE4 to write some filters (this file has no filters) + +# gzip with individual object +SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) + +# gzip for all +SET (arg ${FILE4} -f GZIP=1) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) + +# szip with individual object +SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) +ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) + +# szip for all +SET (arg ${FILE4} -f SZIP=8,NN) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) +ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) + +# shuffle with individual object +SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SHUFFLE) +ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) + +# shuffle for all +SET (arg ${FILE4} -f SHUF) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SHUFFLE) +ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) + +# fletcher32 with individual object +SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_FLETCHER32) +ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) + +# fletcher32 for all +SET (arg ${FILE4} -f FLET) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_FLETCHER32) +ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) + +# all filters +SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) + +########################################################### +# the following tests assume the input files have filters +########################################################### + +# szip copy +SET (arg ${FILE7}) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) +ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) + +# szip remove +SET (arg ${FILE7} --filter=dset_szip:NONE) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) +ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) + +# deflate copy +SET (arg ${FILE8}) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) + +# deflate remove +SET (arg ${FILE8} -f dset_deflate:NONE) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) + +# shuffle copy +SET (arg ${FILE9}) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SHUFFLE) +ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) + +# shuffle remove +SET (arg ${FILE9} -f dset_shuffle:NONE) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SHUFFLE) +ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) + +# fletcher32 copy +SET (arg ${FILE10}) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_FLETCHER32) +ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) + +# fletcher32 remove +SET (arg ${FILE10} -f dset_fletcher32:NONE) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_FLETCHER32) +ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) + +# nbit copy +SET (arg ${FILE12}) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_NBIT) +ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) + +# nbit remove +SET (arg ${FILE12} -f dset_nbit:NONE) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_NBIT) +ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) + +# nbit add +SET (arg ${FILE12} -f dset_int31:NBIT) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_NBIT) +ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) + +# scaleoffset copy +SET (arg ${FILE13}) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SCALEOFFSET) +ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) + +# scaleoffset add +SET (arg ${FILE13} -f dset_none:SOFF=31,IN) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SCALEOFFSET) +ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) + +# scaleoffset remove +SET (arg ${FILE13} -f dset_scaleoffset:NONE) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SCALEOFFSET) +ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) + +# remove all filters +SET (arg ${FILE11} -f NONE) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) +ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) + +#filter conversions + +SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) + +SET (arg ${FILE7} -f dset_szip:GZIP=1) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) + +#limit +SET (arg ${FILE4} -f GZIP=1 -m 1024) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (deflate_limit ${TESTTYPE} ${arg}) + +#file +SET (arg ${FILE4} -e ${INFO_FILE}) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) + +######################################################### +# layout options (these files have no filters) +######################################################### + +ADD_H5_TEST (dset2_chunk_20x10 "TEST" ${FILE4} --layout=dset2:CHUNK=20x10) +ADD_H5_TEST (chunk_20x10 "TEST" ${FILE4} -l CHUNK=20x10) +ADD_H5_TEST (dset2_conti "TEST" ${FILE4} -l dset2:CONTI) +ADD_H5_TEST (conti "TEST" ${FILE4} -l CONTI) +ADD_H5_TEST (dset2_compa "TEST" ${FILE4} -l dset2:COMPA) +ADD_H5_TEST (compa "TEST" ${FILE4} -l COMPA) + + +################################################################ +# layout conversions (file has no filters) +############################################################### + +ADD_H5_TEST (dset_compa_conti "TEST" ${FILE4} -l dset_compact:CONTI) +ADD_H5_TEST (dset_compa_chunk "TEST" ${FILE4} -l dset_compact:CHUNK=2x5) +ADD_H5_TEST (dset_compa_compa "TEST" ${FILE4} -l dset_compact:COMPA) +ADD_H5_TEST (dset_conti_compa "TEST" ${FILE4} -l dset_contiguous:COMPA) +ADD_H5_TEST (dset_conti_chunk "TEST" ${FILE4} -l dset_contiguous:CHUNK=3x6) +ADD_H5_TEST (dset_conti_conti "TEST" ${FILE4} -l dset_contiguous:CONTI) +ADD_H5_TEST (chunk_compa "TEST" ${FILE4} -l dset_chunk:COMPA) +ADD_H5_TEST (chunk_conti "TEST" ${FILE4} -l dset_chunk:CONTI) +ADD_H5_TEST (chunk_18x13 "TEST" ${FILE4} -l dset_chunk:CHUNK=18x13) + +# Native option +# Do not use FILE1, as the named dtype will be converted to native, and h5diff will +# report a difference. +ADD_H5_TEST (native_fill "TEST" ${FILE0} -n) +ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) + + +# latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) +SET (arg ${FILE4} --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (layout_long_switches ${TESTTYPE} ${arg}) + +# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) +SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (layout_short_switches ${TESTTYPE} ${arg}) + +# several global filters +SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) +SET (TESTTYPE "TEST") +IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) +ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) + +# syntax of -i infile -o outfile +# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) +SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) +SET (TESTTYPE "LEGACY") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +#ADD_H5_TEST (old_style_layout_short_switches ${TESTTYPE} ${arg}) + +# add a userblock to file +SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) +ADD_H5_TEST (add_userblock "TEST" ${arg}) + +# add alignment +SET (arg ${FILE1} -t 1 -a 1) +ADD_H5_TEST (add_alignment "TEST" ${arg}) + +# Check repacking file with old version of layout message (should get upgraded +# to new version and be readable, etc.) +ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) + +# test for datum size > H5TOOLS_MALLOCSIZE +ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) + +# Check repacking file with committed datatypes in odd configurations +ADD_H5_TEST (committed_dt "TEST" ${FILE15}) + +# tests family driver (file is located in common testfiles folder, uses TOOLTEST1 +#ADD_H5_TEST ( family "FAMILY" ${FILE16}) + +# test various references (bug 1814) +ADD_H5_TEST (bug1814 "TEST" ${FILE_REF}) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5repack + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 7cb956e..ce18bb9 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -206,12 +206,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 4632ea0..eaca09e 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -22,10 +22,6 @@ #include "h5tools.h" #include "h5tools_utils.h" - -extern char *progname; - - /*------------------------------------------------------------------------- * File: h5repack.c * Purpose: Public API functions @@ -162,7 +158,7 @@ int h5repack_addfilter(const char* str, if(options->n_filter_g > H5_REPACK_MAX_NFILTERS) { - error_msg(progname, "maximum number of filters exceeded for <%s>\n", str); + error_msg("maximum number of filters exceeded for <%s>\n", str); free(obj_list); return -1; } @@ -200,7 +196,7 @@ int h5repack_addlayout(const char* str, init_packobject(&pack); if (options->all_layout==1){ - error_msg(progname, "invalid layout input: 'all' option \ + error_msg("invalid layout input: 'all' option \ is present with other objects <%s>\n",str); return -1; } @@ -619,7 +615,7 @@ static int check_options(pack_opt_t *options) break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: - error_msg(progname, "invalid layout\n"); + error_msg("invalid layout\n"); return -1; default: strcpy(slayout,"invalid layout\n"); @@ -660,7 +656,7 @@ static int check_options(pack_opt_t *options) if (options->all_layout==1 && has_ck) { - error_msg(progname, "invalid chunking input: 'all' option\ + error_msg("invalid chunking input: 'all' option\ is present with other objects\n"); return -1; } @@ -722,7 +718,7 @@ static int check_options(pack_opt_t *options) if (options->all_filter==1 && has_cp) { - error_msg(progname, "invalid compression input: 'all' option\ + error_msg("invalid compression input: 'all' option\ is present with other objects\n"); return -1; } @@ -734,24 +730,24 @@ static int check_options(pack_opt_t *options) if (options->grp_compact < 0) { - error_msg(progname, "invalid maximum number of links to store as header messages\n"); + error_msg("invalid maximum number of links to store as header messages\n"); return -1; } if (options->grp_indexed < 0) { - error_msg(progname, "invalid minimum number of links to store in the indexed format\n"); + error_msg("invalid minimum number of links to store in the indexed format\n"); return -1; } if (options->grp_indexed > options->grp_compact) { - error_msg(progname, "minimum indexed size is greater than the maximum compact size\n"); + error_msg("minimum indexed size is greater than the maximum compact size\n"); return -1; } for (i=0; i<8; i++) { if (options->msg_size[i]<0) { - error_msg(progname, "invalid shared message size\n"); + error_msg("invalid shared message size\n"); return -1; } } @@ -773,7 +769,7 @@ static int check_options(pack_opt_t *options) if ( options->ublock_filename == NULL && options->ublock_size != 0 ) { - error_msg(progname, "file name missing for user block\n", + error_msg("file name missing for user block\n", options->ublock_filename); return -1; } @@ -786,7 +782,7 @@ static int check_options(pack_opt_t *options) if ( options->alignment == 0 && options->threshold != 0 ) { - error_msg(progname, "alignment for H5Pset_alignment missing\n"); + error_msg("alignment for H5Pset_alignment missing\n"); return -1; } @@ -858,7 +854,7 @@ static int check_objects(const char* fname, /* the input object names are present in the file and are valid */ if(h5trav_getindext(name, travt) < 0) { - error_msg(progname, "%s Could not find <%s> in file <%s>. Exiting...\n", + error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", (options->verbose?"\n":""),name,fname); goto out; } @@ -980,7 +976,7 @@ static const char* get_sfilter(H5Z_filter_t filtn) else if (filtn==H5Z_FILTER_SCALEOFFSET) return "SOFF"; else { - error_msg(progname, "input error in filter type\n"); + error_msg("input error in filter type\n"); exit(EXIT_FAILURE); } } diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 12fdabc..c3475aa 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -30,7 +30,6 @@ * globals *------------------------------------------------------------------------- */ -extern char *progname; /*------------------------------------------------------------------------- * macros @@ -90,7 +89,7 @@ int copy_objects(const char* fnamein, */ if((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { - error_msg(progname, "<%s>: %s\n", fnamein, H5FOPENERROR ); + error_msg("<%s>: %s\n", fnamein, H5FOPENERROR ); goto out; } @@ -100,13 +99,13 @@ int copy_objects(const char* fnamein, if((fcpl_in = H5Fget_create_plist(fidin)) < 0) { - error_msg(progname, "failed to retrieve file creation property list\n"); + error_msg("failed to retrieve file creation property list\n"); goto out; } if(H5Pget_userblock(fcpl_in, &ub_size) < 0) { - error_msg(progname, "failed to retrieve userblock size\n"); + error_msg("failed to retrieve userblock size\n"); goto out; } @@ -114,7 +113,7 @@ int copy_objects(const char* fnamein, { if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0) { - error_msg(progname, "failed to retrieve file space strategy\n"); + error_msg("failed to retrieve file space strategy\n"); goto out; } } @@ -123,14 +122,14 @@ int copy_objects(const char* fnamein, { if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0) { - error_msg(progname, "failed to retrieve file space threshold\n"); + error_msg("failed to retrieve file space threshold\n"); goto out; } } if(H5Pclose(fcpl_in) < 0) { - error_msg(progname, "failed to close property list\n"); + error_msg("failed to close property list\n"); goto out; } } @@ -141,7 +140,7 @@ int copy_objects(const char* fnamein, /* Create file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg(progname, "fail to create a file creation property list\n"); + error_msg("fail to create a file creation property list\n"); goto out; } @@ -149,7 +148,7 @@ int copy_objects(const char* fnamein, { if(H5Pset_userblock(fcpl, ub_size) < 0) { - error_msg(progname, "failed to set non-default userblock size\n"); + error_msg("failed to set non-default userblock size\n"); goto out; } } @@ -162,7 +161,7 @@ int copy_objects(const char* fnamein, /* (So that it is created in "dense storage" form) */ if(H5Pset_link_phase_change(fcpl, (unsigned)options->grp_compact, (unsigned)options->grp_indexed) < 0) { - error_msg(progname, "fail to adjust group creation parameters for root group\n"); + error_msg("fail to adjust group creation parameters for root group\n"); goto out; } @@ -204,7 +203,7 @@ int copy_objects(const char* fnamein, { if(H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) { - error_msg(progname, "fail to set the number of shared object header message indexes\n"); + error_msg("fail to set the number of shared object header message indexes\n"); goto out; } @@ -212,7 +211,7 @@ int copy_objects(const char* fnamein, for(i = 0; i < (nindex - 1); i++) { if(H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) { - error_msg(progname, "fail to configure the specified shared object header message index\n"); + error_msg("fail to configure the specified shared object header message index\n"); goto out; } /* end if */ } /* end for */ @@ -221,13 +220,13 @@ int copy_objects(const char* fnamein, /* Create file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg(progname, "Could not create file access property list\n"); + error_msg("Could not create file access property list\n"); goto out; } /* end if */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { - error_msg(progname, "Could not set property for using latest version of the format\n"); + error_msg("Could not set property for using latest version of the format\n"); goto out; } /* end if */ } /* end if */ @@ -254,7 +253,7 @@ int copy_objects(const char* fnamein, /* set user block size */ if(H5Pset_userblock(fcpl, options->ublock_size) < 0) { - error_msg(progname, "failed to set userblock size\n"); + error_msg("failed to set userblock size\n"); goto out; } @@ -266,14 +265,14 @@ int copy_objects(const char* fnamein, /* create a file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg(progname, "fail to create a file creation property list\n"); + error_msg("fail to create a file creation property list\n"); goto out; } /* set user block size */ if(H5Pset_userblock(fcpl, options->ublock_size) < 0) { - error_msg(progname, "failed to set userblock size\n"); + error_msg("failed to set userblock size\n"); goto out; } @@ -298,7 +297,7 @@ int copy_objects(const char* fnamein, if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { - error_msg(progname, "failed to set alignment\n"); + error_msg("failed to set alignment\n"); goto out; } @@ -310,13 +309,13 @@ int copy_objects(const char* fnamein, /* create a file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg(progname, "Could not create file access property list\n"); + error_msg("Could not create file access property list\n"); goto out; } if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { - error_msg(progname, "failed to set alignment\n"); + error_msg("failed to set alignment\n"); goto out; } @@ -330,7 +329,7 @@ int copy_objects(const char* fnamein, /* set file space strategy and free space threshold */ if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) { - error_msg(progname, "failed to set file space strategy & threshold\n"); + error_msg("failed to set file space strategy & threshold\n"); goto out; } } @@ -339,14 +338,14 @@ int copy_objects(const char* fnamein, /* create a file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg(progname, "fail to create a file creation property list\n"); + error_msg("fail to create a file creation property list\n"); goto out; } /* set file space strategy and free space threshold */ if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) { - error_msg(progname, "failed to set file space strategy & threshold \n"); + error_msg("failed to set file space strategy & threshold \n"); goto out; } } @@ -363,7 +362,7 @@ int copy_objects(const char* fnamein, if((fidout = H5Fcreate(fnameout,H5F_ACC_TRUNC, fcpl, fapl)) < 0) { - error_msg(progname, "<%s>: Could not create file\n", fnameout ); + error_msg("<%s>: Could not create file\n", fnameout ); goto out; } @@ -376,7 +375,7 @@ int copy_objects(const char* fnamein, { if ( copy_user_block( options->ublock_filename, fnameout, options->ublock_size) < 0 ) { - error_msg(progname, "Could not copy user block. Exiting...\n"); + error_msg("Could not copy user block. Exiting...\n"); goto out; } @@ -400,7 +399,7 @@ int copy_objects(const char* fnamein, */ if(do_copy_objects(fidin, fidout, travt, options) < 0) { - error_msg(progname, "<%s>: Could not copy data to: %s\n", fnamein, fnameout); + error_msg("<%s>: Could not copy data to: %s\n", fnamein, fnameout); goto out; } /* end if */ @@ -442,7 +441,7 @@ int copy_objects(const char* fnamein, { if ( copy_user_block(fnamein, fnameout, ub_size) < 0 ) { - error_msg(progname, "Could not copy user block. Exiting...\n"); + error_msg("Could not copy user block. Exiting...\n"); goto out; } @@ -1406,19 +1405,19 @@ void print_user_block(const char *filename, hid_t fid) /* get user block size */ if(( fcpl = H5Fget_create_plist(fid)) < 0) { - error_msg(progname, "failed to retrieve file creation property list\n"); + error_msg("failed to retrieve file creation property list\n"); goto done; } if(H5Pget_userblock(fcpl, &ub_size) < 0) { - error_msg(progname, "failed to retrieve userblock size\n"); + error_msg("failed to retrieve userblock size\n"); goto done; } if(H5Pclose(fcpl) < 0) { - error_msg(progname, "failed to close property list\n"); + error_msg("failed to close property list\n"); goto done; } diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index c7d8b1e..d4a3479 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -14,6 +14,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5test.h" #include "h5tools.h" /* number of members in an array */ diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index d6998d0..9f8a701 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -20,6 +20,8 @@ #include "h5tools_utils.h" #include "h5repack.h" +/* Name of tool */ +#define PROGRAMNAME "h5repack" static void usage(const char *prog); static void parse_command_line(int argc, const char **argv, pack_opt_t* options); @@ -27,8 +29,6 @@ static void read_info(const char *filename,pack_opt_t *options); /* module-scoped variables */ -const char *progname = "h5repack"; -int d_status = EXIT_SUCCESS; static int has_i_o = 0; const char *infile = NULL; const char *outfile = NULL; @@ -107,6 +107,9 @@ int main(int argc, const char **argv) pack_opt_t options; /*the global options */ int ret=-1; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* initialize options */ h5repack_init(&options, 0, 0, 0, (hsize_t)0); @@ -123,8 +126,8 @@ int main(int argc, const char **argv) if ( strcmp( infile, outfile ) == 0 ) { - error_msg(progname, "file names cannot be the same\n"); - usage(progname); + error_msg("file names cannot be the same\n"); + usage(h5tools_getprogname()); exit(EXIT_FAILURE); } @@ -132,8 +135,8 @@ int main(int argc, const char **argv) else { - error_msg(progname, "file names missing\n"); - usage(progname); + error_msg("file names missing\n"); + usage(h5tools_getprogname()); exit(EXIT_FAILURE); } } @@ -316,10 +319,10 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'h': - usage(progname); + usage(h5tools_getprogname()); exit(EXIT_SUCCESS); case 'V': - print_version(progname); + print_version(h5tools_getprogname()); exit(EXIT_SUCCESS); case 'v': options->verbose = 1; @@ -329,7 +332,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) /* parse the -f filter option */ if (h5repack_addfilter( opt_arg, options)<0) { - error_msg(progname, "in parsing filter\n"); + error_msg("in parsing filter\n"); exit(EXIT_FAILURE); } break; @@ -338,7 +341,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) /* parse the -l layout option */ if (h5repack_addlayout( opt_arg, options)<0) { - error_msg(progname, "in parsing layout\n"); + error_msg("in parsing layout\n"); exit(EXIT_FAILURE); } break; @@ -349,7 +352,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->min_comp = atoi( opt_arg ); if ((int)options->min_comp<=0) { - error_msg(progname, "invalid minimum compress size <%s>\n", opt_arg ); + error_msg("invalid minimum compress size <%s>\n", opt_arg ); exit(EXIT_FAILURE); } break; @@ -442,7 +445,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->alignment = atol( opt_arg ); if ( options->alignment < 1 ) { - error_msg(progname, "invalid alignment size\n", opt_arg ); + error_msg("invalid alignment size\n", opt_arg ); exit(EXIT_FAILURE); } break; @@ -461,7 +464,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) else if(!strcmp(strategy, "VFD")) options->fs_strategy = H5F_FILE_SPACE_VFD; else { - error_msg(progname, "invalid file space management strategy\n", opt_arg ); + error_msg("invalid file space management strategy\n", opt_arg ); exit(EXIT_FAILURE); } break; @@ -481,8 +484,8 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) /* check for file names to be processed */ if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { - error_msg(progname, "missing file names\n"); - usage(progname); + error_msg("missing file names\n"); + usage(h5tools_getprogname()); exit(EXIT_FAILURE); } } @@ -515,7 +518,7 @@ void read_info(const char *filename, int i, rc=1; if ((fp = fopen(filename, "r")) == (FILE *)NULL) { - error_msg(progname, "cannot open options file %s\n", filename); + error_msg("cannot open options file %s\n", filename); exit(EXIT_FAILURE); } @@ -552,7 +555,7 @@ void read_info(const char *filename, comp_info[i-1]='\0'; /*cut the last " */ if (h5repack_addfilter(comp_info,options)==-1){ - error_msg(progname, "could not add compression option\n"); + error_msg("could not add compression option\n"); exit(EXIT_FAILURE); } } @@ -582,7 +585,7 @@ void read_info(const char *filename, comp_info[i-1]='\0'; /*cut the last " */ if (h5repack_addlayout(comp_info,options)==-1){ - error_msg(progname, "could not add chunck option\n"); + error_msg("could not add chunck option\n"); exit(EXIT_FAILURE); } } @@ -591,7 +594,7 @@ void read_info(const char *filename, *------------------------------------------------------------------------- */ else { - error_msg(progname, "bad file format for %s", filename); + error_msg("bad file format for %s", filename); exit(EXIT_FAILURE); } } diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index 7c87359..50f97bd 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -18,8 +18,6 @@ #include "h5repack.h" #include "h5tools_utils.h" -extern char *progname; - /*------------------------------------------------------------------------- * Function: init_packobject * @@ -67,7 +65,7 @@ static void aux_tblinsert_filter(pack_opttbl_t *table, } else { - error_msg(progname, "cannot insert the filter in this object.\ + error_msg("cannot insert the filter in this object.\ Maximum capacity exceeded\n"); } } @@ -126,7 +124,7 @@ static int aux_inctable(pack_opttbl_t *table, int n_objs ) table->size += n_objs; table->objs = (pack_info_t*)realloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs==NULL) { - error_msg(progname, "not enough memory for options table\n"); + error_msg("not enough memory for options table\n"); return -1; } for (i = table->nelems; i < table->size; i++) @@ -153,7 +151,7 @@ int options_table_init( pack_opttbl_t **tbl ) if(NULL == (table = (pack_opttbl_t *)malloc(sizeof(pack_opttbl_t)))) { - error_msg(progname, "not enough memory for options table\n"); + error_msg("not enough memory for options table\n"); return -1; } @@ -161,7 +159,7 @@ int options_table_init( pack_opttbl_t **tbl ) table->nelems = 0; if(NULL == (table->objs = (pack_info_t*)malloc(table->size * sizeof(pack_info_t)))) { - error_msg(progname, "not enough memory for options table\n"); + error_msg("not enough memory for options table\n"); free(table); return -1; } @@ -232,7 +230,7 @@ int options_add_layout( obj_list_t *obj_list, /* already chunk info inserted for this one; exit */ if (table->objs[i].chunk.rank>0) { - error_msg(progname, "chunk information already inserted for <%s>\n",obj_list[j].obj); + error_msg("chunk information already inserted for <%s>\n",obj_list[j].obj); exit(EXIT_FAILURE); } /* insert the layout info */ diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 2d8f040..d3a7419 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -21,8 +21,6 @@ #include "h5repack.h" #include "h5tools_utils.h" -extern char *progname; - /*------------------------------------------------------------------------- * Function: parse_filter * @@ -98,7 +96,7 @@ obj_list_t* parse_filter(const char *str, obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { - error_msg(progname, "could not allocate object list\n"); + error_msg("could not allocate object list\n"); return NULL; } *n_objs=n; @@ -121,7 +119,7 @@ obj_list_t* parse_filter(const char *str, if (end_obj+1==(int)len) { if (obj_list) free(obj_list); - error_msg(progname, "input Error: Invalid compression type in <%s>\n",str); + error_msg("input Error: Invalid compression type in <%s>\n",str); exit(EXIT_FAILURE); } @@ -159,7 +157,7 @@ obj_list_t* parse_filter(const char *str, c = str[u]; if (!isdigit(c) && l==-1){ if (obj_list) free(obj_list); - error_msg(progname, "compression parameter not digit in <%s>\n",str); + error_msg("compression parameter not digit in <%s>\n",str); exit(EXIT_FAILURE); } if (l==-1) @@ -179,7 +177,7 @@ obj_list_t* parse_filter(const char *str, filt->cd_values[j++]=H5_SZIP_EC_OPTION_MASK; else { - error_msg(progname, "szip mask must be 'NN' or 'EC' \n"); + error_msg("szip mask must be 'NN' or 'EC' \n"); exit(EXIT_FAILURE); } @@ -219,7 +217,7 @@ obj_list_t* parse_filter(const char *str, c = str[u]; if (!isdigit(c) && l==-1){ if (obj_list) free(obj_list); - error_msg(progname, "compression parameter is not a digit in <%s>\n",str); + error_msg("compression parameter is not a digit in <%s>\n",str); exit(EXIT_FAILURE); } if (l==-1) @@ -239,7 +237,7 @@ obj_list_t* parse_filter(const char *str, filt->cd_values[j++]=H5Z_SO_FLOAT_DSCALE; else { - error_msg(progname, "scale type must be 'IN' or 'DS' \n"); + error_msg("scale type must be 'IN' or 'DS' \n"); exit(EXIT_FAILURE); } @@ -263,7 +261,7 @@ obj_list_t* parse_filter(const char *str, c = str[u]; if (!isdigit(c)){ if (obj_list) free(obj_list); - error_msg(progname, "compression parameter is not a digit in <%s>\n",str); + error_msg("compression parameter is not a digit in <%s>\n",str); exit(EXIT_FAILURE); } stype[m]=c; @@ -309,7 +307,7 @@ obj_list_t* parse_filter(const char *str, if (no_param) { /*no more parameters, GZIP must have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "missing compression parameter in <%s>\n",str); + error_msg("missing compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -325,7 +323,7 @@ obj_list_t* parse_filter(const char *str, if (no_param) { /*no more parameters, SZIP must have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "missing compression parameter in <%s>\n",str); + error_msg("missing compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -341,7 +339,7 @@ obj_list_t* parse_filter(const char *str, if (m>0) { /*shuffle does not have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "extra parameter in SHUF <%s>\n",str); + error_msg("extra parameter in SHUF <%s>\n",str); exit(EXIT_FAILURE); } } @@ -356,7 +354,7 @@ obj_list_t* parse_filter(const char *str, if (m>0) { /*shuffle does not have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "extra parameter in FLET <%s>\n",str); + error_msg("extra parameter in FLET <%s>\n",str); exit(EXIT_FAILURE); } } @@ -371,7 +369,7 @@ obj_list_t* parse_filter(const char *str, if (m>0) { /*nbit does not have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "extra parameter in NBIT <%s>\n",str); + error_msg("extra parameter in NBIT <%s>\n",str); exit(EXIT_FAILURE); } } @@ -386,13 +384,13 @@ obj_list_t* parse_filter(const char *str, if (no_param) { /*no more parameters, SOFF must have parameter */ if (obj_list) free(obj_list); - error_msg(progname, "missing compression parameter in <%s>\n",str); + error_msg("missing compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } } else { if (obj_list) free(obj_list); - error_msg(progname, "invalid filter type in <%s>\n",str); + error_msg("invalid filter type in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -415,7 +413,7 @@ obj_list_t* parse_filter(const char *str, if (filt->cd_values[0]>9 ) { if (obj_list) free(obj_list); - error_msg(progname, "invalid compression parameter in <%s>\n",str); + error_msg("invalid compression parameter in <%s>\n",str); exit(EXIT_FAILURE); } break; @@ -430,19 +428,19 @@ obj_list_t* parse_filter(const char *str, if ((pixels_per_block%2)==1) { if (obj_list) free(obj_list); - error_msg(progname, "pixels_per_block is not even in <%s>\n",str); + error_msg("pixels_per_block is not even in <%s>\n",str); exit(EXIT_FAILURE); } if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) { if (obj_list) free(obj_list); - error_msg(progname, "pixels_per_block is too large in <%s>\n",str); + error_msg("pixels_per_block is too large in <%s>\n",str); exit(EXIT_FAILURE); } if ( (strcmp(smask,"NN")!=0) && (strcmp(smask,"EC")!=0) ) { if (obj_list) free(obj_list); - error_msg(progname, "szip mask must be 'NN' or 'EC' \n"); + error_msg("szip mask must be 'NN' or 'EC' \n"); exit(EXIT_FAILURE); } break; @@ -519,7 +517,7 @@ obj_list_t* parse_layout(const char *str, obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { - error_msg(progname, "could not allocate object list\n"); + error_msg("could not allocate object list\n"); return NULL; } *n_objs=n; @@ -543,7 +541,7 @@ obj_list_t* parse_layout(const char *str, if (end_obj+1==(int)len) { if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, no characters after : in <%s>\n",str); + error_msg("in parse layout, no characters after : in <%s>\n",str); exit(EXIT_FAILURE); } @@ -560,7 +558,7 @@ obj_list_t* parse_layout(const char *str, else if (strcmp(slayout,"CHUNK")==0) pack->layout=H5D_CHUNKED; else { - error_msg(progname, "in parse layout, not a valid layout in <%s>\n",str); + error_msg("in parse layout, not a valid layout in <%s>\n",str); exit(EXIT_FAILURE); } } @@ -584,7 +582,7 @@ obj_list_t* parse_layout(const char *str, if (j>(int)len) { if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> Chunk dimensions missing\n",str); + error_msg("in parse layout, <%s> Chunk dimensions missing\n",str); exit(EXIT_FAILURE); } @@ -598,7 +596,7 @@ obj_list_t* parse_layout(const char *str, && c!='N' && c!='O' && c!='N' && c!='E' ){ if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> Not a valid character in <%s>\n", + error_msg("in parse layout, <%s> Not a valid character in <%s>\n", sdim,str); exit(EXIT_FAILURE); } @@ -611,7 +609,7 @@ obj_list_t* parse_layout(const char *str, pack->chunk.chunk_lengths[c_index]=atoi(sdim); if (pack->chunk.chunk_lengths[c_index]==0) { if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> conversion to number in <%s>\n", + error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); exit(EXIT_FAILURE); } @@ -629,7 +627,7 @@ obj_list_t* parse_layout(const char *str, pack->chunk.chunk_lengths[c_index]=atoi(sdim); if (pack->chunk.chunk_lengths[c_index]==0){ if (obj_list) free(obj_list); - error_msg(progname, "in parse layout, <%s> conversion to number in <%s>\n", + error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); exit(EXIT_FAILURE); } diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index ac4570b..34c5dd6 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -14,9 +14,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5test.h" #include "h5tools_utils.h" -extern char *progname; static int verify_layout(hid_t pid, pack_info_t *obj); static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter); @@ -211,26 +211,26 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options /* Get file creation property list for input file */ if((fcpl_in = H5Fget_create_plist(fidin)) < 0) { - error_msg(progname, "failed to retrieve file creation property list\n"); + error_msg("failed to retrieve file creation property list\n"); goto error; } /* Get file space management info for input file */ if(H5Pget_file_space(fcpl_in, &in_strat, &in_thresh) < 0) { - error_msg(progname, "failed to retrieve file space strategy & threshold\n"); + error_msg("failed to retrieve file space strategy & threshold\n"); goto error; } /* Output file is already opened */ /* Get file creation property list for output file */ if((fcpl_out = H5Fget_create_plist(fidout)) < 0) { - error_msg(progname, "failed to retrieve file creation property list\n"); + error_msg("failed to retrieve file creation property list\n"); goto error; } /* Get file space management info for output file */ if(H5Pget_file_space(fcpl_out, &out_strat, &out_thresh) < 0) { - error_msg(progname, "failed to retrieve file space strategy & threshold\n"); + error_msg("failed to retrieve file space strategy & threshold\n"); goto error; } @@ -243,11 +243,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * as what is set via the strategy option */ if(!options->fs_strategy && out_strat != in_strat) { - error_msg(progname, "file space strategy not set as unexpected\n"); + error_msg("file space strategy not set as unexpected\n"); goto error; } else if(options->fs_strategy && out_strat!= options->fs_strategy) { - error_msg(progname, "file space strategy not set as unexpectec\n"); + error_msg("file space strategy not set as unexpectec\n"); goto error; } @@ -260,11 +260,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options * as what is set via the threshold option. */ if(!options->fs_threshold && out_thresh != in_thresh) { - error_msg(progname, "free space threshold not set as unexpected\n"); + error_msg("free space threshold not set as unexpected\n"); goto error; } else if(options->fs_threshold && out_thresh != options->fs_threshold) { - error_msg(progname, "free space threshold not set as unexpectec\n"); + error_msg("free space threshold not set as unexpectec\n"); goto error; } @@ -396,12 +396,12 @@ int h5repack_cmp_pl(const char *fname1, /* Open the files */ if ((fid1=H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) { - error_msg(progname, "<%s>: %s\n", fname1, H5FOPENERROR ); + error_msg("<%s>: %s\n", fname1, H5FOPENERROR ); return -1; } if ((fid2=H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) { - error_msg(progname, "<%s>: %s\n", fname2, H5FOPENERROR ); + error_msg("<%s>: %s\n", fname2, H5FOPENERROR ); H5Fclose(fid1); return -1; } @@ -450,7 +450,7 @@ int h5repack_cmp_pl(const char *fname1, if ( crt_order_flag1 != crt_order_flag2 ) { - error_msg(progname, "property lists for <%s> are different\n",trav->objs[i].name); + error_msg("property lists for <%s> are different\n",trav->objs[i].name); goto error; } @@ -478,7 +478,7 @@ int h5repack_cmp_pl(const char *fname1, if(ret == 0) { - error_msg(progname, "property lists for <%s> are different\n",trav->objs[i].name); + error_msg("property lists for <%s> are different\n",trav->objs[i].name); goto error; } diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 68763d7..e329082 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -91,9 +91,8 @@ const char *H5REPACK_FILENAMES[] = { #define H5REPACK_EXTFILE "h5repack_ext.bin" - -const char *progname = "h5repacktst"; -int d_status = EXIT_SUCCESS; +/* Name of tool */ +#define PROGRAMNAME "h5repacktst" #define DIM1 40 diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c index b16e0d4..332fcc5 100644 --- a/tools/h5repack/testh5repack_detect_szip.c +++ b/tools/h5repack/testh5repack_detect_szip.c @@ -16,8 +16,12 @@ #include #include "h5repack.h" #include "h5tools.h" +#include "h5test.h" +/* Name of tool */ +#define PROGRAMNAME "h5repack_detect_szip" + /*------------------------------------------------------------------------- * Function: main * @@ -40,6 +44,9 @@ int main(void) { + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + #ifdef H5_HAVE_FILTER_SZIP if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { printf("yes\n"); diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt new file mode 100644 index 0000000..b19d288 --- /dev/null +++ b/tools/h5stat/CMakeLists.txt @@ -0,0 +1,142 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5STAT) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5stat and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) +H5_NAMING (h5stat) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5stat + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5stat) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + H5_NAMING (h5stat_gentest) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (h5stat_gentest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5stat_gentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5stat_gentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + h5stat_help1.ddl + h5stat_help2.ddl + h5stat_filters.ddl + h5stat_filters-file.ddl + h5stat_filters-F.ddl + h5stat_filters-d.ddl + h5stat_filters-g.ddl + h5stat_filters-dT.ddl + h5stat_filters-UD.ddl + h5stat_filters-UT.ddl + h5stat_tsohm.ddl + h5stat_newgrat.ddl + h5stat_newgrat-UG.ddl + h5stat_newgrat-UA.ddl + ) + SET (HDF5_REFERENCE_TEST_FILES + h5stat_filters.h5 + h5stat_tsohm.h5 + h5stat_newgrat.h5 + ) + + FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #MESSAGE (STATUS " Translating ${ddl_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5stat + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} -l3 + ) + ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5stat + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5STAT-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + +# Test for help flag + ADD_H5_TEST (h5stat_help1 0 -h) + ADD_H5_TEST (h5stat_help2 0 --help) + +# Test file with groups, compressed datasets, user-applied fileters, etc. +# h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 + ADD_H5_TEST (h5stat_filters 0 h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-file 0 -f h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-F 0 -F h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-d 0 -d h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-g 0 -g h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-dT 0 -dT h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-UD 0 -D h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-UT 0 -T h5stat_filters.h5) +# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c +# as of release 1.8.0-alpha4 + ADD_H5_TEST (h5stat_tsohm 0 h5stat_tsohm.h5) +# h5stat_newgrat.h5 is generated by h5stat_gentest.c + ADD_H5_TEST (h5stat_newgrat 0 h5stat_newgrat.h5) + ADD_H5_TEST (h5stat_newgrat-UG 0 -G h5stat_newgrat.h5) + ADD_H5_TEST (h5stat_newgrat-UA 0 -A h5stat_newgrat.h5) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5stat + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 040423e..3d69400 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -215,12 +215,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index be74d21..fd21266 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -22,6 +22,9 @@ #include "h5trav.h" #include "hdf5.h" +/* Name of tool */ +#define PROGRAMNAME "h5stat" + /* Parameters to control statistics gathered */ #define SIZE_SMALL_GROUPS 10 #define SIZE_SMALL_ATTRS 10 @@ -114,10 +117,6 @@ typedef struct iter_t { } iter_t; -const char *progname = "h5stat"; -int d_status = EXIT_SUCCESS; - -/* Enable the printing of everything */ static int display_all = TRUE; /* Enable the printing of selected statistics */ @@ -812,11 +811,11 @@ parse_command_line(int argc, const char *argv[]) while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_SUCCESS); case 'V': - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); break; @@ -881,15 +880,15 @@ parse_command_line(int argc, const char *argv[]) break; default: - usage(progname); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* end switch */ } /* end while */ /* check for file name to be processed */ if (argc <= opt_ind) { - error_msg(progname, "missing file name\n"); - usage(progname); + error_msg("missing file name\n"); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* end if */ @@ -1541,6 +1540,9 @@ main(int argc, const char *argv[]) struct handler_t *hand; H5F_info2_t finfo; + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Disable error reporting */ H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -1548,7 +1550,7 @@ main(int argc, const char *argv[]) h5tools_init(); hand = parse_command_line (argc, argv); if(!hand) { - error_msg(progname, "unable to parse command line arguments \n"); + error_msg("unable to parse command line arguments \n"); leave(EXIT_FAILURE); } /* end if */ @@ -1558,7 +1560,7 @@ main(int argc, const char *argv[]) fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if(fid < 0) { - error_msg(progname, "unable to open file \"%s\"\n", fname); + error_msg("unable to open file \"%s\"\n", fname); leave(EXIT_FAILURE); } /* end if */ @@ -1566,12 +1568,12 @@ main(int argc, const char *argv[]) iter_init(&iter, fid); if(H5Fget_filesize(fid, &iter.filesize) < 0) - warn_msg(progname, "Unable to retrieve file size\n"); + warn_msg("Unable to retrieve file size\n"); assert(iter.filesize != 0); /* Get storge info for file-level structures */ if(H5Fget_info2(fid, &finfo) < 0) - warn_msg(progname, "Unable to retrieve file info\n"); + warn_msg("Unable to retrieve file info\n"); else { iter.super_size = finfo.super.super_size; iter.super_ext_size = finfo.super.super_ext_size; @@ -1583,18 +1585,18 @@ main(int argc, const char *argv[]) } /* end else */ if((fcpl = H5Fget_create_plist(fid)) < 0) - warn_msg(progname, "Unable to retrieve file creation property\n"); + warn_msg("Unable to retrieve file creation property\n"); if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0) - warn_msg(progname, "Unable to retrieve userblock size\n"); + warn_msg("Unable to retrieve userblock size\n"); if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0) - warn_msg(progname, "Unable to retrieve file space information\n"); + warn_msg("Unable to retrieve file space information\n"); assert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES); /* get information for free-space sections */ if(freespace_stats(fid, &iter) < 0) - warn_msg(progname, "Unable to retrieve freespace info\n"); + warn_msg("Unable to retrieve freespace info\n"); /* Walk the objects or all file */ if(display_object) { @@ -1603,7 +1605,7 @@ main(int argc, const char *argv[]) u = 0; while(hand[u].obj) { if (h5trav_visit(fid, hand[u].obj, TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg(progname, "Unable to traverse object \"%s\"\n", hand[u].obj); + warn_msg("Unable to traverse object \"%s\"\n", hand[u].obj); else print_statistics(hand[u].obj, &iter); u++; @@ -1611,7 +1613,7 @@ main(int argc, const char *argv[]) } /* end if */ else { if (h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg(progname, "Unable to traverse objects/links in file \"%s\"\n", fname); + warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname); else print_statistics("/", &iter); } /* end else */ @@ -1619,7 +1621,7 @@ main(int argc, const char *argv[]) if (hand) free(hand); if(H5Fclose(fid) < 0) { - error_msg(progname, "unable to close file \"%s\"\n", fname); + error_msg("unable to close file \"%s\"\n", fname); leave(EXIT_FAILURE); } diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt new file mode 100644 index 0000000..e12a7a6 --- /dev/null +++ b/tools/lib/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_LIB) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +#INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +#INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +SET (H5_TOOLS_LIB_SRCS + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_array.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_attr.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_dset.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_util.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_filters.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_ref.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_str.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_type.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_utils.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5trav.c +) + +SET (H5_TOOLS_LIB_HDRS + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5trav.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_utils.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_str.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_ref.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff.h +) + +#-- Always build a static library for linking the ${HDF5_LIB_NAME} tools together +ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_GLOBAL_VARIABLE( HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +H5_SET_LIB_OPTIONS ( + ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} + ${LIB_TYPE} + HDF5_TOOLS_LIB_NAME_RELEASE + HDF5_TOOLS_LIB_NAME_DEBUG +) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${H5_TOOLS_LIB_HDRS} + DESTINATION + include/tools + COMPONENT + toolsheaders +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_TOOLS_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib/tools COMPONENT toolslibraries + ARCHIVE DESTINATION lib/tools COMPONENT toolslibraries + RUNTIME DESTINATION bin/tools COMPONENT toolslibraries + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index d55d229..7568a89 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -185,12 +185,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 5f18ab3..c3d74b5 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -209,10 +209,10 @@ static int is_valid_options(diff_opt_t *options) } /* ------------------------------------------------------- - * only allow --no-dangling-links along with --follow-links */ + * only allow --no-dangling-links along with --follow-symlinks */ if(options->no_dangle_links && !options->follow_links) { - parallel_print("Error: --no-dangling-links must be used along with --follow-links option.\n"); + parallel_print("Error: --no-dangling-links must be used along with --follow-symlinks option.\n"); options->err_stat=1; ret = 0; goto out; diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 6718d9a..ede6ea0 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -55,15 +55,15 @@ typedef struct { extern "C" { #endif -hsize_t h5diff(const char *fname1, +H5TOOLS_DLL hsize_t h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, diff_opt_t *options); #ifdef H5_HAVE_PARALLEL -void phdiff_dismiss_workers(void); -void print_manager_output(void); +H5TOOLS_DLL void phdiff_dismiss_workers(void); +H5TOOLS_DLL void print_manager_output(void); #endif #ifdef __cplusplus diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 7d207ba..ab72025 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -521,10 +521,14 @@ struct subset_t { #include "h5tools_str.h" -extern FILE *rawdatastream; /* output stream for raw data */ -extern int bin_output; /* binary output */ -extern int bin_form; /* binary form */ -extern int region_output; /* region output */ +#ifdef __cplusplus +extern "C" { +#endif + +H5TOOLS_DLLVAR FILE *rawdatastream; /* output stream for raw data */ +H5TOOLS_DLLVAR int bin_output; /* binary output */ +H5TOOLS_DLLVAR int bin_form; /* binary form */ +H5TOOLS_DLLVAR int region_output; /* region output */ /* Strings for output */ #define H5_TOOLS_GROUP "GROUP" @@ -532,26 +536,26 @@ extern int region_output; /* region output */ #define H5_TOOLS_DATATYPE "DATATYPE" /* Definitions of useful routines */ -extern void h5tools_init(void); -extern void h5tools_close(void); -extern hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, +H5TOOLS_DLL void h5tools_init(void); +H5TOOLS_DLL void h5tools_close(void); +H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, char *drivername, size_t drivername_len); -extern int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, +H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, hid_t p_typ, struct subset_t *sset, int indentlevel); -extern int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, hid_t obj_id, +H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, hid_t obj_id, hid_t type, hid_t space, void *mem, int indentlevel); -extern hid_t h5tools_get_native_type(hid_t type); -extern hid_t h5tools_get_little_endian_type(hid_t type); -extern hid_t h5tools_get_big_endian_type(hid_t type); +H5TOOLS_DLL hid_t h5tools_get_native_type(hid_t type); +H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); +H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); -extern void h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, +H5TOOLS_DLL void h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, h5tools_context_t *ctx/*in,out*/, unsigned flags, hsize_t nelmts, hid_t type, void *_mem); -extern int h5tools_canreadf(const char* name, +H5TOOLS_DLL int h5tools_canreadf(const char* name, hid_t dcpl_id); -extern int h5tools_can_encode(H5Z_filter_t filtn); +H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn); void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims); /* @@ -564,5 +568,10 @@ int h5tools_print_datatype(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t type); int h5tools_print_enum(h5tools_str_t *buffer/*in,out*/, hid_t type); + +#ifdef __cplusplus +} +#endif + #endif /* H5TOOLS_H__ */ diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index a7c0d3c..207218e 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -22,9 +22,9 @@ #include "H5Epublic.h" /* tools-HDF5 Error variables */ -extern hid_t H5tools_ERR_CLS_g; -extern hid_t H5E_tools_g; -extern hid_t H5E_tools_min_id_g; +H5TOOLS_DLLVAR hid_t H5tools_ERR_CLS_g; +H5TOOLS_DLLVAR hid_t H5E_tools_g; +H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; /* Use FUNC to safely handle variations of C99 __func__ keyword handling */ #ifdef H5_HAVE_C99_FUNC diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 03e6efd..07d2a57 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -45,9 +45,6 @@ typedef struct { static H5SL_t *ref_path_table = NULL; /* the "table" (implemented with a skip list) */ static hid_t thefile = (-1); -extern char *progname; -extern int d_status; - static int ref_path_table_put(const char *, haddr_t objno); /*------------------------------------------------------------------------- @@ -122,8 +119,8 @@ init_ref_path_table(void) /* Iterate over objects in this file */ if(h5trav_visit(thefile, "/", TRUE, TRUE, init_ref_path_cb, NULL, NULL) < 0) { - error_msg(progname, "unable to construct reference path table\n"); - d_status = EXIT_FAILURE; + error_msg("unable to construct reference path table\n"); + h5tools_setstatus(EXIT_FAILURE); } /* end if */ return(0); diff --git a/tools/lib/h5tools_ref.h b/tools/lib/h5tools_ref.h index 567ca4b..7ddb91a 100644 --- a/tools/lib/h5tools_ref.h +++ b/tools/lib/h5tools_ref.h @@ -22,13 +22,13 @@ extern "C" { #endif -herr_t fill_ref_path_table(hid_t fid); -const char *lookup_ref_path(haddr_t ref); -int get_next_xid(void); -haddr_t get_fake_xid(void); -haddr_t ref_path_table_lookup(const char *); -haddr_t ref_path_table_gen_fake(const char *); -int term_ref_path_table(void); +H5TOOLS_DLL herr_t fill_ref_path_table(hid_t fid); +H5TOOLS_DLL const char *lookup_ref_path(haddr_t ref); +H5TOOLS_DLL int get_next_xid(void); +H5TOOLS_DLL haddr_t get_fake_xid(void); +H5TOOLS_DLL haddr_t ref_path_table_lookup(const char *); +H5TOOLS_DLL haddr_t ref_path_table_gen_fake(const char *); +H5TOOLS_DLL int term_ref_path_table(void); #ifdef __cplusplus } diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index a51a286..ca1caa1 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -39,6 +39,8 @@ int nCols = 80; int opt_err = 1; /*get_option prints errors if this is on */ int opt_ind = 1; /*token pointer */ const char *opt_arg; /*flag argument (or value) */ +static int h5tools_d_status = 0; +static const char *h5tools_progname = "h5tools"; /* local functions */ static void init_table(table_t **tbl); @@ -64,13 +66,13 @@ static void add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t *------------------------------------------------------------------------- */ void -error_msg(const char *progname, const char *fmt, ...) +error_msg(const char *fmt, ...) { va_list ap; va_start(ap, fmt); HDfflush(stdout); - HDfprintf(stderr, "%s error: ", progname); + HDfprintf(stderr, "%s error: ", h5tools_getprogname()); HDvfprintf(stderr, fmt, ap); va_end(ap); @@ -93,13 +95,13 @@ error_msg(const char *progname, const char *fmt, ...) *------------------------------------------------------------------------- */ void -warn_msg(const char *progname, const char *fmt, ...) +warn_msg(const char *fmt, ...) { va_list ap; va_start(ap, fmt); HDfflush(stdout); - HDfprintf(stderr, "%s warning: ", progname); + HDfprintf(stderr, "%s warning: ", h5tools_getprogname()); HDvfprintf(stderr, fmt, ap); va_end(ap); } @@ -758,3 +760,31 @@ out: return Ret; } + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Initialize the name and operation status of the H5 Tools library + * Description: + * These are utility functions to set/get the program name and operation status. + *------------------------------------------------------------------------- + */ +void h5tools_setprogname(const char *Progname) +{ + h5tools_progname = Progname; +} + +void h5tools_setstatus(int D_status) +{ + h5tools_d_status = D_status; +} + +const char*h5tools_getprogname() +{ + return h5tools_progname; +} + +int h5tools_getstatus() +{ + return h5tools_d_status; +} diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index dcd8f2b..14a7daa 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -24,12 +24,16 @@ #include "hdf5.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * begin get_option section */ -extern int opt_err; /* getoption prints errors if this is on */ -extern int opt_ind; /* token pointer */ -extern const char *opt_arg; /* flag argument (or value) */ +H5TOOLS_DLLVAR int opt_err; /* getoption prints errors if this is on */ +H5TOOLS_DLLVAR int opt_ind; /* token pointer */ +H5TOOLS_DLLVAR const char *opt_arg; /* flag argument (or value) */ enum { no_arg = 0, /* doesn't take an argument */ @@ -72,7 +76,7 @@ typedef struct long_options { * this gets returned from get_option */ } long_options; -extern int get_option(int argc, const char **argv, const char *opt, +H5TOOLS_DLL int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt); /* * end get_option section @@ -101,25 +105,24 @@ typedef struct find_objs_t { table_t *dset_table; } find_objs_t; -extern int nCols; /*max number of columns for outputting */ +H5TOOLS_DLLVAR int nCols; /*max number of columns for outputting */ /* Definitions of useful routines */ -extern void indentation(int); -extern void print_version(const char *progname); -extern void error_msg(const char *progname, const char *fmt, ...); -extern void warn_msg(const char *progname, const char *fmt, ...); -extern void free_table(table_t *table); +H5TOOLS_DLL void indentation(int); +H5TOOLS_DLL void print_version(const char *progname); +H5TOOLS_DLL void error_msg(const char *fmt, ...); +H5TOOLS_DLL void warn_msg(const char *fmt, ...); +H5TOOLS_DLL void free_table(table_t *table); #ifdef H5DUMP_DEBUG -extern void dump_tables(find_objs_t *info) +H5TOOLS_DLL void dump_tables(find_objs_t *info) #endif /* H5DUMP_DEBUG */ -extern herr_t init_objs(hid_t fid, find_objs_t *info, table_t **group_table, +H5TOOLS_DLL herr_t init_objs(hid_t fid, find_objs_t *info, table_t **group_table, table_t **dset_table, table_t **type_table); -extern obj_t *search_obj(table_t *temp, haddr_t objno); +H5TOOLS_DLL obj_t *search_obj(table_t *temp, haddr_t objno); #ifndef H5_HAVE_TMPFILE -extern FILE * tmpfile(void); +H5TOOLS_DLL FILE * tmpfile(void); #endif - /************************************************************* * * candidate functions to be public @@ -148,6 +151,14 @@ typedef struct { /* Definitions of routines */ -extern int H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info); +H5TOOLS_DLL int H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info); +H5TOOLS_DLL const char *h5tools_getprogname(void); +H5TOOLS_DLL void h5tools_setprogname(const char*progname); +H5TOOLS_DLL int h5tools_getstatus(void); +H5TOOLS_DLL void h5tools_setstatus(int d_status); + +#ifdef __cplusplus +} +#endif #endif /* H5TOOLS_UTILS_H__ */ diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index 5c07331..bb31461 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -110,7 +110,7 @@ extern "C" { * "h5trav general" public functions *------------------------------------------------------------------------- */ -int h5trav_visit(hid_t file_id, const char *grp_name, hbool_t visit_start, +H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata); @@ -118,22 +118,22 @@ int h5trav_visit(hid_t file_id, const char *grp_name, hbool_t visit_start, * "h5trav info" public functions *------------------------------------------------------------------------- */ -int h5trav_getinfo(hid_t file_id, trav_info_t *info); -ssize_t h5trav_getindex(const trav_info_t *info, const char *obj); +H5TOOLS_DLL int h5trav_getinfo(hid_t file_id, trav_info_t *info); +H5TOOLS_DLL ssize_t h5trav_getindex(const trav_info_t *info, const char *obj); /*------------------------------------------------------------------------- * "h5trav table" public functions *------------------------------------------------------------------------- */ -int h5trav_gettable(hid_t fid, trav_table_t *travt); -int h5trav_getindext(const char *obj, const trav_table_t *travt); +H5TOOLS_DLL int h5trav_gettable(hid_t fid, trav_table_t *travt); +H5TOOLS_DLL int h5trav_getindext(const char *obj, const trav_table_t *travt); /*------------------------------------------------------------------------- * "h5trav print" public functions *------------------------------------------------------------------------- */ -int h5trav_print(hid_t fid); +H5TOOLS_DLL int h5trav_print(hid_t fid); #ifdef __cplusplus } @@ -144,20 +144,20 @@ int h5trav_print(hid_t fid); *------------------------------------------------------------------------- */ -void trav_info_init(trav_info_t **info); +H5TOOLS_DLL void trav_info_init(trav_info_t **info); -void trav_info_free(trav_info_t *info); +H5TOOLS_DLL void trav_info_free(trav_info_t *info); /*------------------------------------------------------------------------- * table private functions *------------------------------------------------------------------------- */ -void trav_table_init(trav_table_t **table); +H5TOOLS_DLL void trav_table_init(trav_table_t **table); -void trav_table_free(trav_table_t *table); +H5TOOLS_DLL void trav_table_free(trav_table_t *table); -void trav_table_addflags(unsigned *flags, +H5TOOLS_DLL void trav_table_addflags(unsigned *flags, char *objname, h5trav_type_t type, trav_table_t *table); diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt new file mode 100644 index 0000000..321d0f0 --- /dev/null +++ b/tools/misc/CMakeLists.txt @@ -0,0 +1,150 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_MISC) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the misc and test executables +# -------------------------------------------------------------------- +#-- Misc Executables +ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) +H5_NAMING (h5debug) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5debug + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) +H5_NAMING (h5repart) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5repart + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) +H5_NAMING (h5mkgrp) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5mkgrp + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES + h5debug + h5repart + h5mkgrp +) + +IF (BUILD_TESTING) + SET (HDF5_REFERENCE_TEST_FILES + family_file00000.h5 + family_file00001.h5 + family_file00002.h5 + family_file00003.h5 + family_file00004.h5 + family_file00005.h5 + family_file00006.h5 + family_file00007.h5 + family_file00008.h5 + family_file00009.h5 + family_file00010.h5 + family_file00011.h5 + family_file00012.h5 + family_file00013.h5 + family_file00014.h5 + family_file00015.h5 + family_file00016.h5 + family_file00017.h5 + ) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5repart + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) + H5_NAMING (h5repart_gentest) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (h5repart_gentest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + #ADD_TEST (NAME h5repart_gentest COMMAND $) + ENDIF (NOT BUILD_SHARED_LIBS) + + ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) + H5_NAMING (h5repart_test) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (h5repart_test + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + # repartition family member size to 20,000 bytes. + ADD_TEST (NAME h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) + # repartition family member size to 5 KB. + ADD_TEST (NAME h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) + # convert family file to sec2 file of 20,000 bytes + ADD_TEST (NAME h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + + # test the output files repartitioned above. + ADD_TEST (NAME h5repart_test COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5repart_gentest + h5repart_test + ) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5debug h5repart + RUNTIME DESTINATION + bin/tools + COMPONENT + toolsapplications +) diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 1ad6097..4a2c7a8 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -240,12 +240,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTRUMENT = @INSTRUMENT@ INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LINUX_LFS = @LINUX_LFS@ LIPO = @LIPO@ LL_PATH = @LL_PATH@ LN_S = @LN_S@ diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index a6fdc56..09f23ef 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -21,7 +21,7 @@ #include /* Name of tool */ -const char *progname = "h5mkgrp"; +#define PROGRAMNAME "h5mkgrp" /* Exit status for tools library routines */ int d_status = EXIT_SUCCESS; @@ -141,7 +141,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Display version */ case 'V': - print_version(progname); + print_version(h5tools_getprogname()); leave(EXIT_SUCCESS); /* Bad command line argument */ @@ -153,7 +153,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Check for file name to be processed */ if(argc <= opt_ind) { - error_msg(progname, "missing file name\n"); + error_msg("missing file name\n"); usage(); leave(EXIT_FAILURE); } /* end if */ @@ -164,7 +164,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Check for group(s) to be created */ if(argc <= opt_ind) { - error_msg(progname, "missing group name(s)\n"); + error_msg("missing group name(s)\n"); usage(); leave(EXIT_FAILURE); } /* end if */ @@ -212,6 +212,9 @@ main(int argc, const char *argv[]) hid_t lcpl_id; /* Link creation property list ID */ size_t curr_group; /* Current group to create */ + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + /* Disable the HDF5 library's error reporting */ H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -221,13 +224,13 @@ main(int argc, const char *argv[]) /* Parse command line */ HDmemset(¶ms, 0, sizeof(params)); if(parse_command_line(argc, argv, ¶ms) < 0) { - error_msg(progname, "unable to parse command line arguments\n"); + error_msg("unable to parse command line arguments\n"); leave(EXIT_FAILURE); } /* end if */ /* Create file access property list */ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg(progname, "Could not create file access property list\n"); + error_msg("Could not create file access property list\n"); leave(EXIT_FAILURE); } /* end if */ @@ -235,13 +238,13 @@ main(int argc, const char *argv[]) if(params.latest) { /* Set the "use the latest version of the format" bounds */ if(H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { - error_msg(progname, "Could not set property for using latest version of the format\n"); + error_msg("Could not set property for using latest version of the format\n"); leave(EXIT_FAILURE); } /* end if */ /* Display some output if requested */ if(params.verbose) - printf("%s: Creating groups with latest version of the format\n", progname); + printf("%s: Creating groups with latest version of the format\n", h5tools_getprogname()); } /* end if */ /* Attempt to open an existing HDF5 file first */ @@ -254,13 +257,13 @@ main(int argc, const char *argv[]) /* Test for error in opening file */ if(fid < 0) { - error_msg(progname, "Could not open output file '%s'\n", params.fname); + error_msg("Could not open output file '%s'\n", params.fname); leave(EXIT_FAILURE); } /* end if */ /* Create link creation property list */ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { - error_msg(progname, "Could not create link creation property list\n"); + error_msg("Could not create link creation property list\n"); leave(EXIT_FAILURE); } /* end if */ @@ -268,13 +271,13 @@ main(int argc, const char *argv[]) if(params.parents) { /* Set the intermediate group creation property */ if(H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) { - error_msg(progname, "Could not set property for creating parent groups\n"); + error_msg("Could not set property for creating parent groups\n"); leave(EXIT_FAILURE); } /* end if */ /* Display some output if requested */ if(params.verbose) - printf("%s: Creating parent groups\n", progname); + printf("%s: Creating parent groups\n", h5tools_getprogname()); } /* end if */ /* Loop over creating requested groups */ @@ -283,36 +286,36 @@ main(int argc, const char *argv[]) /* Attempt to create a group */ if((gid = H5Gcreate2(fid, params.groups[curr_group], lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - error_msg(progname, "Could not create group '%s'\n", params.groups[curr_group]); + error_msg("Could not create group '%s'\n", params.groups[curr_group]); leave(EXIT_FAILURE); } /* end if */ /* Close the group */ if(H5Gclose(gid) < 0) { - error_msg(progname, "Could not close group '%s'??\n", params.groups[curr_group]); + error_msg("Could not close group '%s'??\n", params.groups[curr_group]); leave(EXIT_FAILURE); } /* end if */ /* Display some output if requested */ if(params.verbose) - printf("%s: created group '%s'\n", progname, params.groups[curr_group]); + printf("%s: created group '%s'\n", h5tools_getprogname(), params.groups[curr_group]); } /* end for */ /* Close link creation property list */ if(H5Pclose(lcpl_id) < 0) { - error_msg(progname, "Could not close link creation property list\n"); + error_msg("Could not close link creation property list\n"); leave(EXIT_FAILURE); } /* end if */ /* Close file */ if(H5Fclose(fid) < 0) { - error_msg(progname, "Could not close output file '%s'??\n", params.fname); + error_msg("Could not close output file '%s'??\n", params.fname); leave(EXIT_FAILURE); } /* end if */ /* Close file access property list */ if(H5Pclose(fapl_id) < 0) { - error_msg(progname, "Could not close file access property list\n"); + error_msg("Could not close file access property list\n"); leave(EXIT_FAILURE); } /* end if */ diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls index 4c45570..1b5de0c 100644 --- a/tools/testfiles/help-1.ls +++ b/tools/testfiles/help-1.ls @@ -2,27 +2,43 @@ output for 'h5ls -w80 -h' ############################# usage: h5ls [OPTIONS] [OBJECTS...] - OPTIONS - -h, -?, --help Print a usage message and exit - -a, --address Print addresses for raw data - -d, --data Print the values of datasets - -e, --errors Show all HDF5 error reporting - -E, --external Allow traversal into external files - -f, --full Print full path names instead of base names - -g, --group Show information about a group, not its contents - -l, --label Label members of compound datasets - -r, --recursive List all groups recursively, avoiding cycles - -s, --string Print 1-byte integer datasets as ASCII - -S, --simple Use a machine-readable output format - -wN, --width=N Set the number of columns of output - -v, --verbose Generate more verbose output - -V, --version Print version number and exit - --vfd=DRIVER Use the specified virtual file driver - -x, --hexdump Show raw data in hexadecimal format + OPTIONS + -h, -?, --help Print a usage message and exit + -a, --address Print addresses for raw data + -d, --data Print the values of datasets + -e, --errors Show all HDF5 error reporting + --follow-symlinks Follow symbolic links (soft links and external links) + to display target object information. + Without this option, h5ls identifies a symbolic link + as a soft link or external link and prints the value + assigned to the symbolic link; it does not provide any + information regarding the target object or determine + whether the link is a dangling link. + -f, --full Print full path names instead of base names + -g, --group Show information about a group, not its contents + -l, --label Label members of compound datasets + -r, --recursive List all groups recursively, avoiding cycles + -s, --string Print 1-byte integer datasets as ASCII + -S, --simple Use a machine-readable output format + -wN, --width=N Set the number of columns of output + -v, --verbose Generate more verbose output + -V, --version Print version number and exit + --vfd=DRIVER Use the specified virtual file driver + -x, --hexdump Show raw data in hexadecimal format - OBJECTS - Each object consists of an HDF5 file name optionally followed by a - slash and an object name within the file (if no object is specified - within the file then the contents of the root group are displayed). - The file name may include a printf(3C) integer format such as - "%05d" to open a file family. + OBJECTS + Each object consists of an HDF5 file name optionally followed by a + slash and an object name within the file (if no object is specified + within the file then the contents of the root group are displayed). + The file name may include a printf(3C) integer format such as + "%05d" to open a file family. + + Deprecated Options + The following options have been deprecated in HDF5. While they remain + available, they have been superseded as indicated and may be removed + from HDF5 in the future. Use the indicated replacement option in all + new work; where possible, existing scripts, et cetera, should also be + updated to use the replacement option. + + -E or --external Follow external links. + Replaced by --follow-symlinks. diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls index 522cb5a..6f7e75d 100644 --- a/tools/testfiles/help-2.ls +++ b/tools/testfiles/help-2.ls @@ -2,27 +2,43 @@ output for 'h5ls -w80 -help' ############################# usage: h5ls [OPTIONS] [OBJECTS...] - OPTIONS - -h, -?, --help Print a usage message and exit - -a, --address Print addresses for raw data - -d, --data Print the values of datasets - -e, --errors Show all HDF5 error reporting - -E, --external Allow traversal into external files - -f, --full Print full path names instead of base names - -g, --group Show information about a group, not its contents - -l, --label Label members of compound datasets - -r, --recursive List all groups recursively, avoiding cycles - -s, --string Print 1-byte integer datasets as ASCII - -S, --simple Use a machine-readable output format - -wN, --width=N Set the number of columns of output - -v, --verbose Generate more verbose output - -V, --version Print version number and exit - --vfd=DRIVER Use the specified virtual file driver - -x, --hexdump Show raw data in hexadecimal format + OPTIONS + -h, -?, --help Print a usage message and exit + -a, --address Print addresses for raw data + -d, --data Print the values of datasets + -e, --errors Show all HDF5 error reporting + --follow-symlinks Follow symbolic links (soft links and external links) + to display target object information. + Without this option, h5ls identifies a symbolic link + as a soft link or external link and prints the value + assigned to the symbolic link; it does not provide any + information regarding the target object or determine + whether the link is a dangling link. + -f, --full Print full path names instead of base names + -g, --group Show information about a group, not its contents + -l, --label Label members of compound datasets + -r, --recursive List all groups recursively, avoiding cycles + -s, --string Print 1-byte integer datasets as ASCII + -S, --simple Use a machine-readable output format + -wN, --width=N Set the number of columns of output + -v, --verbose Generate more verbose output + -V, --version Print version number and exit + --vfd=DRIVER Use the specified virtual file driver + -x, --hexdump Show raw data in hexadecimal format - OBJECTS - Each object consists of an HDF5 file name optionally followed by a - slash and an object name within the file (if no object is specified - within the file then the contents of the root group are displayed). - The file name may include a printf(3C) integer format such as - "%05d" to open a file family. + OBJECTS + Each object consists of an HDF5 file name optionally followed by a + slash and an object name within the file (if no object is specified + within the file then the contents of the root group are displayed). + The file name may include a printf(3C) integer format such as + "%05d" to open a file family. + + Deprecated Options + The following options have been deprecated in HDF5. While they remain + available, they have been superseded as indicated and may be removed + from HDF5 in the future. Use the indicated replacement option in all + new work; where possible, existing scripts, et cetera, should also be + updated to use the replacement option. + + -E or --external Follow external links. + Replaced by --follow-symlinks. diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls index 22ad865..939c8eb 100644 --- a/tools/testfiles/help-3.ls +++ b/tools/testfiles/help-3.ls @@ -2,27 +2,43 @@ output for 'h5ls -w80 -?' ############################# usage: h5ls [OPTIONS] [OBJECTS...] - OPTIONS - -h, -?, --help Print a usage message and exit - -a, --address Print addresses for raw data - -d, --data Print the values of datasets - -e, --errors Show all HDF5 error reporting - -E, --external Allow traversal into external files - -f, --full Print full path names instead of base names - -g, --group Show information about a group, not its contents - -l, --label Label members of compound datasets - -r, --recursive List all groups recursively, avoiding cycles - -s, --string Print 1-byte integer datasets as ASCII - -S, --simple Use a machine-readable output format - -wN, --width=N Set the number of columns of output - -v, --verbose Generate more verbose output - -V, --version Print version number and exit - --vfd=DRIVER Use the specified virtual file driver - -x, --hexdump Show raw data in hexadecimal format + OPTIONS + -h, -?, --help Print a usage message and exit + -a, --address Print addresses for raw data + -d, --data Print the values of datasets + -e, --errors Show all HDF5 error reporting + --follow-symlinks Follow symbolic links (soft links and external links) + to display target object information. + Without this option, h5ls identifies a symbolic link + as a soft link or external link and prints the value + assigned to the symbolic link; it does not provide any + information regarding the target object or determine + whether the link is a dangling link. + -f, --full Print full path names instead of base names + -g, --group Show information about a group, not its contents + -l, --label Label members of compound datasets + -r, --recursive List all groups recursively, avoiding cycles + -s, --string Print 1-byte integer datasets as ASCII + -S, --simple Use a machine-readable output format + -wN, --width=N Set the number of columns of output + -v, --verbose Generate more verbose output + -V, --version Print version number and exit + --vfd=DRIVER Use the specified virtual file driver + -x, --hexdump Show raw data in hexadecimal format - OBJECTS - Each object consists of an HDF5 file name optionally followed by a - slash and an object name within the file (if no object is specified - within the file then the contents of the root group are displayed). - The file name may include a printf(3C) integer format such as - "%05d" to open a file family. + OBJECTS + Each object consists of an HDF5 file name optionally followed by a + slash and an object name within the file (if no object is specified + within the file then the contents of the root group are displayed). + The file name may include a printf(3C) integer format such as + "%05d" to open a file family. + + Deprecated Options + The following options have been deprecated in HDF5. While they remain + available, they have been superseded as indicated and may be removed + from HDF5 in the future. Use the indicated replacement option in all + new work; where possible, existing scripts, et cetera, should also be + updated to use the replacement option. + + -E or --external Follow external links. + Replaced by --follow-symlinks. diff --git a/tools/testfiles/textlinksrc-1-old.ls b/tools/testfiles/textlinksrc-1-old.ls new file mode 100644 index 0000000..5e81dec --- /dev/null +++ b/tools/testfiles/textlinksrc-1-old.ls @@ -0,0 +1,19 @@ +############################# + output for 'h5ls -w80 -Er textlinksrc.h5' +############################# +/ Group +/ext_link1 External Link {textlinktar.h5//group} {Group} +/ext_link1/dset Dataset {6} +/ext_link1/elink_t1 External Link {textlinksrc.h5//} {Group} +/ext_link1/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited} +/ext_link1/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} +/ext_link1/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type} +/ext_link1/elink_t1/ext_link4 External Link {textlinktar.h5//group/elink_t2} {**NOT FOUND**} +/ext_link1/elink_t1/ext_link5 External Link {textlinktar.h5//empty_group} {Group} +/ext_link1/elink_t2 External Link {textlinksrc.h5//ext_link4} {**NOT FOUND**} +/ext_link1/subgroup Group +/ext_link1/subgroup/link_to_group Group, same as /ext_link1 +/ext_link2 External Link {textlinktar.h5//dset} {Already Visited} +/ext_link3 External Link {textlinktar.h5//type} {Already Visited} +/ext_link4 External Link {textlinktar.h5//group/elink_t2} {Already Visited} +/ext_link5 External Link {textlinktar.h5//empty_group} {Already Visited} diff --git a/tools/testfiles/textlinksrc-1.ls b/tools/testfiles/textlinksrc-1.ls index 5e81dec..f39eec9 100644 --- a/tools/testfiles/textlinksrc-1.ls +++ b/tools/testfiles/textlinksrc-1.ls @@ -1,5 +1,5 @@ ############################# - output for 'h5ls -w80 -Er textlinksrc.h5' + output for 'h5ls -w80 --follow-symlinks -r textlinksrc.h5' ############################# / Group /ext_link1 External Link {textlinktar.h5//group} {Group} diff --git a/tools/testfiles/textlinksrc-2-old.ls b/tools/testfiles/textlinksrc-2-old.ls new file mode 100644 index 0000000..acdc3d2 --- /dev/null +++ b/tools/testfiles/textlinksrc-2-old.ls @@ -0,0 +1,8 @@ +############################# + output for 'h5ls -w80 -Erv textlinksrc.h5/ext_link5' +############################# +Opened "textlinksrc.h5" with sec2 driver. +ext_link5 External Link {textlinktar.h5//empty_group} {Group + Location: 3:1832 + Links: 1 +} diff --git a/tools/testfiles/textlinksrc-2.ls b/tools/testfiles/textlinksrc-2.ls index acdc3d2..ea99be8 100644 --- a/tools/testfiles/textlinksrc-2.ls +++ b/tools/testfiles/textlinksrc-2.ls @@ -1,5 +1,5 @@ ############################# - output for 'h5ls -w80 -Erv textlinksrc.h5/ext_link5' + output for 'h5ls -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5' ############################# Opened "textlinksrc.h5" with sec2 driver. ext_link5 External Link {textlinktar.h5//empty_group} {Group diff --git a/tools/testfiles/textlinksrc-3-old.ls b/tools/testfiles/textlinksrc-3-old.ls new file mode 100644 index 0000000..a86ca32 --- /dev/null +++ b/tools/testfiles/textlinksrc-3-old.ls @@ -0,0 +1,14 @@ +############################# + output for 'h5ls -w80 -Er textlinksrc.h5/ext_link1' +############################# +ext_link1 External Link {textlinktar.h5//group} {Group} +/dset Dataset {6} +/elink_t1 External Link {textlinksrc.h5//} {Group} +/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited} +/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} +/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type} +/elink_t1/ext_link4 External Link {textlinktar.h5//group/elink_t2} {**NOT FOUND**} +/elink_t1/ext_link5 External Link {textlinktar.h5//empty_group} {Group} +/elink_t2 External Link {textlinksrc.h5//ext_link4} {**NOT FOUND**} +/subgroup Group +/subgroup/link_to_group Group, same as /ext_link1 diff --git a/tools/testfiles/textlinksrc-3.ls b/tools/testfiles/textlinksrc-3.ls index a86ca32..bd173f3 100644 --- a/tools/testfiles/textlinksrc-3.ls +++ b/tools/testfiles/textlinksrc-3.ls @@ -1,5 +1,5 @@ ############################# - output for 'h5ls -w80 -Er textlinksrc.h5/ext_link1' + output for 'h5ls -w80 --follow-symlinks -r textlinksrc.h5/ext_link1' ############################# ext_link1 External Link {textlinktar.h5//group} {Group} /dset Dataset {6} diff --git a/tools/testfiles/textlinksrc-6-old.ls b/tools/testfiles/textlinksrc-6-old.ls new file mode 100644 index 0000000..e1b8b74 --- /dev/null +++ b/tools/testfiles/textlinksrc-6-old.ls @@ -0,0 +1,8 @@ +############################# + output for 'h5ls -w80 -E textlinksrc.h5' +############################# +ext_link1 External Link {textlinktar.h5//group} {Group} +ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} +ext_link3 External Link {textlinktar.h5//type} {Type} +ext_link4 External Link {textlinktar.h5//group/elink_t2} {**NOT FOUND**} +ext_link5 External Link {textlinktar.h5//empty_group} {Group} diff --git a/tools/testfiles/textlinksrc-6.ls b/tools/testfiles/textlinksrc-6.ls index e1b8b74..6cda888 100644 --- a/tools/testfiles/textlinksrc-6.ls +++ b/tools/testfiles/textlinksrc-6.ls @@ -1,5 +1,5 @@ ############################# - output for 'h5ls -w80 -E textlinksrc.h5' + output for 'h5ls -w80 --follow-symlinks textlinksrc.h5' ############################# ext_link1 External Link {textlinktar.h5//group} {Group} ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} diff --git a/tools/testfiles/textlinksrc-7-old.ls b/tools/testfiles/textlinksrc-7-old.ls new file mode 100644 index 0000000..9249d0c --- /dev/null +++ b/tools/testfiles/textlinksrc-7-old.ls @@ -0,0 +1,4 @@ +############################# + output for 'h5ls -w80 -E textlinksrc.h5/ext_link1' +############################# +ext_link1 External Link {textlinktar.h5//group} {Group} diff --git a/tools/testfiles/textlinksrc-7.ls b/tools/testfiles/textlinksrc-7.ls index 9249d0c..528c4c5 100644 --- a/tools/testfiles/textlinksrc-7.ls +++ b/tools/testfiles/textlinksrc-7.ls @@ -1,4 +1,4 @@ ############################# - output for 'h5ls -w80 -E textlinksrc.h5/ext_link1' + output for 'h5ls -w80 --follow-symlinks textlinksrc.h5/ext_link1' ############################# ext_link1 External Link {textlinktar.h5//group} {Group} diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls index 5401cd7..8d38e0f 100644 --- a/tools/testfiles/tgroup-1.ls +++ b/tools/testfiles/tgroup-1.ls @@ -4,27 +4,43 @@ Error: 'recursive' option not compatible with 'group info' option! usage: h5ls [OPTIONS] [OBJECTS...] - OPTIONS - -h, -?, --help Print a usage message and exit - -a, --address Print addresses for raw data - -d, --data Print the values of datasets - -e, --errors Show all HDF5 error reporting - -E, --external Allow traversal into external files - -f, --full Print full path names instead of base names - -g, --group Show information about a group, not its contents - -l, --label Label members of compound datasets - -r, --recursive List all groups recursively, avoiding cycles - -s, --string Print 1-byte integer datasets as ASCII - -S, --simple Use a machine-readable output format - -wN, --width=N Set the number of columns of output - -v, --verbose Generate more verbose output - -V, --version Print version number and exit - --vfd=DRIVER Use the specified virtual file driver - -x, --hexdump Show raw data in hexadecimal format + OPTIONS + -h, -?, --help Print a usage message and exit + -a, --address Print addresses for raw data + -d, --data Print the values of datasets + -e, --errors Show all HDF5 error reporting + --follow-symlinks Follow symbolic links (soft links and external links) + to display target object information. + Without this option, h5ls identifies a symbolic link + as a soft link or external link and prints the value + assigned to the symbolic link; it does not provide any + information regarding the target object or determine + whether the link is a dangling link. + -f, --full Print full path names instead of base names + -g, --group Show information about a group, not its contents + -l, --label Label members of compound datasets + -r, --recursive List all groups recursively, avoiding cycles + -s, --string Print 1-byte integer datasets as ASCII + -S, --simple Use a machine-readable output format + -wN, --width=N Set the number of columns of output + -v, --verbose Generate more verbose output + -V, --version Print version number and exit + --vfd=DRIVER Use the specified virtual file driver + -x, --hexdump Show raw data in hexadecimal format - OBJECTS - Each object consists of an HDF5 file name optionally followed by a - slash and an object name within the file (if no object is specified - within the file then the contents of the root group are displayed). - The file name may include a printf(3C) integer format such as - "%05d" to open a file family. + OBJECTS + Each object consists of an HDF5 file name optionally followed by a + slash and an object name within the file (if no object is specified + within the file then the contents of the root group are displayed). + The file name may include a printf(3C) integer format such as + "%05d" to open a file family. + + Deprecated Options + The following options have been deprecated in HDF5. While they remain + available, they have been superseded as indicated and may be removed + from HDF5 in the future. Use the indicated replacement option in all + new work; where possible, existing scripts, et cetera, should also be + updated to use the replacement option. + + -E or --external Follow external links. + Replaced by --follow-symlinks. diff --git a/tools/testfiles/tsoftlinks-1.ls b/tools/testfiles/tsoftlinks-1.ls new file mode 100644 index 0000000..fc57da9 --- /dev/null +++ b/tools/testfiles/tsoftlinks-1.ls @@ -0,0 +1,13 @@ +############################# + output for 'h5ls --follow-symlinks tsoftlinks.h5' +############################# +dset1 Dataset {4, 2} +dset2 Dataset {4, 2} +dtype Type +group1 Group +group_empty Group +soft_dangle Soft Link {not_yet} {**NOT FOUND**} +soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} +soft_dtype Soft Link {/dtype} {Type} +soft_empty_grp Soft Link {/group_empty} {Group} +soft_group1 Soft Link {/group1} {Group} diff --git a/tools/testfiles/tsoftlinks-2.ls b/tools/testfiles/tsoftlinks-2.ls new file mode 100644 index 0000000..3566f70 --- /dev/null +++ b/tools/testfiles/tsoftlinks-2.ls @@ -0,0 +1,24 @@ +############################# + output for 'h5ls --follow-symlinks -r tsoftlinks.h5' +############################# +/ Group +/dset1 Dataset {4, 2} +/dset2 Dataset {4, 2} +/dtype Type +/group1 Group +/group1/soft_dangle Soft Link {not_yet} {**NOT FOUND**} +/group1/soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} +/group1/soft_dset2 Soft Link {/dset2} {Dataset {4, 2}} +/group1/soft_dtype Soft Link {/dtype} {Type} +/group1/soft_empty_grp Soft Link {/group_empty} {Group} +/group_empty Group +/soft_dangle Soft Link {not_yet} {Already Visited} +/soft_dset1 Soft Link {/dset1} {Already Visited} +/soft_dtype Soft Link {/dtype} {Already Visited} +/soft_empty_grp Soft Link {/group_empty} {Already Visited} +/soft_group1 Soft Link {/group1} {Group} +/soft_group1/soft_dangle Soft Link {not_yet} {Already Visited} +/soft_group1/soft_dset1 Soft Link {/dset1} {Already Visited} +/soft_group1/soft_dset2 Soft Link {/dset2} {Already Visited} +/soft_group1/soft_dtype Soft Link {/dtype} {Already Visited} +/soft_group1/soft_empty_grp Soft Link {/group_empty} {Already Visited} diff --git a/tools/testfiles/tsoftlinks-3.ls b/tools/testfiles/tsoftlinks-3.ls new file mode 100644 index 0000000..2face70 --- /dev/null +++ b/tools/testfiles/tsoftlinks-3.ls @@ -0,0 +1,8 @@ +############################# + output for 'h5ls --follow-symlinks tsoftlinks.h5/group1' +############################# +soft_dangle Soft Link {not_yet} {**NOT FOUND**} +soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} +soft_dset2 Soft Link {/dset2} {Dataset {4, 2}} +soft_dtype Soft Link {/dtype} {Type} +soft_empty_grp Soft Link {/group_empty} {Group} diff --git a/tools/testfiles/tsoftlinks-4.ls b/tools/testfiles/tsoftlinks-4.ls new file mode 100644 index 0000000..c1f4568 --- /dev/null +++ b/tools/testfiles/tsoftlinks-4.ls @@ -0,0 +1,8 @@ +############################# + output for 'h5ls --follow-symlinks -r tsoftlinks.h5/group1' +############################# +/soft_dangle Soft Link {not_yet} {**NOT FOUND**} +/soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} +/soft_dset2 Soft Link {/dset2} {Dataset {4, 2}} +/soft_dtype Soft Link {/dtype} {Type} +/soft_empty_grp Soft Link {/group_empty} {Group} diff --git a/tools/testfiles/tsoftlinks-5.ls b/tools/testfiles/tsoftlinks-5.ls new file mode 100644 index 0000000..6e915e1 --- /dev/null +++ b/tools/testfiles/tsoftlinks-5.ls @@ -0,0 +1,4 @@ +############################# + output for 'h5ls --follow-symlinks tsoftlinks.h5/soft_dset1' +############################# +soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} diff --git a/tools/testfiles/tsoftlinks.h5 b/tools/testfiles/tsoftlinks.h5 new file mode 100644 index 0000000..01ea922 Binary files /dev/null and b/tools/testfiles/tsoftlinks.h5 differ diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index bd65b5e..c8665f1 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -489,13 +489,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.69-FA_a4" +#define H5_PACKAGE_STRING "HDF5 1.9.73-FA_a4" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.69-FA_a4" +#define H5_PACKAGE_VERSION "1.9.73-FA_a4" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -651,7 +651,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.69-FA_a4" +#define H5_VERSION "1.9.73-FA_a4" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/installhdf5lib.bat b/windows/installhdf5lib.bat index e10707b..5c81f33 100755 --- a/windows/installhdf5lib.bat +++ b/windows/installhdf5lib.bat @@ -14,7 +14,7 @@ rem access to either file, you may request a copy from help@hdfgroup.org. rem This batch file is used to install HDF5 libraries and tools -rem Last Updated: 2/12/2007 +rem Last Updated: 3/3/08 setlocal enabledelayedexpansion pushd %~dp0 @@ -27,7 +27,7 @@ rem Create the directory structure that we'll need to install :create_directories for %%a in (debug release) do ( - for %%b in (bin bindll dll lib include modsdll) do ( + for %%b in (bin bindll dll lib include mods modsdll) do ( if not exist hdf5lib\%%a\%%b ( mkdir hdf5lib\%%a\%%b ) @@ -220,7 +220,7 @@ rem Install Fortran Libraries and Tools rem ===DEBUG=== rem include - call :safe_copy proj\hdf5_fortran\debug\*.mod hdf5lib\debug\include + call :safe_copy proj\hdf5_fortran\debug\*.mod hdf5lib\debug\mods rem lib call :safe_copy proj\hdf5_fortran\debug\hdf5_fortrand.lib hdf5lib\debug\lib call :safe_copy proj\hdf5_f90cstub\debug\hdf5_f90cstubd.lib hdf5lib\debug\lib @@ -234,7 +234,7 @@ rem Install Fortran Libraries and Tools rem ===RELEASE=== rem include - call :safe_copy proj\hdf5_fortran\release\*.mod hdf5lib\release\include + call :safe_copy proj\hdf5_fortran\release\*.mod hdf5lib\release\mods rem lib call :safe_copy proj\hdf5_fortran\release\hdf5_fortran.lib hdf5lib\release\lib call :safe_copy proj\hdf5_f90cstub\release\hdf5_f90cstub.lib hdf5lib\release\lib @@ -255,7 +255,7 @@ rem Install HL Fortran Libraries and Tools rem ===DEBUG=== rem include - call :safe_copy proj\hdf5_hl_fortran\debug\*.mod hdf5lib\debug\include + call :safe_copy proj\hdf5_hl_fortran\debug\*.mod hdf5lib\debug\mods rem lib call :safe_copy proj\hdf5_hl_fortran\debug\hdf5_hl_fortrand.lib hdf5lib\debug\lib call :safe_copy proj\hdf5_hl_f90cstub\debug\hdf5_hl_f90cstubd.lib hdf5lib\debug\lib @@ -269,7 +269,7 @@ rem Install HL Fortran Libraries and Tools rem ===RELEASE=== rem include - call :safe_copy proj\hdf5_hl_fortran\release\*.mod hdf5lib\release\include + call :safe_copy proj\hdf5_hl_fortran\release\*.mod hdf5lib\release\mods rem lib call :safe_copy proj\hdf5_hl_fortran\release\hdf5_hl_fortran.lib hdf5lib\release\lib call :safe_copy proj\hdf5_hl_f90cstub\release\hdf5_hl_f90cstub.lib hdf5lib\release\lib diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 00e9015..926c63a 100755 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -19,7 +19,7 @@ /* * End of Windows Specific Definitions */ - + /* Define if your system generates wrong code for log2 routine. */ /* #undef H5_BAD_LOG2_CODE_GENERATED */ @@ -108,7 +108,6 @@ /* #undef H5_HAVE_FEATURES_H */ /* Define if support for deflate (zlib) filter is enabled */ -#define H5_HAVE_FILTER_DEFLATE 1 /* Define if support for Fletcher32 checksum is enabled */ #define H5_HAVE_FILTER_FLETCHER32 1 @@ -220,10 +219,10 @@ /* #undef H5_HAVE_LIBSOCKET */ /* Define to 1 if you have the `sz' library (-lsz). */ -/* #undef H5_HAVE_LIBSZ */ +#define H5_HAVE_LIBSZ 1 /* Define to 1 if you have the `z' library (-lz). */ -/* #undef H5_HAVE_LIBZ */ +#define H5_HAVE_LIBZ 1 /* Define to 1 if you have the `longjmp' function. */ #define H5_HAVE_LONGJMP 1 @@ -231,9 +230,6 @@ /* Define to 1 if you have the `lseek64' function. */ /* #undef H5_HAVE_LSEEK64 */ -/* Define to 1 if you have the `lstat' function. */ -/* #undef H5_HAVE_LSTAT */ - /* Define to 1 if you have the header file. */ #define H5_HAVE_MEMORY_H 1 @@ -270,6 +266,9 @@ /* Define to 1 if you have the `setsysinfo' function. */ /* #undef H5_HAVE_SETSYSINFO */ +/* Define to 1 if you have the `sigaction' function. */ +/* #undef H5_HAVE_SIGACTION */ + /* Define to 1 if you have the `siglongjmp' function. */ /* #undef H5_HAVE_SIGLONGJMP */ @@ -479,13 +478,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.69-FA_a4" +#define H5_PACKAGE_STRING "HDF5 1.9.73-FA_a4" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.69-FA_a4" +#define H5_PACKAGE_VERSION "1.9.73-FA_a4" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -642,7 +641,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.69-FA_a4" +#define H5_VERSION "1.9.73-FA_a4" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/test/checktests.bat b/windows/test/checktests.bat index 77a47aa..e76ba01 100644 --- a/windows/test/checktests.bat +++ b/windows/test/checktests.bat @@ -125,8 +125,7 @@ rem on it for sending parameters. --SJW 9/6/07 call :add_test reserved%2 .\reserved%2\%1 call :add_test cross_read%2 .\cross_read%2\%1 call :add_test freespace%2 .\freespace%2\%1 - rem Test commented out until fixed - assert hangs daily test - rem call :add_test mf%2 .\mf%2\%1 + call :add_test mf%2 .\mf%2\%1 call :add_test btree2%2 .\btree2%2\%1 call :add_test fheap%2 .\fheap%2\%1 call :add_test earray%2 .\earray%2\%1 diff --git a/windows/tools/h5diff/testh5diff.bat b/windows/tools/h5diff/testh5diff.bat index afbef81..0023ec3 100644 --- a/windows/tools/h5diff/testh5diff.bat +++ b/windows/tools/h5diff/testh5diff.bat @@ -564,162 +564,162 @@ rem ############################################################################ call :tooltest h5diff_207.txt -c %file2% %file2% g2/dset8 g2/dset9 rem ############################################################################## - rem # Links compare without --follow-links nor --no-dangling-links + rem # Links compare without --follow-symlinks nor --no-dangling-links rem ############################################################################## rem test for bug1749 call :testing %h5diff% -v %srcfile12% %srcfile12% /link_g1 /link_g2 call :tooltest h5diff_300.txt -v %file12% %file12% /link_g1 /link_g2 rem ############################################################################## - rem # Links compare with --follow-links Only + rem # Links compare with --follow-symlinks Only rem ############################################################################## rem soft links file to file - call :testing %h5diff% --follow-links -v %srcfile13% %srcfile13% - call :tooltest h5diff_400.txt --follow-links -v %file13% %file13% + call :testing %h5diff% --follow-symlinks -v %srcfile13% %srcfile13% + call :tooltest h5diff_400.txt --follow-symlinks -v %file13% %file13% rem softlink vs dset" - call :testing %h5diff% --follow-links -v %srcfile13% %srcfile13% /softlink_dset1_1 /target_dset2 - call :tooltest h5diff_401.txt --follow-links -v %file13% %file13% /softlink_dset1_1 /target_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile13% %srcfile13% /softlink_dset1_1 /target_dset2 + call :tooltest h5diff_401.txt --follow-symlinks -v %file13% %file13% /softlink_dset1_1 /target_dset2 rem dset vs softlink" - call :testing %h5diff% --follow-links -v %srcfile13% %srcfile13% /target_dset2 /softlink_dset1_1 - call :tooltest h5diff_402.txt --follow-links -v %file13% %file13% /target_dset2 /softlink_dset1_1 + call :testing %h5diff% --follow-symlinks -v %srcfile13% %srcfile13% /target_dset2 /softlink_dset1_1 + call :tooltest h5diff_402.txt --follow-symlinks -v %file13% %file13% /target_dset2 /softlink_dset1_1 rem softlink vs softlink" - call :testing %h5diff% --follow-links -v %srcfile13% %srcfile13% /softlink_dset1_1 /softlink_dset2 - call :tooltest h5diff_403.txt --follow-links -v %file13% %file13% /softlink_dset1_1 /softlink_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile13% %srcfile13% /softlink_dset1_1 /softlink_dset2 + call :tooltest h5diff_403.txt --follow-symlinks -v %file13% %file13% /softlink_dset1_1 /softlink_dset2 rem extlink vs extlink (FILE)" - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile15% - call :tooltest h5diff_404.txt --follow-links -v %file15% %file15% + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile15% + call :tooltest h5diff_404.txt --follow-symlinks -v %file15% %file15% rem extlink vs dset" - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile16% /ext_link_dset1 /target_group2/x_dset - call :tooltest h5diff_405.txt --follow-links -v %file15% %file16% /ext_link_dset1 /target_group2/x_dset + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile16% /ext_link_dset1 /target_group2/x_dset + call :tooltest h5diff_405.txt --follow-symlinks -v %file15% %file16% /ext_link_dset1 /target_group2/x_dset rem dset vs extlink" - call :testing %h5diff% --follow-links -v %srcfile16% %srcfile15% /target_group2/x_dset /ext_link_dset1 - call :tooltest h5diff_406.txt --follow-links -v %file16% %file15% /target_group2/x_dset /ext_link_dset1 + call :testing %h5diff% --follow-symlinks -v %srcfile16% %srcfile15% /target_group2/x_dset /ext_link_dset1 + call :tooltest h5diff_406.txt --follow-symlinks -v %file16% %file15% /target_group2/x_dset /ext_link_dset1 rem extlink vs extlink" - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile15% /ext_link_dset1 /ext_link_dset2 - call :tooltest h5diff_407.txt --follow-links -v %file15% %file15% /ext_link_dset1 /ext_link_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile15% /ext_link_dset1 /ext_link_dset2 + call :tooltest h5diff_407.txt --follow-symlinks -v %file15% %file15% /ext_link_dset1 /ext_link_dset2 rem softlink vs extlink" - call :testing %h5diff% --follow-links -v %srcfile13% %srcfile15% /softlink_dset1_1 /ext_link_dset2 - call :tooltest h5diff_408.txt --follow-links -v %file13% %file15% /softlink_dset1_1 /ext_link_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile13% %srcfile15% /softlink_dset1_1 /ext_link_dset2 + call :tooltest h5diff_408.txt --follow-symlinks -v %file13% %file15% /softlink_dset1_1 /ext_link_dset2 rem extlink vs softlink " - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile13% /ext_link_dset2 /softlink_dset1_1 - call :tooltest h5diff_409.txt --follow-links -v %file15% %file13% /ext_link_dset2 /softlink_dset1_1 + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile13% /ext_link_dset2 /softlink_dset1_1 + call :tooltest h5diff_409.txt --follow-symlinks -v %file15% %file13% /ext_link_dset2 /softlink_dset1_1 rem linked_softlink vs linked_softlink (FILE)" - call :testing %h5diff% --follow-links -v %srcfile14% %srcfile14% - call :tooltest h5diff_410.txt --follow-links -v %file14% %file14% + call :testing %h5diff% --follow-symlinks -v %srcfile14% %srcfile14% + call :tooltest h5diff_410.txt --follow-symlinks -v %file14% %file14% rem dset2 vs linked_softlink_dset1" - call :testing %h5diff% --follow-links -v %srcfile14% %srcfile14% /target_dset2 /softlink1_to_slink2 - call :tooltest h5diff_411.txt --follow-links -v %file14% %file14% /target_dset2 /softlink1_to_slink2 + call :testing %h5diff% --follow-symlinks -v %srcfile14% %srcfile14% /target_dset2 /softlink1_to_slink2 + call :tooltest h5diff_411.txt --follow-symlinks -v %file14% %file14% /target_dset2 /softlink1_to_slink2 rem rem linked_softlink_dset1 vs dset2" - call :testing %h5diff% --follow-links -v %srcfile14% %srcfile14% /softlink1_to_slink2 /target_dset2 - call :tooltest h5diff_412.txt --follow-links -v %file14% %file14% /softlink1_to_slink2 /target_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile14% %srcfile14% /softlink1_to_slink2 /target_dset2 + call :tooltest h5diff_412.txt --follow-symlinks -v %file14% %file14% /softlink1_to_slink2 /target_dset2 rem linked_softlink_to_dset1 vs linked_softlink_to_dset2" - call :testing %h5diff% --follow-links -v %srcfile14% %srcfile14% /softlink1_to_slink2 /softlink2_to_slink2 - call :tooltest h5diff_413.txt --follow-links -v %file14% %file14% /softlink1_to_slink2 /softlink2_to_slink2 + call :testing %h5diff% --follow-symlinks -v %srcfile14% %srcfile14% /softlink1_to_slink2 /softlink2_to_slink2 + call :tooltest h5diff_413.txt --follow-symlinks -v %file14% %file14% /softlink1_to_slink2 /softlink2_to_slink2 rem group vs linked_softlink_group1" - call :testing %h5diff% --follow-links -v %srcfile14% %srcfile14% /target_group /softlink3_to_slink2 - call :tooltest h5diff_414.txt --follow-links -v %file14% %file14% /target_group /softlink3_to_slink2 + call :testing %h5diff% --follow-symlinks -v %srcfile14% %srcfile14% /target_group /softlink3_to_slink2 + call :tooltest h5diff_414.txt --follow-symlinks -v %file14% %file14% /target_group /softlink3_to_slink2 rem linked_softlink_group1 vs group" - call :testing %h5diff% --follow-links -v %srcfile14% %srcfile14% /softlink3_to_slink2 /target_group - call :tooltest h5diff_415.txt --follow-links -v %file14% %file14% /softlink3_to_slink2 /target_group + call :testing %h5diff% --follow-symlinks -v %srcfile14% %srcfile14% /softlink3_to_slink2 /target_group + call :tooltest h5diff_415.txt --follow-symlinks -v %file14% %file14% /softlink3_to_slink2 /target_group rem linked_softlink_to_group1 vs linked_softlink_to_group2" - call :testing %h5diff% --follow-links -v %srcfile14% %srcfile14% /softlink3_to_slink2 /softlink4_to_slink2 - call :tooltest h5diff_416.txt --follow-links -v %file14% %file14% /softlink3_to_slink2 /softlink4_to_slink2 + call :testing %h5diff% --follow-symlinks -v %srcfile14% %srcfile14% /softlink3_to_slink2 /softlink4_to_slink2 + call :tooltest h5diff_416.txt --follow-symlinks -v %file14% %file14% /softlink3_to_slink2 /softlink4_to_slink2 rem non-exist-softlink vs softlink" - call :testing %h5diff% --follow-links -v %srcfile13% %srcfile13% /softlink_noexist /softlink_dset2 - call :tooltest h5diff_417.txt --follow-links -v %file13% %file13% /softlink_noexist /softlink_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile13% %srcfile13% /softlink_noexist /softlink_dset2 + call :tooltest h5diff_417.txt --follow-symlinks -v %file13% %file13% /softlink_noexist /softlink_dset2 rem softlink vs non-exist-softlink" - call :testing %h5diff% --follow-links -v %srcfile13% %srcfile13% /softlink_dset2 /softlink_noexist - call :tooltest h5diff_418.txt --follow-links -v %file13% %file13% /softlink_dset2 /softlink_noexist + call :testing %h5diff% --follow-symlinks -v %srcfile13% %srcfile13% /softlink_dset2 /softlink_noexist + call :tooltest h5diff_418.txt --follow-symlinks -v %file13% %file13% /softlink_dset2 /softlink_noexist rem non-exist-extlink_file vs extlink" - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile15% /ext_link_noexist2 /ext_link_dset2 - call :tooltest h5diff_419.txt --follow-links -v %file15% %file15% /ext_link_noexist2 /ext_link_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile15% /ext_link_noexist2 /ext_link_dset2 + call :tooltest h5diff_419.txt --follow-symlinks -v %file15% %file15% /ext_link_noexist2 /ext_link_dset2 rem exlink vs non-exist-extlink_file" - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile15% /ext_link_dset2 /ext_link_noexist2 - call :tooltest h5diff_420.txt --follow-links -v %file15% %file15% /ext_link_dset2 /ext_link_noexist2 + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile15% /ext_link_dset2 /ext_link_noexist2 + call :tooltest h5diff_420.txt --follow-symlinks -v %file15% %file15% /ext_link_dset2 /ext_link_noexist2 rem extlink vs non-exist-extlink_obj" - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile15% /ext_link_dset2 /ext_link_noexist1 - call :tooltest h5diff_421.txt --follow-links -v %file15% %file15% /ext_link_dset2 /ext_link_noexist1 + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile15% /ext_link_dset2 /ext_link_noexist1 + call :tooltest h5diff_421.txt --follow-symlinks -v %file15% %file15% /ext_link_dset2 /ext_link_noexist1 rem non-exist-extlink_obj vs extlink" - call :testing %h5diff% --follow-links -v %srcfile15% %srcfile15% /ext_link_noexist1 /ext_link_dset2 - call :tooltest h5diff_422.txt --follow-links -v %file15% %file15% /ext_link_noexist1 /ext_link_dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile15% %srcfile15% /ext_link_noexist1 /ext_link_dset2 + call :tooltest h5diff_422.txt --follow-symlinks -v %file15% %file15% /ext_link_noexist1 /ext_link_dset2 rem extlink_to_softlink_to_dset1 vs dset2" - call :testing %h5diff% --follow-links -v %srcfile17% %srcfile18% /ext_link_to_slink1 /dset2 - call :tooltest h5diff_423.txt --follow-links -v %file17% %file18% /ext_link_to_slink1 /dset2 + call :testing %h5diff% --follow-symlinks -v %srcfile17% %srcfile18% /ext_link_to_slink1 /dset2 + call :tooltest h5diff_423.txt --follow-symlinks -v %file17% %file18% /ext_link_to_slink1 /dset2 rem dset2 vs extlink_to_softlink_to_dset1" - call :testing %h5diff% --follow-links -v %srcfile18% %srcfile17% /dset2 /ext_link_to_slink1 - call :tooltest h5diff_424.txt --follow-links -v %file18% %file17% /dset2 /ext_link_to_slink1 + call :testing %h5diff% --follow-symlinks -v %srcfile18% %srcfile17% /dset2 /ext_link_to_slink1 + call :tooltest h5diff_424.txt --follow-symlinks -v %file18% %file17% /dset2 /ext_link_to_slink1 rem extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" - call :testing %h5diff% --follow-links -v %srcfile17% %srcfile17% /ext_link_to_slink1 /ext_link_to_slink2 - call :tooltest h5diff_425.txt --follow-links -v %file17% %file17% /ext_link_to_slink1 /ext_link_to_slink2 + call :testing %h5diff% --follow-symlinks -v %srcfile17% %srcfile17% /ext_link_to_slink1 /ext_link_to_slink2 + call :tooltest h5diff_425.txt --follow-symlinks -v %file17% %file17% /ext_link_to_slink1 /ext_link_to_slink2 rem ############################################################################## - rem # Dangling links compare (--follow-links and --no-dangling-links) + rem # Dangling links compare (--follow-symlinks and --no-dangling-links) rem ############################################################################## - rem dangling links --follow-links (FILE to FILE) - call :testing %h5diff% --follow-links -v %srclnkfile1% %srclnkfile2% - call :tooltest h5diff_450.txt --follow-links -v %lnkfile1% %lnkfile2% + rem dangling links --follow-symlinks (FILE to FILE) + call :testing %h5diff% --follow-symlinks -v %srclnkfile1% %srclnkfile2% + call :tooltest h5diff_450.txt --follow-symlinks -v %lnkfile1% %lnkfile2% - rem dangling links --follow-links and --no-dangling-links (FILE to FILE) - call :testing %h5diff% --follow-links -v --no-dangling-links %srclnkfile1% %srclnkfile2% - call :tooltest h5diff_451.txt --follow-links -v --no-dangling-links %lnkfile1% %lnkfile2% + rem dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srclnkfile1% %srclnkfile2% + call :tooltest h5diff_451.txt --follow-symlinks -v --no-dangling-links %lnkfile1% %lnkfile2% - rem try --no-dangling-links without --follow-links options + rem try --no-dangling-links without --follow-symlinks options call :testing %h5diff% --no-dangling-links %srcfile13% %srcfile13% call :tooltest h5diff_452.txt --no-dangling-links %file13% %file13% rem dangling link found for soft links (FILE to FILE) - call :testing %h5diff% --follow-links -v --no-dangling-links %srcfile13% %srcfile13% - call :tooltest h5diff_453.txt --follow-links -v --no-dangling-links %file13% %file13% + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srcfile13% %srcfile13% + call :tooltest h5diff_453.txt --follow-symlinks -v --no-dangling-links %file13% %file13% rem dangling link found for soft links (obj to obj) - call :testing %h5diff% --follow-links -v --no-dangling-links %srcfile13% %srcfile13% /softlink_dset2 /softlink_noexist - call :tooltest h5diff_454.txt --follow-links -v --no-dangling-links %file13% %file13% /softlink_dset2 /softlink_noexist + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srcfile13% %srcfile13% /softlink_dset2 /softlink_noexist + call :tooltest h5diff_454.txt --follow-symlinks -v --no-dangling-links %file13% %file13% /softlink_dset2 /softlink_noexist rem dangling link found for soft links (obj to obj) Both dangle links - call :testing %h5diff% --follow-links -v --no-dangling-links %srcfile13% %srcfile13% /softlink_noexist /softlink_noexist - call :tooltest h5diff_455.txt --follow-links -v --no-dangling-links %file13% %file13% /softlink_noexist /softlink_noexist + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srcfile13% %srcfile13% /softlink_noexist /softlink_noexist + call :tooltest h5diff_455.txt --follow-symlinks -v --no-dangling-links %file13% %file13% /softlink_noexist /softlink_noexist rem dangling link found for ext links (FILE to FILE) - call :testing %h5diff% --follow-links -v --no-dangling-links %srcfile15% %srcfile15% - call :tooltest h5diff_456.txt --follow-links -v --no-dangling-links %file15% %file15% + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srcfile15% %srcfile15% + call :tooltest h5diff_456.txt --follow-symlinks -v --no-dangling-links %file15% %file15% rem dangling link found for ext links (obj to obj). target file exist - call :testing %h5diff% --follow-links -v --no-dangling-links %srcfile15% %srcfile15% /ext_link_dset1 /ext_link_noexist1 - call :tooltest h5diff_457.txt --follow-links -v --no-dangling-links %file15% %file15% /ext_link_dset1 /ext_link_noexist1 + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srcfile15% %srcfile15% /ext_link_dset1 /ext_link_noexist1 + call :tooltest h5diff_457.txt --follow-symlinks -v --no-dangling-links %file15% %file15% /ext_link_dset1 /ext_link_noexist1 rem dangling link found for ext links (obj to obj). target file NOT exist - call :testing %h5diff% --follow-links -v --no-dangling-links %srcfile15% %srcfile15% /ext_link_dset1 /ext_link_noexist2 - call :tooltest h5diff_458.txt --follow-links -v --no-dangling-links %file15% %file15% /ext_link_dset1 /ext_link_noexist2 + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srcfile15% %srcfile15% /ext_link_dset1 /ext_link_noexist2 + call :tooltest h5diff_458.txt --follow-symlinks -v --no-dangling-links %file15% %file15% /ext_link_dset1 /ext_link_noexist2 rem dangling link found for ext links (obj to obj). Both dangle links - call :testing %h5diff% --follow-links -v --no-dangling-links %srcfile15% %srcfile15% /ext_link_noexist1 /ext_link_noexist2 - call :tooltest h5diff_459.txt --follow-links -v --no-dangling-links %file15% %file15% /ext_link_noexist1 /ext_link_noexist2 + call :testing %h5diff% --follow-symlinks -v --no-dangling-links %srcfile15% %srcfile15% /ext_link_noexist1 /ext_link_noexist2 + call :tooltest h5diff_459.txt --follow-symlinks -v --no-dangling-links %file15% %file15% /ext_link_noexist1 /ext_link_noexist2 rem ############################################################################## diff --git a/windows/tools/h5ls/testh5ls.bat b/windows/tools/h5ls/testh5ls.bat index 90321e5..7fa931b 100644 --- a/windows/tools/h5ls/testh5ls.bat +++ b/windows/tools/h5ls/testh5ls.bat @@ -172,17 +172,33 @@ rem ############################################################################ rem test for displaying soft links call :tooltest tslink-1.ls 0 -w80 -r tslink.h5 - rem test for displaying external and user-defined links + rem test for displaying more soft links with --follow-symlinks + call :tooltest tsoftlinks-1.ls 0 --follow-symlinks tsoftlinks.h5 + call :tooltest tsoftlinks-2.ls 0 --follow-symlinks -r tsoftlinks.h5 + call :tooltest tsoftlinks-3.ls 0 --follow-symlinks tsoftlinks.h5/group1 + call :tooltest tsoftlinks-4.ls 0 --follow-symlinks -r tsoftlinks.h5/group1 + call :tooltest tsoftlinks-5.ls 0 --follow-symlinks tsoftlinks.h5/soft_dset1 + + rem test for displaying external and user-defined links with + rem --follow-symlinks call :tooltest textlink-1.ls 0 -w80 -r textlink.h5 - call :tooltest textlinksrc-1.ls 0 -w80 -Er textlinksrc.h5 - call :tooltest textlinksrc-2.ls 0 -w80 -Erv textlinksrc.h5/ext_link5 - call :tooltest textlinksrc-3.ls 0 -w80 -Er textlinksrc.h5/ext_link1 + call :tooltest textlinksrc-1.ls 0 -w80 --follow-symlinks -r textlinksrc.h5 + call :tooltest textlinksrc-2.ls 0 -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5 + call :tooltest textlinksrc-3.ls 0 -w80 --follow-symlinks -r textlinksrc.h5/ext_link1 call :tooltest textlinksrc-4.ls 0 -w80 -r textlinksrc.h5 call :tooltest textlinksrc-5.ls 0 -w80 -r textlinksrc.h5/ext_link1 - call :tooltest textlinksrc-6.ls 0 -w80 -E textlinksrc.h5 - call :tooltest textlinksrc-7.ls 0 -w80 -E textlinksrc.h5/ext_link1 + call :tooltest textlinksrc-6.ls 0 -w80 --follow-symlinks textlinksrc.h5 + call :tooltest textlinksrc-7.ls 0 -w80 --follow-symlinks textlinksrc.h5/ext_link1 call :tooltest tudlink-1.ls 0 -w80 -r tudlink.h5 + rem test for displaying external links with -E + rem the option -E will be depriciated but keep it for backward compatibility + call :tooltest textlinksrc-1-old.ls 0 -w80 -Er textlinksrc.h5 + call :tooltest textlinksrc-2-old.ls 0 -w80 -Erv textlinksrc.h5/ext_link5 + call :tooltest textlinksrc-3-old.ls 0 -w80 -Er textlinksrc.h5/ext_link1 + call :tooltest textlinksrc-6-old.ls 0 -w80 -E textlinksrc.h5 + call :tooltest textlinksrc-7-old.ls 0 -w80 -E textlinksrc.h5/ext_link1 + rem tests for hard links call :tooltest thlink-1.ls 0 -w80 thlink.h5 -- cgit v0.12