From 223b3765293852c94b84e5b40c7585ecc5021eaa Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Fri, 22 Oct 2021 10:03:51 -0500 Subject: 1.8 Merge cmake and flag changes from develop (#1119) * Merge cmake and flag changes from develop * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- CMakeLists.txt | 15 +++ MANIFEST | 4 + c++/test/CMakeVFDTests.cmake | 14 +-- config/cmake/HDF5Macros.cmake | 37 +++++++ config/cmake/HDFCXXCompilerFlags.cmake | 4 +- config/gnu-cxxflags | 4 +- config/gnu-warnings/cxx-developer-4.8 | 16 +++ config/gnu-warnings/no-cxx-developer-4.8 | 9 ++ configure.ac | 84 +++++++++++++++ doxygen/CMakeLists.txt | 46 +++++++++ doxygen/Doxyfile.in | 15 +-- doxygen/aliases | 4 + doxygen/dox/About.dox | 2 + doxygen/dox/MetadataCachingInHDF5.dox | 2 +- doxygen/dox/rm-template.dox | 171 ++++++++++++++++++------------- doxygen/examples/H5D_examples.c | 1 - doxygen/examples/H5F_examples.c | 42 ++++++-- doxygen/examples/H5_examples.c | 79 ++++++++++++++ doxygen/hdf5_header.html | 2 +- release_docs/RELEASE.txt | 6 +- src/CMakeLists.txt | 44 ++------ test/CMakeLists.txt | 46 +-------- test/CMakeVFDTests.cmake | 14 +-- test/cache_common.h | 149 +++++++++++++++------------ testpar/CMakeVFDTests.cmake | 20 +--- tools/CMakeLists.txt | 2 +- tools/h5dump/CMakeVFDTests.cmake | 19 +--- tools/h5repack/CMakeVFDTests.cmake | 14 +-- 28 files changed, 551 insertions(+), 314 deletions(-) create mode 100644 config/gnu-warnings/cxx-developer-4.8 create mode 100644 config/gnu-warnings/no-cxx-developer-4.8 create mode 100644 doxygen/CMakeLists.txt create mode 100644 doxygen/examples/H5_examples.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 67e624e..7c28902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -765,6 +765,21 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT endif () #----------------------------------------------------------------------------- +# Option to build documentation +#----------------------------------------------------------------------------- +option (HDF5_BUILD_DOC "Build documentation" OFF) +if (HDF5_BUILD_DOC AND EXISTS "${HDF5_DOXYGEN_DIR}" AND IS_DIRECTORY "${HDF5_DOXYGEN_DIR}") +# check if Doxygen is installed + find_package(Doxygen) + if (DOXYGEN_FOUND) + message(STATUS "Doxygen version: ${DOXYGEN_VERSION}") + add_subdirectory (doxygen) + else () + message(STATUS "Doxygen needs to be installed to generate the doxygen documentation") + endif () +endif () + +#----------------------------------------------------------------------------- # Dashboard and Testing Settings #----------------------------------------------------------------------------- option (BUILD_TESTING "Build HDF5 Unit Testing" ON) diff --git a/MANIFEST b/MANIFEST index b53c2d3..bc30f43 100644 --- a/MANIFEST +++ b/MANIFEST @@ -167,6 +167,7 @@ ./config/gnu-warnings/cxx-4.9 ./config/gnu-warnings/cxx-5 ./config/gnu-warnings/cxx-9 +./config/gnu-warnings/cxx-developer-4.8 ./config/gnu-warnings/cxx-error-5 ./config/gnu-warnings/cxx-error-general ./config/gnu-warnings/developer-4.8 @@ -183,6 +184,7 @@ ./config/gnu-warnings/gfort-5 ./config/gnu-warnings/gfort-6 ./config/gnu-warnings/gfort-8 +./config/gnu-warnings/no-cxx-developer-4.8 ./config/gnu-warnings/no-developer-4.8 ./config/gnu-warnings/no-developer-8 ./config/gnu-warnings/no-developer-general @@ -197,6 +199,7 @@ ./config/site-specific/BlankForm ./doxygen/aliases +./doxygen/CMakeLists.txt ./doxygen/Doxyfile.in ./doxygen/dox/About.dox ./doxygen/dox/Cookbook.dox @@ -232,6 +235,7 @@ ./doxygen/examples/H5Pget_metadata_read_attempts.2.c ./doxygen/examples/H5Pget_metadata_read_attempts.3.c ./doxygen/examples/H5Pget_object_flush_cb.c +./doxygen/examples/H5_examples.c ./doxygen/examples/ImageSpec.html ./doxygen/examples/PaletteExample1.gif ./doxygen/examples/Palettes.fm.anc.gif diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake index f1c6799..d525bb5 100644 --- a/c++/test/CMakeVFDTests.cmake +++ b/c++/test/CMakeVFDTests.cmake @@ -16,18 +16,7 @@ ############################################################################## ############################################################################## -set (VFD_LIST - sec2 - stdio - core - split - multi - family -) - -if (H5_HAVE_DIRECT) - set (VFD_LIST ${VFD_LIST} direct) -endif () +H5_SET_VFD_LIST() ############################################################################## ############################################################################## @@ -37,7 +26,6 @@ endif () macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") add_test ( NAME CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} -E remove diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 090524a..b3cf015 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -58,5 +58,42 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) endif () endif () endif () +endmacro () + +macro (H5_SET_VFD_LIST) + set (VFD_LIST + sec2 + stdio + core + core_paged + split + multi + family + splitter + #log - log VFD currently has file space allocation bugs + ) + + if (H5_HAVE_DIRECT) + set (VFD_LIST ${VFD_LIST} direct) + endif () + if (H5_HAVE_PARALLEL) + # MPI I/O VFD is currently incompatible with too many tests in the VFD test set + # set (VFD_LIST ${VFD_LIST} mpio) + endif () + if (H5_HAVE_MIRROR_VFD) + set (VFD_LIST ${VFD_LIST} mirror) + endif () + if (H5_HAVE_ROS3_VFD) + set (VFD_LIST ${VFD_LIST} ros3) + endif () + if (H5_HAVE_LIBHDFS) + set (VFD_LIST ${VFD_LIST} hdfs) + endif () + if (H5_HAVE_WINDOWS) + set (VFD_LIST ${VFD_LIST} windows) + endif () + foreach (vfdtest ${VFD_LIST}) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") + endforeach () endmacro () diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index f992aa0..0403834 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -179,9 +179,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.8") if (HDF5_ENABLE_DEV_WARNINGS) # Use the C warnings as CXX warnings are the same - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-developer-4.8") else () - ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8") + ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-cxx-developer-4.8") endif () endif () diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index d116062..7575ada 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -221,8 +221,8 @@ if test "X-g++" = "X-$cxx_vendor"; then if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.8)" # Use the C warnings as CXX warnings are the same - DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)" - NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)" + DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments cxx-developer-4.8)" + NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-cxx-developer-4.8)" fi # gcc >= 4.9 diff --git a/config/gnu-warnings/cxx-developer-4.8 b/config/gnu-warnings/cxx-developer-4.8 new file mode 100644 index 0000000..e0d975f --- /dev/null +++ b/config/gnu-warnings/cxx-developer-4.8 @@ -0,0 +1,16 @@ +# developer warning flags added for GCC >= 4.5 +# +# developer warning flag added for GCC >= 4.6 +-Wsuggest-attribute=const + +# developer warning flags added for GCC >= 4.7 +-Wsuggest-attribute=noreturn +-Wsuggest-attribute=pure +# +# It's not clear that -Wvector-operation-performance warnings are +# actionable, so they are demoted to "developer" warnings. +# +-Wvector-operation-performance + +# developer warning flag added for GCC >= 4.8 +-Wsuggest-attribute=format diff --git a/config/gnu-warnings/no-cxx-developer-4.8 b/config/gnu-warnings/no-cxx-developer-4.8 new file mode 100644 index 0000000..3c3de93 --- /dev/null +++ b/config/gnu-warnings/no-cxx-developer-4.8 @@ -0,0 +1,9 @@ +# no-developer warning flag added for GCC >= 4.6 +-Wno-suggest-attribute=const + +# no-developer warning flags added for GCC >= 4.7 +-Wno-suggest-attribute=noreturn +-Wno-suggest-attribute=pure + +# no-developer warning flag added for GCC >= 4.8 +-Wno-suggest-attribute=format diff --git a/configure.ac b/configure.ac index a0ee2bd..5256f3d 100644 --- a/configure.ac +++ b/configure.ac @@ -881,6 +881,89 @@ else fi ## ---------------------------------------------------------------------- +## Check if they would like to enable building doxygen files +## + +## This needs to be exposed for the library info file. +AC_SUBST([HDF5_DOXYGEN]) + +## Default is to not build DOXYGEN +HDF5_DOXYGEN=no + +AC_MSG_CHECKING([if building doxygen is enabled]) + +AC_ARG_ENABLE([doxygen], + [AS_HELP_STRING([--enable-doxygen], + [Compile the HDF5 doxygen files [default=no]])], + [HDF5_DOXYGEN=$enableval]) + +if test "X$HDF5_DOXYGEN" = "Xyes"; then + AC_MSG_RESULT([yes]) + DX_DOXYGEN_FEATURE(ON) + DX_DOT_FEATURE(OFF) + DX_HTML_FEATURE(ON) + DX_CHM_FEATURE(OFF) + DX_CHI_FEATURE(OFF) + DX_MAN_FEATURE(ON) + DX_RTF_FEATURE(OFF) + DX_XML_FEATURE(OFF) + DX_PDF_FEATURE(OFF) + DX_PS_FEATURE(OFF) + + AC_SUBST([DOXYGEN_PACKAGE]) + AC_SUBST([DOXYGEN_VERSION_STRING]) + AC_SUBST([DOXYGEN_INCLUDE_ALIASES]) + AC_SUBST([DOXYGEN_PROJECT_LOGO]) + AC_SUBST([DOXYGEN_PROJECT_BRIEF]) + AC_SUBST([DOXYGEN_INPUT_DIRECTORY]) + AC_SUBST([DOXYGEN_OPTIMIZE_OUTPUT_FOR_C]) + AC_SUBST([DOXYGEN_MACRO_EXPANSION]) + AC_SUBST([DOXYGEN_OUTPUT_DIRECTORY]) + AC_SUBST([DOXYGEN_EXAMPLES_DIRECTORY]) + AC_SUBST([DOXYGEN_LAYOUT_FILE]) + AC_SUBST([DOXYGEN_HTML_HEADER]) + AC_SUBST([DOXYGEN_HTML_FOOTER]) + AC_SUBST([DOXYGEN_HTML_EXTRA_STYLESHEET]) + AC_SUBST([DOXYGEN_HTML_EXTRA_FILES]) + AC_SUBST([DOXYGEN_TAG_FILE]) + AC_SUBST([DOXYGEN_SERVER_BASED_SEARCH]) + AC_SUBST([DOXYGEN_EXTERNAL_SEARCH]) + AC_SUBST([DOXYGEN_SEARCHENGINE_URL]) + AC_SUBST([DOXYGEN_STRIP_FROM_PATH]) + AC_SUBST([DOXYGEN_PREDEFINED]) + +# SRCDIR Environment variables used inside doxygen macro for the source location: + DOXYGEN_PACKAGE=${PACKAGE_NAME} + DOXYGEN_VERSION_STRING=${PACKAGE_VERSION} + DOXYGEN_INCLUDE_ALIASES='$(SRCDIR)/doxygen/aliases' + DOXYGEN_PROJECT_LOGO='$(SRCDIR)/doxygen/img/HDFG-logo.png' + DOXYGEN_PROJECT_BRIEF='C-API Reference' + DOXYGEN_INPUT_DIRECTORY='$(SRCDIR) $(SRCDIR)/doxygen/dox' + DOXYGEN_OPTIMIZE_OUTPUT_FOR_C=YES + DOXYGEN_MACRO_EXPANSION=YES + DOXYGEN_OUTPUT_DIRECTORY=hdf5lib_docs + DOXYGEN_EXAMPLES_DIRECTORY='$(SRCDIR)/doxygen/dox/cookbook $(SRCDIR)/doxygen/examples $(SRCDIR)/src $(SRCDIR)/examples $(SRCDIR)/test' + DOXYGEN_LAYOUT_FILE='$(SRCDIR)/doxygen/hdf5doxy_layout.xml' + DOXYGEN_HTML_HEADER='$(SRCDIR)/doxygen/hdf5_header.html' + DOXYGEN_HTML_FOOTER='$(SRCDIR)/doxygen/hdf5_footer.html' + DOXYGEN_HTML_EXTRA_STYLESHEET='$(SRCDIR)/doxygen/hdf5doxy.css' + DOXYGEN_HTML_EXTRA_FILES='$(SRCDIR)/doxygen/hdf5_navtree_hacks.js $(SRCDIR)/doxygen/img/ftv2node.png $(SRCDIR)/doxygen/img/ftv2pnode.png' + DOXYGEN_TAG_FILE=hdf5.tag + DOXYGEN_SERVER_BASED_SEARCH=NO + DOXYGEN_EXTERNAL_SEARCH=NO + DOXYGEN_SEARCHENGINE_URL= + DOXYGEN_STRIP_FROM_PATH='$(SRCDIR)' + DOXYGEN_PREDEFINED='H5_HAVE_DIRECT H5_HAVE_LIBHDFS H5_HAVE_MAP_API H5_HAVE_PARALLEL H5_HAVE_ROS3_VFD' + + DX_INIT_DOXYGEN([HDF5], [./doxygen/Doxyfile], [hdf5lib_docs]) + +else + AC_MSG_RESULT([no]) + echo "Doxygen support is disabled" +fi + + +## ---------------------------------------------------------------------- ## Create libtool. If shared/static libraries are going to be enabled ## or disabled, it should happen before these macros. LT_PREREQ([2.2]) @@ -3601,6 +3684,7 @@ AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) AC_CONFIG_FILES([src/libhdf5.settings Makefile + doxygen/Doxyfile src/Makefile test/Makefile test/testcheck_version.sh diff --git a/doxygen/CMakeLists.txt b/doxygen/CMakeLists.txt new file mode 100644 index 0000000..36ce590 --- /dev/null +++ b/doxygen/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 3.12) +project (HDF5_DOXYGEN C) + +#----------------------------------------------------------------------------- +# Option to build documentation +#----------------------------------------------------------------------------- +if (DOXYGEN_FOUND) + set (DOXYGEN_PACKAGE ${HDF5_PACKAGE_NAME}) + set (DOXYGEN_VERSION_STRING ${HDF5_PACKAGE_VERSION_STRING}) + set (DOXYGEN_INCLUDE_ALIASES_PATH ${HDF5_DOXYGEN_DIR}) + set (DOXYGEN_INCLUDE_ALIASES aliases) + set (DOXYGEN_VERBATIM_VARS DOXYGEN_INCLUDE_ALIASES) + set (DOXYGEN_PROJECT_LOGO ${HDF5_DOXYGEN_DIR}/img/HDFG-logo.png) + set (DOXYGEN_PROJECT_BRIEF "C-API Reference") + set (DOXYGEN_INPUT_DIRECTORY "${HDF5_SOURCE_DIR} ${HDF5_DOXYGEN_DIR}/dox ${HDF5_GENERATED_SOURCE_DIR}") + set (DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES) + set (DOXYGEN_MACRO_EXPANSION YES) + set (DOXYGEN_OUTPUT_DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs) + set (DOXYGEN_EXAMPLES_DIRECTORY "${HDF5_DOXYGEN_DIR}/dox/cookbook ${HDF5_DOXYGEN_DIR}/examples ${HDF5_SRC_DIR} ${HDF5_SOURCE_DIR}/examples ${HDF5_TEST_SRC_DIR}") + set (DOXYGEN_LAYOUT_FILE ${HDF5_DOXYGEN_DIR}/hdf5doxy_layout.xml) + set (DOXYGEN_HTML_HEADER ${HDF5_DOXYGEN_DIR}/hdf5_header.html) + set (DOXYGEN_HTML_FOOTER ${HDF5_DOXYGEN_DIR}/hdf5_footer.html) + set (DOXYGEN_HTML_EXTRA_STYLESHEET ${HDF5_DOXYGEN_DIR}/hdf5doxy.css) + set (DOXYGEN_HTML_EXTRA_FILES "${HDF5_DOXYGEN_DIR}/hdf5_navtree_hacks.js ${HDF5_DOXYGEN_DIR}/img/ftv2node.png ${HDF5_DOXYGEN_DIR}/img/ftv2pnode.png") + set (DOXYGEN_TAG_FILE ${HDF5_BINARY_DIR}/hdf5.tag) + set (DOXYGEN_SERVER_BASED_SEARCH NO) + set (DOXYGEN_EXTERNAL_SEARCH NO) + set (DOXYGEN_SEARCHENGINE_URL) + set (DOXYGEN_STRIP_FROM_PATH ${HDF5_SOURCE_DIR}) + set (DOXYGEN_PREDEFINED "H5_HAVE_DIRECT H5_HAVE_LIBHDFS H5_HAVE_MAP_API H5_HAVE_PARALLEL H5_HAVE_ROS3_VFD") + +# This configure and individual custom targets work together + # Replace variables inside @@ with the current values + configure_file (${HDF5_DOXYGEN_DIR}/Doxyfile.in ${HDF5_BINARY_DIR}/Doxyfile @ONLY) + + install ( + DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs/html + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT Documents + ) + + if (NOT TARGET doxygen) + add_custom_target (doxygen) + endif () + +endif () diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 0e41a7b..afc8f3a 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -170,7 +170,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = @DOXYGEN_STRIP_FROM_PATH@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -858,10 +858,12 @@ FILE_PATTERNS = H5*public.h \ H5FDcore.h \ H5FDdirect.h \ H5FDfamily.h \ + H5FDhdfs.h \ H5FDlog.h \ H5FDmpi.h \ H5FDmpio.h \ H5FDmulti.h \ + H5FDros3.h \ H5FDsec2.h \ H5FDstdio.h \ H5FDwindows.h \ @@ -1118,13 +1120,6 @@ CLANG_DATABASE_PATH = ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -2174,7 +2169,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = H5_HAVE_PARALLEL +PREDEFINED = @DOXYGEN_PREDEFINED@ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2218,7 +2213,7 @@ TAGFILES = # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = @DOXYGEN_TAG_FILE@ # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be diff --git a/doxygen/aliases b/doxygen/aliases index cf74a71..9b162c3 100644 --- a/doxygen/aliases +++ b/doxygen/aliases @@ -16,6 +16,7 @@ ALIASES += success{1}="\Bold{Success:} \1" ALIASES += failure{1}="\Bold{Failure:} \1" ALIASES += herr_t="Returns a non-negative value if successful; otherwise returns a negative value." +ALIASES += herr_t_iter="\li Zero causes the iterator to continue, returning zero when the iteration is complete. \li A positive value causes the iterator to immediately return that positive value, indicating short-circuit success. \li A negative value causes the iterator to immediately return that value, indicating failure." ALIASES += hid_t{1}="Returns a \1 identifier if successful; otherwise returns #H5I_INVALID_HID. " ALIASES += hid_ti{1}="Returns an \1 identifier if successful; otherwise returns #H5I_INVALID_HID. " ALIASES += hid_tv{1}="Returns an \1 identifier if successful; otherwise returns a negative value. " @@ -118,6 +119,8 @@ ALIASES += fg_loc_id{1}="\loc_id{\1}. The identifier may be that of a file or gr # Property lists ################################################################################ +ALIASES += plist_unused{1}="\note The \p \1 parameter is currently not used; specify #H5P_DEFAULT." + ALIASES += aapl_id="\param[in] aapl_id Attribute access property list identifier" ALIASES += aapl_id{1}="\param[in] \1 Attribute access property list identifier" @@ -173,6 +176,7 @@ ALIASES += fgdta_loc_obj_id{1}="\loc_obj_id{\1}. The identifier may be that of a ALIASES += estack_id="\param[in] estack_id Error stack identifier" ALIASES += estack_id{1}="\param[in] \1 Error stack identifier" ALIASES += cpp_c_api_note="\attention \Bold{C++ Developers using HDF5 C-API functions beware:}\n Several functions in this C-API take function pointers or callbacks as arguments. Examples include H5Pset_elink_cb(), H5Pset_type_conv_cb(), H5Tconvert(), and H5Ewalk2(). Application code must ensure that those callback functions return normally such to allow the HDF5 to manage its resources and maintain a consistent state. For instance, those functions must not use the C \c setjmp / \c longjmp mechanism to leave those callback functions. Within the context of C++, any exceptions thrown within the callback function must be caught, such as with a \Code{catch(…)} statement. Any exception state can be placed within the provided user data function call arguments, and may be thrown again once the calling function has returned. Exceptions raised and not handled inside the callback are not supported as it might leave the HDF5 library in an inconsistent state. Similarly, using C++20 coroutines cannot be used as callbacks, since they do not support plain return statements. If a callback function yields execution to another C++20 coroutine calling HDF5 functions as well, this may lead to undefined behavior." +ALIASES += par_compr_note="\attention If you are planning to use compression with parallel HDF5, ensure that calls to H5Dwrite() occur in collective mode. In other words, all MPI ranks (in the relevant communicator) call H5Dwrite() and pass a dataset transfer property list with the MPI-IO collective option property set to #H5FD_MPIO_COLLECTIVE_IO.\n Note that data transformations are currently \Bold{not} supported when writing to datasets in parallel and with compression enabled." ALIASES += sa_metadata_ops="\sa \li H5Pget_all_coll_metadata_ops() \li H5Pget_coll_metadata_write() \li H5Pset_all_coll_metadata_ops() \li H5Pset_coll_metadata_write() \li \ref maybe_metadata_reads" ################################################################################ diff --git a/doxygen/dox/About.dox b/doxygen/dox/About.dox index 3be9202..777b2a6 100644 --- a/doxygen/dox/About.dox +++ b/doxygen/dox/About.dox @@ -1,5 +1,7 @@ /** \page About About +\section about_history History + The implementation of this documentation set is based on the fantastic work of the Eigen project. Please refer to their GitLab repository diff --git a/doxygen/dox/MetadataCachingInHDF5.dox b/doxygen/dox/MetadataCachingInHDF5.dox index 9ba0fab..adaf110 100644 --- a/doxygen/dox/MetadataCachingInHDF5.dox +++ b/doxygen/dox/MetadataCachingInHDF5.dox @@ -692,7 +692,7 @@ The \ref H5AC_cache_config_t.decrement "decrement" and \ref H5AC_cache_config_t.upper_hr_threshold "upper_hr_threshold" fields are ignored in this case. -\subsubsection awhrtcsr Ageout With Hit Rate Threshold Cache Size Reduction +\subsubsection dawhrtcsr Ageout With Hit Rate Threshold Cache Size Reduction If \ref H5AC_cache_config_t.decr_mode "decr_mode" is #H5C_decr__age_out_with_threshold, the cache size is decreased by the ageout diff --git a/doxygen/dox/rm-template.dox b/doxygen/dox/rm-template.dox index 64e4770..ebf8aed 100644 --- a/doxygen/dox/rm-template.dox +++ b/doxygen/dox/rm-template.dox @@ -1,72 +1,99 @@ -/**\ingroup H5XYZ - * - * \brief A synopsis of what H5XYZgreat_function does - * - * \param[in] name1 Description of IN parameter \p name1 - * \param[out] name2 Description of OUT parameter \p name2 - * \param[in,out] name3 Description of INOUT parameter \p name3 - * - * \return Returns what you always wanted - * - * \pre Describe preconditions for an entity. Can be repreated. - * - * \invariant Describe invariants for an entity. Can be repeated. - * - * \post Describe postconditions for an entity. Can be repreated. - * - * \deprecated This was my favorite function while it lasted. - * - * \details Describe the normal behavior flow of the function here. Try to be - * helpful! - * - * Make reference to other functions like this: H5Fopen(). - * - * Make reference to formal parameters like this: \p name1 - * - * Make reference to macros like this: #H5P_DEFAULT. - * - * Make reference to enumeration constants like this: #H5F_CLOSE_WEAK. - * - * Include code snippets like this: - * \snippet H5Zpublic.h H5Z_class2_t_snip - * - * Lists are supported: - * - mouse events - * -# mouse move event - * -# mouse click event\n - * More info about the click event. - * -# mouse double click event - * - keyboard events - * 1. key down event - * 2. key up event - * - * The distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is - * \f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.\n - * For tables, see - * this example. - * - * This is an example of how to use the H5XYZgreat_function().\n - * The contents of the file hello_hdf5.c will be included. - * \include hello_hdf5.c - * - * \note Dear reader, ... - * - * \attention Colorless green ideas sleep furiously. - * - * \warning Don't do this at home! - * - * \author This function was written by an esteemed author. Repeat this - * command for multiple authors. - * - * \date Record the function's birthdate! - * - * \since 1.MAJOR.MINOR The 'since' command can also be used to record a - * function's introduction (via its initial release - * version). - * - * \version 1.MAJOR.MINOR An important event in the version history of this - * function. There can be multiple such events. - * - * \see H5XYZanother_great_function(), H5XYZnot_so_great_a_function() - * - */ +/** \page RMT Reference Manual (RM) Page Template + +We treat documentation like code and use +Doxygen to +markup +comments in the code or create +stand-alone pages. + +Every RM entry consists of a subset of the elements listed below. Not every RM +entry warrants the full set. More is better, and we can, perhaps, distinguish +minimal, typical, and great RM entries. + +A minimal RM entry must include elements 1-3, 8, 11, and 7 if applicable. + +A \Emph{typical} RM entry is a minimal RM entry that in addition has elements +9, 10, and 12. + +A \Bold{great} RM entry is a typical RM entry plus everything else. + +The current RM is a mixed bag. Take what's there with a pinch of salt and apply +the Scout Rule! + +\par RM entry elements + +1. Module indication + - Indicate the HDF5 module in which the function will appear. + \verbatim + * \ingroup H5XYZ + \endverbatim +2. Synopsis + - A phrase or sentence that summarizes the function's purpose + \verbatim + * \brief Simplifies your life + \endverbatim +3. Prototype (parameters and return value) + - A description of the function parameters and return value + \verbatim + * \param[in] name1 Description of IN parameter \p name1 + * \param[out] name2 Description of OUT parameter \p name2 + * \param[in,out] name3 Description of INOUT parameter \p name3 + * \return Returns what you always wanted + \endverbatim + - Clearly indicate the parameter direction as \c in, \c out, or + \Code{in,out} + - Make reference to other parameters using \Code{\\p} +4. Preconditions + - A set of preconditions that must be met. + \verbatim + * \pre The argmument supplied in parameter \p name2 must be even. + \endverbatim +5. Invariants + - A set of invariants. + \verbatim + * \invariant The mouse pointer will always be visible. + \endverbatim +6. Postconditions + - What will be true when the function returns. + \verbatim + * \post On error, the output parameters will be unmodified. + \endverbatim +7. Deprecation note + - If a function was deprecated, list the version in which the function was + deprecated (below), why it was deprecated, and which function(s) succeed it. + \verbatim + * \deprecated Deprecated in favor of another great function. + \endverbatim +8. Details + - A detailed description of the function's behavior + \verbatim + * \details This is the heart of the matter. Try to be helpful! + \endverbatim +9. Example + - The function in context and action, usually a (Doxygen) snippet. + \verbatim + * \par Example + * \snippet H5F_examples.c minimal + \endverbatim +10. Instruction (attention, note, warning) + - Behaviors, features, side-effects, etc. the user should be aware of + \verbatim + * \note Dear reader, ... + * + * \attention Colorless green ideas sleep furiously. + * + * \warning Don't do this at home! + \endverbatim +11. Since + - The HDF5 library version in which the function was introduced + \verbatim + * \since 1.MAJOR.MINOR + \endverbatim +12. Version + - Use this element to record a deprecation version, a change in parameter + types, changes in behavior, etc. + \verbatim + * \version 1.MAJOR.MINOR Function was deprecated in this release + \endverbatim + +*/ \ No newline at end of file diff --git a/doxygen/examples/H5D_examples.c b/doxygen/examples/H5D_examples.c index aad057d..dfc3ece 100644 --- a/doxygen/examples/H5D_examples.c +++ b/doxygen/examples/H5D_examples.c @@ -166,7 +166,6 @@ fail_delete: H5Fclose(file); fail_file:; } - //! return ret_val; diff --git a/doxygen/examples/H5F_examples.c b/doxygen/examples/H5F_examples.c index a7ce6fb..0ca0cd8 100644 --- a/doxygen/examples/H5F_examples.c +++ b/doxygen/examples/H5F_examples.c @@ -10,7 +10,7 @@ main(void) { int ret_val = EXIT_SUCCESS; - //! + //! { __label__ fail_fapl, fail_fcpl, fail_file; hid_t fcpl, fapl, file; @@ -48,12 +48,13 @@ fail_fapl: H5Pclose(fcpl); fail_fcpl:; } - //! + //! - //! + //! { __label__ fail_fapl, fail_file; - hid_t fapl, file; + hid_t fapl, file; + hsize_t size; if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) { ret_val = EXIT_FAILURE; @@ -63,7 +64,7 @@ fail_fcpl:; // adjust the file access properties } - unsigned mode = H5F_ACC_RDWR; + unsigned mode = H5F_ACC_RDONLY; char name[] = "f1.h5"; if ((file = H5Fopen(name, mode, fapl)) == H5I_INVALID_HID) { @@ -71,14 +72,41 @@ fail_fcpl:; goto fail_file; } - // do something useful with FILE + if (H5Fget_filesize(file, &size) < 0) { + ret_val = EXIT_FAILURE; + } + + printf("File size: %llu bytes\n", size); H5Fclose(file); fail_file: H5Pclose(fapl); fail_fapl:; } - //! + //! + + //! + { + __label__ fail_file; + hid_t file; + + unsigned mode = H5F_ACC_RDWR; + char name[] = "f1.h5"; + + if ((file = H5Fopen(name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) { + ret_val = EXIT_FAILURE; + goto fail_file; + } + + // create a cycle by hard linking the root group in the root group + if (H5Lcreate_hard(file, ".", file, "loopback", H5P_DEFAULT, H5P_DEFAULT) < 0) { + ret_val = EXIT_FAILURE; + } + + H5Fclose(file); +fail_file:; + } + //! //! { diff --git a/doxygen/examples/H5_examples.c b/doxygen/examples/H5_examples.c new file mode 100644 index 0000000..426da8b --- /dev/null +++ b/doxygen/examples/H5_examples.c @@ -0,0 +1,79 @@ +/* -*- c-file-style: "stroustrup" -*- */ + +#include "hdf5.h" + +#include +#include +#include + +//! +void +closing_shop(void *ctx) +{ + printf("GoodBye, Cruel World!\n"); +} +//! + +int +main(void) +{ + int ret_val = EXIT_SUCCESS; + + //! + { + // an HDF5 library instance is automatically initialized as + // part of the first HDF5 API call, but there's no harm in + // calling H5open(). + if (H5open() < 0) { + ret_val = EXIT_FAILURE; + } + } + //! + + //! + { + __label__ fail_read; + unsigned majnum, minnum, relnum; + hbool_t flag; + + // retrieve the library version + if (H5get_libversion(&majnum, &minnum, &relnum) < 0) { + ret_val = EXIT_FAILURE; + goto fail_read; + } + // is this a thread-safe library build? + if (H5is_library_threadsafe(&flag) < 0) { + ret_val = EXIT_FAILURE; + goto fail_read; + } + + printf("Welcome to HDF5 %d.%d.%d\n", majnum, minnum, relnum); + printf("Thread-safety %s\n", (flag > 0) ? "enabled" : "disabled"); + +fail_read:; + } + //! + + //! + { + // update the library instance free list limits + if (H5set_free_list_limits(512 * 1024, 32 * 1024, 2048 * 1024, 128 * 1024, 8192 * 1024, 512 * 1024) < + 0) { + ret_val = EXIT_FAILURE; + } + } + //! + + //! + { + // close shop + if (H5close() < 0) { + ret_val = EXIT_FAILURE; + } + } + //! + + assert(ret_val == EXIT_SUCCESS); + + return ret_val; +} diff --git a/doxygen/hdf5_header.html b/doxygen/hdf5_header.html index 4a575d6..23f41f9 100644 --- a/doxygen/hdf5_header.html +++ b/doxygen/hdf5_header.html @@ -21,7 +21,7 @@ $mathjax -
Please, help us to better know about our user community by answering the following short survey: https://www.hdfgroup.org/
+
Please, help us to better know about our user community by answering the following short survey: https://www.hdfgroup.org/website-survey/
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d0a1eb3..c81611e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -19,7 +19,7 @@ Links to HDF5 documentation can be found on The HDF5 web page: The official HDF5 releases can be obtained from: - https://portal.hdfgroup.org/display/support/HDF5+1.8.22 + https://www.hdfgroup.org/downloads/hdf5/ Changes from Release to Release and New Features in the HDF5-1.8.x release series can be found at: @@ -51,8 +51,8 @@ New Features ------------- - Changed autotools and CMake configurations to derive both compilation warnings-as-errors and warnings-only-warn configurations - from the same files, `config/*/*error*`. Removed redundant files - `config/*/*noerror*`. + from the same files, 'config/*/*error*'. Removed redundant files + 'config/*/*noerror*'. (DCY - 2021/09/29) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83bbe1a..0798a51 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1168,36 +1168,6 @@ endif () # Option to build documentation #----------------------------------------------------------------------------- if (DOXYGEN_FOUND) - set (DOXYGEN_PACKAGE ${HDF5_PACKAGE_NAME}) - set (DOXYGEN_VERSION_STRING ${HDF5_PACKAGE_VERSION_STRING}) - set (DOXYGEN_INCLUDE_ALIASES_PATH ${HDF5_DOXYGEN_DIR}) - set (DOXYGEN_INCLUDE_ALIASES aliases) - set (DOXYGEN_VERBATIM_VARS DOXYGEN_INCLUDE_ALIASES) - set (DOXYGEN_PROJECT_LOGO ${HDF5_DOXYGEN_DIR}/img/HDFG-logo.png) - set (DOXYGEN_PROJECT_BRIEF "C-API Reference") - set (DOXYGEN_INPUT_DIRECTORY "${HDF5_SRC_DIR} ${HDF5_DOXYGEN_DIR}/dox ${HDF5_GENERATED_SOURCE_DIR}") - set (DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES) - set (DOXYGEN_MACRO_EXPANSION YES) - set (DOXYGEN_OUTPUT_DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs) - set (DOXYGEN_EXAMPLES_DIRECTORY "${HDF5_DOXYGEN_DIR}/examples ${HDF5_SRC_DIR} ${HDF5_SOURCE_DIR}/examples ${HDF5_TEST_SRC_DIR}") - set (DOXYGEN_LAYOUT_FILE ${HDF5_DOXYGEN_DIR}/hdf5doxy_layout.xml) - set (DOXYGEN_HTML_HEADER ${HDF5_DOXYGEN_DIR}/hdf5_header.html) - set (DOXYGEN_HTML_FOOTER ${HDF5_DOXYGEN_DIR}/hdf5_footer.html) - set (DOXYGEN_HTML_EXTRA_STYLESHEET ${HDF5_DOXYGEN_DIR}/hdf5doxy.css) - set (DOXYGEN_HTML_EXTRA_FILES "${HDF5_DOXYGEN_DIR}/hdf5_navtree_hacks.js ${HDF5_DOXYGEN_DIR}/img/ftv2node.png ${HDF5_DOXYGEN_DIR}/img/ftv2pnode.png") - set (DOXYGEN_SERVER_BASED_SEARCH NO) - set (DOXYGEN_EXTERNAL_SEARCH NO) - set (DOXYGEN_SEARCHENGINE_URL) - -# This configure and custom target work together - # Replace variables inside @@ with the current values - configure_file (${HDF5_DOXYGEN_DIR}/Doxyfile.in ${HDF5_BINARY_DIR}/Doxyfile @ONLY) - add_custom_target (hdf5lib_doc ALL - COMMAND ${DOXYGEN_EXECUTABLE} ${HDF5_BINARY_DIR}/Doxyfile - DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c - WORKING_DIRECTORY ${HDF5_SRC_DIR} - COMMENT "Generating HDF5 library Source API documentation with Doxygen" - VERBATIM ) # This cmake function requires that the non-default doxyfile settings are provided with set (DOXYGEN_xxx) commands # In addition the doxyfile aliases @INCLUDE option is not supported and would need to be provided in a set (DOXYGEN_ALIASES) command. # doxygen_add_docs (hdf5lib_doc @@ -1207,11 +1177,15 @@ if (DOXYGEN_FOUND) # WORKING_DIRECTORY ${HDF5_SRC_DIR} # COMMENT "Generating HDF5 library Source Documentation" # ) - install ( - DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs/html - DESTINATION ${HDF5_INSTALL_DATA_DIR} - COMPONENT Documents - ) + +# This custom target and doxygen/configure work together + # Replace variables inside @@ with the current values + add_custom_target (hdf5lib_doc ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${HDF5_BINARY_DIR}/Doxyfile + DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c + WORKING_DIRECTORY ${HDF5_SRC_DIR} + COMMENT "Generating HDF5 library Source API documentation with Doxygen" + VERBATIM ) if (NOT TARGET doxygen) add_custom_target (doxygen) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2c9b5fb..3433d64 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -208,8 +208,8 @@ set (H5_TESTS ohdr stab gheap - cache # multiple source - cache_api # multiple source + cache + cache_api pool hyperslab istore @@ -276,8 +276,6 @@ endmacro () set (H5_TESTS_MULTIPLE testhdf5 - cache - cache_api ttsafe ) # Only build single source tests here @@ -313,46 +311,6 @@ if (HDF5_ENABLE_FORMATTERS) clang_format (HDF5_TEST_testhdf5_FORMAT testhdf5) endif () -#-- Adding test for cache -add_executable (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) -target_compile_options(cache PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories(cache PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (cache STATIC) - target_link_libraries (cache PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -else () - TARGET_C_PROPERTIES (cache SHARED) - target_link_libraries (cache PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) -endif () -set_target_properties (cache PROPERTIES FOLDER test) - -#----------------------------------------------------------------------------- -# Add Target to clang-format -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_TEST_cache_FORMAT cache) -endif () - -#-- Adding test for cache_api -add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) -target_compile_options(cache_api PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories(cache_api PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (cache_api STATIC) - target_link_libraries (cache_api PRIVATE ${HDF5_TEST_LIB_TARGET}) -else () - TARGET_C_PROPERTIES (cache_api SHARED) - target_link_libraries (cache_api PRIVATE ${HDF5_TEST_LIBSH_TARGET}) -endif () -set_target_properties (cache_api PROPERTIES FOLDER test) - -#----------------------------------------------------------------------------- -# Add Target to clang-format -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_TEST_cache_api_FORMAT cache_api) -endif () - #-- Adding test for ttsafe add_executable (ttsafe ${ttsafe_SOURCES}) target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}") diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index e4abc9a..f35d7b8 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -17,21 +17,9 @@ ############################################################################## # included from CMakeTests.cmake -set (VFD_LIST - sec2 - stdio - core - core_paged - split - multi - family -) -if (H5_HAVE_DIRECT) - set (VFD_LIST ${VFD_LIST} direct) -endif () +H5_SET_VFD_LIST() foreach (vfdtest ${VFD_LIST}) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files") endforeach () diff --git a/test/cache_common.h b/test/cache_common.h index 7021394..0f8cf42 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -420,113 +420,136 @@ struct expected_entry_status { /* global variable externs: */ -extern hbool_t write_permitted; -extern hbool_t pass; /* set to false on error */ -extern const char *failure_mssg; +H5TEST_DLLVAR hbool_t write_permitted; +H5TEST_DLLVAR hbool_t pass; /* set to false on error */ +H5TEST_DLLVAR const char *failure_mssg; -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]; -extern const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES]; -extern const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES]; -extern const char * entry_type_names[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR test_entry_t *entries[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const int32_t max_indices[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const char * entry_type_names[NUMBER_OF_ENTRY_TYPES]; /* call back function declarations: */ /* callback table extern */ -extern const H5C_class_t types[NUMBER_OF_ENTRY_TYPES]; +H5TEST_DLLVAR const H5C_class_t types[NUMBER_OF_ENTRY_TYPES]; + +#ifdef __cplusplus +extern "C" { +#endif /* function declarations: */ -void add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hbool_t flag, size_t size); +H5TEST_DLL void add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hbool_t flag, + size_t size); -void addr_to_type_and_index(haddr_t addr, int32_t *type_ptr, int32_t *index_ptr); +H5TEST_DLL void addr_to_type_and_index(haddr_t addr, int32_t *type_ptr, int32_t *index_ptr); #if 0 /* keep this for a while -- it may be useful */ -haddr_t type_and_index_to_addr(int32_t type, +H5TEST_DLL haddr_t type_and_index_to_addr(int32_t type, int32_t idx); #endif -void dirty_entry(H5F_t *file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin); +H5TEST_DLL void dirty_entry(H5F_t *file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin); -void expunge_entry(H5F_t *file_ptr, int32_t type, int32_t idx); +H5TEST_DLL void expunge_entry(H5F_t *file_ptr, int32_t type, int32_t idx); -void insert_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags); +H5TEST_DLL void insert_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags); -void mark_entry_dirty(int32_t type, int32_t idx); +H5TEST_DLL void mark_entry_dirty(int32_t type, int32_t idx); -void move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr); +H5TEST_DLL 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, int32_t idx); +H5TEST_DLL void protect_entry(H5F_t *file_ptr, int32_t type, int32_t idx); -void protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx); +H5TEST_DLL void protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx); -hbool_t entry_in_cache(H5C_t *cache_ptr, int32_t type, int32_t idx); +H5TEST_DLL hbool_t entry_in_cache(H5C_t *cache_ptr, int32_t type, int32_t idx); -void create_pinned_entry_dependency(H5F_t *file_ptr, int pinning_type, int pinning_idx, int pinned_type, - int pinned_idx); +H5TEST_DLL void create_pinned_entry_dependency(H5F_t *file_ptr, int pinning_type, int pinning_idx, + int pinned_type, int pinned_idx); -void reset_entries(void); +H5TEST_DLL void reset_entries(void); -void resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_t in_cache); +H5TEST_DLL void resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_t in_cache); -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 do_moves, hbool_t move_to_main_addr, hbool_t do_destroys, - hbool_t do_mult_ro_protects, int dirty_destroys, int dirty_unprotects); +H5TEST_DLL 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 do_moves, hbool_t move_to_main_addr, + hbool_t do_destroys, hbool_t do_mult_ro_protects, int dirty_destroys, + int dirty_unprotects); -void hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, - hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts); +H5TEST_DLL void hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, + hbool_t reset_stats, hbool_t display_stats, + hbool_t display_detailed_stats, hbool_t do_inserts); -void row_major_scan_backward(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); +H5TEST_DLL void row_major_scan_backward(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); -void hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, - hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts); +H5TEST_DLL void hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, + hbool_t reset_stats, hbool_t display_stats, + hbool_t display_detailed_stats, hbool_t do_inserts); -void col_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, - int dirty_unprotects); +H5TEST_DLL void col_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, int dirty_unprotects); -void hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, - hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - int dirty_unprotects); +H5TEST_DLL void hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, + hbool_t reset_stats, hbool_t display_stats, + hbool_t display_detailed_stats, hbool_t do_inserts, + int dirty_unprotects); -void col_major_scan_backward(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, - int dirty_unprotects); +H5TEST_DLL void col_major_scan_backward(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, int dirty_unprotects); -void hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, hbool_t reset_stats, - hbool_t display_stats, hbool_t display_detailed_stats, hbool_t do_inserts, - int dirty_unprotects); +H5TEST_DLL void hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, + hbool_t reset_stats, hbool_t display_stats, + hbool_t display_detailed_stats, hbool_t do_inserts, + int dirty_unprotects); -void flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_t dump_detailed_stats); +H5TEST_DLL void flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, + hbool_t dump_detailed_stats); -void unpin_entry(int32_t type, int32_t idx); +H5TEST_DLL void unpin_entry(int32_t type, int32_t idx); -void unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags); +H5TEST_DLL void unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags); -void verify_clean(void); +H5TEST_DLL void verify_clean(void); -void verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_entry_status expected[]); +H5TEST_DLL void verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, + struct expected_entry_status expected[]); -void verify_unprotected(void); +H5TEST_DLL void verify_unprotected(void); /*** 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); +H5TEST_DLL hbool_t resize_configs_are_equal(const H5C_auto_size_ctl_t *a, const H5C_auto_size_ctl_t *b, + hbool_t compare_init); + +H5TEST_DLL 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_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t dump_data, - int64_t min_accesses, double min_hit_rate); +H5TEST_DLL 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 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); +H5TEST_DLL void validate_mdc_config(hid_t file_id, H5AC_cache_config_t *ext_config_ptr, hbool_t compare_init, + int test_num); -void validate_mdc_config(hid_t file_id, H5AC_cache_config_t *ext_config_ptr, hbool_t compare_init, - int test_num); +/** Debugging functions -- normally commented out ***/ +#if 0 +H5TEST_DLL void dump_LRU(H5F_t * file_ptr); +#endif + +#ifdef __cplusplus +} +#endif #endif /* CACHE_COMMON_H */ diff --git a/testpar/CMakeVFDTests.cmake b/testpar/CMakeVFDTests.cmake index 8947a29..4cda27b 100644 --- a/testpar/CMakeVFDTests.cmake +++ b/testpar/CMakeVFDTests.cmake @@ -15,27 +15,13 @@ ### T E S T I N G ### ############################################################################## ############################################################################## -set (VFD_LIST - sec2 - stdio - core - split - multi - family -) set (H5P_VFD_TESTS t_pflush1 t_pflush2 ) -if (H5_HAVE_DIRECT) - set (VFD_LIST ${VFD_LIST} direct) -endif () - -foreach (vfdtest ${VFD_LIST}) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") -endforeach () +H5_SET_VFD_LIST() macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -57,9 +43,9 @@ macro (ADD_VFD_TEST vfdname resultcode) WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}/${vfdname} ) endforeach () - set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush1 PROPERTIES WILL_FAIL "true") + set_tests_properties (MPI_TEST_VFD-${vfdname}-t_pflush1 PROPERTIES WILL_FAIL "true") #set_property (TEST MPI_TEST_t_pflush1 PROPERTY PASS_REGULAR_EXPRESSION "PASSED") - set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush2 PROPERTIES DEPENDS MPI_TEST_VFD-${vfdname}-pflush1) + set_tests_properties (MPI_TEST_VFD-${vfdname}-t_pflush2 PROPERTIES DEPENDS MPI_TEST_VFD-${vfdname}-t_pflush1) endif () endmacro () diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index c0c7036..ad4ed99 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -15,7 +15,7 @@ add_subdirectory (misc) #-- Add the h5import and test executables add_subdirectory (h5import) -#-- h5Repack executables +#-- h5repack executables add_subdirectory (h5repack) #-- Add the h5dump and test executables diff --git a/tools/h5dump/CMakeVFDTests.cmake b/tools/h5dump/CMakeVFDTests.cmake index 01834b3..6a70b85 100644 --- a/tools/h5dump/CMakeVFDTests.cmake +++ b/tools/h5dump/CMakeVFDTests.cmake @@ -16,19 +16,7 @@ ############################################################################## ############################################################################## -set (VFD_H5DUMP_LIST - sec2 - stdio - core - core_paged - split - multi - family -) - -if (H5_HAVE_DIRECT) - set (VFD_H5DUMP_LIST ${VFD_H5DUMP_LIST} direct) -endif () +H5_SET_VFD_LIST() # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -37,8 +25,7 @@ set (HDF5_VFD_H5DUMP_FILES packedbits ) -foreach (vfdtest ${VFD_H5DUMP_LIST}) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") +foreach (vfdtest ${VFD_LIST}) foreach (h5_tfile ${HDF5_VFD_H5DUMP_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.h5" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.h5" "HDF5_VFD_H5DUMP_files") HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.ddl" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.ddl" "HDF5_VFD_H5DUMP_files") @@ -79,7 +66,7 @@ endmacro () ############################################################################## # Run test with different Virtual File Driver -foreach (vfd ${VFD_H5DUMP_LIST}) +foreach (vfd ${VFD_LIST}) # test for signed/unsigned datasets ADD_VFD_H5DUMP_TEST (${vfd} packedbits 0 --enable-error-stack packedbits.h5) endforeach () diff --git a/tools/h5repack/CMakeVFDTests.cmake b/tools/h5repack/CMakeVFDTests.cmake index 7eea4cc..78d752c 100644 --- a/tools/h5repack/CMakeVFDTests.cmake +++ b/tools/h5repack/CMakeVFDTests.cmake @@ -16,18 +16,7 @@ ############################################################################## ############################################################################## -set (VFD_LIST - sec2 - stdio - core - split - multi - family -) - -if (H5_HAVE_DIRECT) - set (VFD_LIST ${VFD_LIST} direct) -endif () +H5_SET_VFD_LIST() ############################################################################## ############################################################################## @@ -37,7 +26,6 @@ endif () macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") add_test ( NAME H5REPACK-${vfdname}-h5repacktest-clear-objects COMMAND ${CMAKE_COMMAND} -E remove -- cgit v0.12