From 00b5cc639c920b5b69d18f387a99fbf7edbecfe0 Mon Sep 17 00:00:00 2001 From: Stephen Date: Tue, 28 Jul 2020 14:33:05 -0500 Subject: [PATCH] set dspace, remove mcdb from BuildFile, compatible constructore --- .../LHEInterface/src/HighFive/CHANGELOG.md | 46 - .../HighFive/CMake/HighFiveConfig.cmake.in | 3 - .../src/HighFive/CMake/PackageConfig.cmake | 34 - .../CMake/config/CompilerFlagsHelpers.cmake | 117 -- .../config/DefineInstallationPaths.cmake | 208 --- .../CMake/config/ReleaseDebugAutoFlags.cmake | 50 - .../HighFive/CMake/config/TestHelpers.cmake | 113 -- .../HighFive/CMake/packages/FindPandoc.cmake | 13 - .../portability/BlueGenePortability.cmake | 37 - .../portability/CheckCXX11Portability.cmake | 21 - .../LHEInterface/src/HighFive/CMakeLists.txt | 58 - .../LHEInterface/src/HighFive/LICENSE | 25 - .../LHEInterface/src/HighFive/README.md | 110 -- .../LHEInterface/src/HighFive/VERSION | 1 - .../src/HighFive/ci/travis/install.sh | 18 - .../LHEInterface/src/HighFive/default.nix | 20 - .../src/HighFive/doc/CMakeLists.txt | 19 - .../src/HighFive/doc/build.sh.cmake | 59 - .../src/HighFive/doc/github-pandoc.css | 424 ------- .../HighFive/include/highfive/H5Attribute.hpp | 75 -- .../HighFive/include/highfive/H5DataSet.hpp | 73 -- .../HighFive/include/highfive/H5DataSpace.hpp | 119 -- .../HighFive/include/highfive/H5DataType.hpp | 51 - .../HighFive/include/highfive/H5Exception.hpp | 135 -- .../src/HighFive/include/highfive/H5File.hpp | 73 -- .../include/highfive/H5FileDriver.hpp | 41 - .../src/HighFive/include/highfive/H5Group.hpp | 30 - .../HighFive/include/highfive/H5Object.hpp | 60 - .../include/highfive/H5PropertyList.hpp | 99 -- .../HighFive/include/highfive/H5Selection.hpp | 63 - .../HighFive/include/highfive/H5Utility.hpp | 33 - .../highfive/bits/H5Annotate_traits.hpp | 74 -- .../highfive/bits/H5Annotate_traits_misc.hpp | 102 -- .../highfive/bits/H5Attribute_misc.hpp | 114 -- .../highfive/bits/H5Converter_misc.hpp | 318 ----- .../include/highfive/bits/H5DataSet_misc.hpp | 78 -- .../include/highfive/bits/H5DataType_misc.hpp | 135 -- .../highfive/bits/H5Dataspace_misc.hpp | 192 --- .../highfive/bits/H5Exception_misc.hpp | 65 - .../highfive/bits/H5FileDriver_misc.hpp | 54 - .../include/highfive/bits/H5File_misc.hpp | 85 -- .../include/highfive/bits/H5Group_misc.hpp | 18 - .../highfive/bits/H5Iterables_misc.hpp | 57 - .../include/highfive/bits/H5Node_traits.hpp | 106 -- .../highfive/bits/H5Node_traits_misc.hpp | 158 --- .../include/highfive/bits/H5Object_misc.hpp | 51 - .../highfive/bits/H5PropertyList_misc.hpp | 90 -- .../highfive/bits/H5Selection_misc.hpp | 29 - .../include/highfive/bits/H5Slice_traits.hpp | 109 -- .../highfive/bits/H5Slice_traits_misc.hpp | 239 ---- .../include/highfive/bits/H5Utils.hpp | 174 --- .../src/HighFive/src/examples/CMakeLists.txt | 46 - .../src/examples/boost_multi_array_2D.cpp | 51 - .../src/examples/boost_ublas_double.cpp | 60 - .../create_attribute_string_integer.cpp | 68 - .../src/examples/create_dataset_double.cpp | 47 - .../examples/create_extensible_dataset.cpp | 70 -- .../examples/parallel_hdf5_write_dataset.cpp | 67 - .../examples/read_write_dataset_string.cpp | 59 - .../src/examples/read_write_single_scalar.cpp | 53 - .../examples/read_write_vector_dataset.cpp | 71 -- .../examples/select_by_id_dataset_cpp11.cpp | 74 -- .../examples/select_partial_dataset_cpp11.cpp | 55 - .../src/HighFive/tests/unit/CMakeLists.txt | 49 - .../tests/unit/tests_high_five_base.cpp | 1112 ----------------- .../tests/unit/tests_high_five_parallel.cpp | 136 -- .../LHEInterface/src/LH5Reader.cc | 18 +- 67 files changed, 9 insertions(+), 6503 deletions(-) delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CHANGELOG.md delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/HighFiveConfig.cmake.in delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/PackageConfig.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/config/CompilerFlagsHelpers.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/config/DefineInstallationPaths.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/config/ReleaseDebugAutoFlags.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/config/TestHelpers.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/packages/FindPandoc.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/BlueGenePortability.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/CheckCXX11Portability.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/CMakeLists.txt delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/LICENSE delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/README.md delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/VERSION delete mode 100755 GeneratorInterface/LHEInterface/src/HighFive/ci/travis/install.sh delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/default.nix delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/doc/CMakeLists.txt delete mode 100755 GeneratorInterface/LHEInterface/src/HighFive/doc/build.sh.cmake delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/doc/github-pandoc.css delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Attribute.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSet.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSpace.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataType.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Exception.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5File.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5FileDriver.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Group.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Object.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5PropertyList.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Selection.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Utility.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Attribute_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Converter_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataSet_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataType_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Dataspace_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Exception_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5FileDriver_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5File_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Group_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Iterables_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Object_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5PropertyList_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Selection_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits_misc.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Utils.hpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/CMakeLists.txt delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_multi_array_2D.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_ublas_double.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_attribute_string_integer.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_dataset_double.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_extensible_dataset.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/parallel_hdf5_write_dataset.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_dataset_string.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_single_scalar.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_vector_dataset.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_by_id_dataset_cpp11.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_partial_dataset_cpp11.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/tests/unit/CMakeLists.txt delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_base.cpp delete mode 100644 GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_parallel.cpp diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CHANGELOG.md b/GeneratorInterface/LHEInterface/src/HighFive/CHANGELOG.md deleted file mode 100644 index 01fea994f5a47..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CHANGELOG.md +++ /dev/null @@ -1,46 +0,0 @@ -##Version 2.0 - 2018/07/19 - - First version with C++11 enforcement - - Support for property list - - Support for Chunking - - Support for Compression / Deflate - - Fix: missing move constructor for properties - - Fix: typo in MPI IO driver - - Fix: several typo fixes - - Fix: Add missing include - -## Version 1.5 - 2018/01/06 - - SliceTraits::read split in two overloads, the first one for plain C arrays - and the second one for other types. - - Add support for complex number - - Add exist() method to the API - - Will be last release before 2.0 and enforcement of C++11 - -## Version 1.4 - 2017/08/25 - - Support id selection for the `select` function - - Suport STL containers of const elements - - Support scalar values and strings management - - Fix attribute assignment issue #40 - - Fix Object assignment operator missing unref (possible memory leak ) - - Introduce SilenceHDF5 for HDF5 error report - - Fix a unit test issue with SilenceHDF5 - - -## Version 1.3 - 2017/06/21 - - Minor fixes - -## Version 1.2 - 2017/04/03 - - Add Attribute support for Dataset - - Extend testing of Attribute support - - Fix issue related to multiple definitions in default driver - - Add more examples about attribute support - -## Version 1.1 - 2017/03/23 - - Add support and examples for Parallel HDF5 - - Initial implementation for H5 Properties - - Support for Attributes - - Improve documentation - - Add example for boost.Ublas matrix support - - -## Version 1.0 - Init - - Initial release diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/HighFiveConfig.cmake.in b/GeneratorInterface/LHEInterface/src/HighFive/CMake/HighFiveConfig.cmake.in deleted file mode 100644 index b63118c0c6389..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/HighFiveConfig.cmake.in +++ /dev/null @@ -1,3 +0,0 @@ -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/HighFiveTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/HighFiveTargets.cmake") -endif() diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/PackageConfig.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/PackageConfig.cmake deleted file mode 100644 index a33bb405aba64..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/PackageConfig.cmake +++ /dev/null @@ -1,34 +0,0 @@ -add_library(HighFive INTERFACE) -target_link_libraries(HighFive INTERFACE ${HDF5_LIBRARIES}) -target_include_directories(HighFive INTERFACE - "$" - "$" - "$") -target_include_directories(HighFive SYSTEM INTERFACE ${HDF5_INCLUDE_DIRS}) -if(USE_BOOST) - target_include_directories(HighFive SYSTEM INTERFACE ${Boost_INCLUDE_DIR}) - target_compile_definitions(HighFive INTERFACE -DH5_USE_BOOST) -endif() - -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/highfive - DESTINATION ${INCLUDE_INSTALL_DIR}) - -include(CMakePackageConfigHelpers) -configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/HighFiveConfig.cmake.in - ${PROJECT_BINARY_DIR}/HighFiveConfig.cmake - INSTALL_DESTINATION share/${PROJECT_NAME}/CMake - ) -install(FILES ${PROJECT_BINARY_DIR}/HighFiveConfig.cmake - DESTINATION share/${PROJECT_NAME}/CMake) - -# Generate ${PROJECT_NAME}Targets.cmake; is written after the CMake run -# succeeds. Provides IMPORTED targets when using this project from the install -# tree. -install(EXPORT HighFiveTargets FILE ${PROJECT_NAME}Targets.cmake - DESTINATION share/${PROJECT_NAME}/CMake) - -install(TARGETS HighFive EXPORT ${PROJECT_NAME}Targets - INCLUDES DESTINATION include) - -export(EXPORT HighFiveTargets - FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake") diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/CompilerFlagsHelpers.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/CompilerFlagsHelpers.cmake deleted file mode 100644 index c19ecc1ad8a6d..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/CompilerFlagsHelpers.cmake +++ /dev/null @@ -1,117 +0,0 @@ -# CompilerFlagsHelpers.cmake -# -# set of Convenience functions for portable compiler flags -# -# License: BSD 3 -# -# Copyright (c) 2016, Adrien Devresse -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -set(SUPPORTED_COMPILER_LANGUAGE_LIST "C;CXX") - -## detect compiler -foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST}) - - if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "XL") - set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_XLC ON) - elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "Intel") - set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_ICC ON) - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_MSVC ON) - elseif(${CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID} STREQUAL "Clang") - set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_CLANG ON) - else(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "GNU") - set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_GCC ON) - endif() - -endforeach() - - - - -foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST}) - - # XLC compiler - if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_XLC) - - # XLC -qinfo=all is awfully verbose on any platforms that use the GNU STL - # Enable by default only the relevant one - set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-qformat=all -qinfo=lan:trx:ret:zea:cmp:ret") - - set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g") - - set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_AGGRESSIVE "-O3") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTEST "-O5") - - set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-qstackprotect") - - set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDANT "-qpic=small") - - set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "-qhot") - - # Microsoft compiler - elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_MSVC) - - set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-Zi") - - set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_AGGRESSIVE "-O2") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTEST "-O2") - - set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-GS") - - # enable by default on MSVC - set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDANT "") - - - ## GCC, CLANG, rest of the world - else() - - set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-Wall -Wextra") - - set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g") - - set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_AGGRESSIVE "-O3") - set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTEST "-Ofast -march=native") - - set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-fstack-protector") - - set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDANT "-fPIC") - - set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "-ftree-vectorize") - - if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_GCC AND ( CMAKE_${COMPILER_LANGUAGE}_COMPILER_VERSION VERSION_GREATER "4.7.0") ) - set(CMAKE_${COMPILER_LANGUAGE}_LINK_TIME_OPT "-flto") - endif() - - if( (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^ppc" ) OR ( CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^power" ) ) - ## ppc arch do not support -march= syntax - set(CMAKE_${COMPILER_LANGUAGE}_GEN_NATIVE "-mcpu=native") - else() - set(CMAKE_${COMPILER_LANGUAGE}_GEN_NATIVE "-march=native") - endif() - endif() - - - -endforeach() - - - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/DefineInstallationPaths.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/DefineInstallationPaths.cmake deleted file mode 100644 index af11f47249164..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/DefineInstallationPaths.cmake +++ /dev/null @@ -1,208 +0,0 @@ -### -## Give GNU/Linux directory naming to cmake http://www.gnu.org/prep/standards/html_node/Directory-Variables.html -## -## Define installation PATHs -## Re-use naming convention of package managers (RPM, dpkg) - -## setup default app name -IF(NOT DEFINED "${PROJECT_NAME}_APPLICATION_NAME") - SET(APPLICATION_NAME "${PROJECT_NAME}") -ELSE() - SET(APPLICATION_NAME "${PROJECT_NAME}_APPLICATION_NAME") -ENDIF() - - -### If no project specific prefix is define -## use standard prefix -IF(NOT DEFINED ${APPLICATION_NAME}_INSTALL_PREFIX) - - IF("${CMAKE_INSTALL_PREFIX}" STREQUAL "/") - ## override simple "/", buggy with cmake <= 2.8 - SET(INTERNAL_BASE_PREFIX "") - ELSE() - SET(INTERNAL_BASE_PREFIX "${CMAKE_INSTALL_PREFIX}") - ENDIF() - -ELSE() - # support apps specific prefix installation - # for sub-project style usage - SET(INTERNAL_BASE_PREFIX "${${APPLICATION_NAME}_INSTALL_PREFIX}") -ENDIF() - - -# detect lib suffix -GET_PROPERTY(LIB64_SUFFIX GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) - -## library suffix : default "" -## Use specify lib{32,64} -IF(NOT DEFINED LIB_SUFFIX) - IF(LIB64_SUFFIX) - SET(LIB_SUFFIX "64") - ELSE() - SET(LIB_SUFFIX "") - ENDIF() -ENDIF() - - -## -# execprefix (default: "$CMAKE_INSTALL_PREFIX" ) -IF(NOT DEFINED EXEC_INSTALL_PREFIX) - SET(EXEC_INSTALL_PREFIX - "${CMAKE_INSTALL_PREFIX}") -ENDIF() - -## -# share install dir prefix -# (RPM macro compat) -IF(NOT DEFINED SHARE_INSTALL_PREFIX) - SET(SHARE_INSTALL_PREFIX - "${INTERNAL_BASE_PREFIX}/share") -ENDIF() - - -## -# sysconfdir (default: /etc ) -# -IF(NOT DEFINED SYSCONF_INSTALL_DIR) - SET(SYSCONF_INSTALL_DIR - "${CMAKE_INSTALL_PREFIX}/etc") -ENDIF() - -## -# apps specific datadir -# -IF(NOT DEFINED DATA_INSTALL_PREFIX) - SET(DATA_INSTALL_PREFIX - "${INTERNAL_BASE_PREFIX}/${APPLICATION_NAME}") -ENDIF() - - -## -# bindir -IF(NOT DEFINED BIN_INSTALL_DIR) - SET(BIN_INSTALL_DIR - "${INTERNAL_BASE_PREFIX}/bin") -ENDIF() - -## -# sbindir -IF(NOT DEFINED SBIN_INSTALL_DIR) - SET(SBIN_INSTALL_DIR - "${INTERNAL_BASE_PREFIX}/sbin") -ENDIF() - -## -# libdir -IF(NOT DEFINED LIB_INSTALL_DIR) - SET(LIB_INSTALL_DIR - "${INTERNAL_BASE_PREFIX}/lib${LIB_SUFFIX}") -ENDIF() - -## -# libexecdir -IF(NOT DEFINED LIBEXEC_INSTALL_DIR) - SET(LIBEXEC_INSTALL_DIR - "${INTERNAL_BASE_PREFIX}/libexec") -ENDIF() - -## -# pkgconfig dir -IF(NOT DEFINED PKGCONFIG_FILES_DIR) - SET(PKGCONFIG_FILES_DIR - "${LIB_INSTALL_DIR}/pkgconfig/") -ENDIF() - -## -# plugin app dir -IF(NOT DEFINED PLUGIN_INSTALL_DIR) - SET(PLUGIN_INSTALL_DIR - "${LIB_INSTALL_DIR}/${APPLICATION_NAME}") -ENDIF() - -## -# includedir -IF(NOT DEFINED INCLUDE_INSTALL_DIR) - SET(INCLUDE_INSTALL_DIR - "${INTERNAL_BASE_PREFIX}/include") -ENDIF() - -## -# data install dir -IF(NOT DEFINED DATA_INSTALL_DIR) - SET(DATA_INSTALL_DIR - "${DATA_INSTALL_PREFIX}") -ENDIF() - -## -# CMake.config install dir -IF(NOT DEFINED CMAKE_TARGET_CONFIG_INSTALL_DIR) - SET(CMAKE_TARGET_CONFIG_INSTALL_DIR - "${DATA_INSTALL_PREFIX}/${APPLICATION_NAME}/CMake") -ENDIF() - - -## -# doc install dir -IF(NOT DEFINED DOC_INSTALL_DIR) - SET(DOC_INSTALL_DIR - "${SHARE_INSTALL_PREFIX}/doc/${APPLICATION_NAME}") -ENDIF() - -## -# mandir -IF(NOT DEFINED MAN_INSTALL_DIR) - SET(MAN_INSTALL_DIR - "${SHARE_INSTALL_PREFIX}/man") -ENDIF() - -## -# infodir -IF(NOT DEFINED INFO_INSTALL_DIR) - SET(INFO_INSTALL_DIR - "${SHARE_INSTALL_PREFIX}/info") -ENDIF() - - - -IF(NOT DEFINED HTML_INSTALL_DIR) - SET(HTML_INSTALL_DIR - "${DOC_INSTALL_DIR}/html") -ENDIF() - - - -IF(NOT DEFINED ICON_INSTALL_DIR) - SET(ICON_INSTALL_DIR - "${DATA_INSTALL_PREFIX}/icons") -ENDIF() - - - -IF(NOT DEFINED SOUND_INSTALL_DIR) - SET(SOUND_INSTALL_DIR - "${DATA_INSTALL_PREFIX}/sounds") -ENDIF() - - - -IF(NOT DEFINED LOCALE_INSTALL_DIR) - SET(LOCALE_INSTALL_DIR - "${SHARE_INSTALL_PREFIX}/locale") -ENDIF() - - - -IF(NOT DEFINED XDG_APPS_DIR) - SET(XDG_APPS_DIR - "${SHARE_INSTALL_PREFIX}/applications") -ENDIF() - - -IF(NOT DEFINED XDG_DIRECTORY_DIR) - SET(XDG_DIRECTORY_DIR - "${SHARE_INSTALL_PREFIX}/desktop-directories") -ENDIF() - - - - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/ReleaseDebugAutoFlags.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/ReleaseDebugAutoFlags.cmake deleted file mode 100644 index 320d468830ac5..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/ReleaseDebugAutoFlags.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# ReleaseDebugAutoFlags.cmake -# -# Release / Debug configuration helper -# -# License: BSD 3 -# -# Copyright (c) 2016, Adrien Devresse -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -## default configuration -if(NOT CMAKE_BUILD_TYPE AND (NOT CMAKE_CONFIGURATION_TYPES)) - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) - message(STATUS "Setting build type to '${CMAKE_BUILD_TYPE}' as none was specified.") -endif() - - -# Different configuration types: -# -# Debug : Optimized for debugging, include symbols -# Release : Release mode, no debuginfo -# RelWithDebInfo : Distribution mode, basic optimizations for potable code with debuginfos -# Fast : Maximum level of optimization. Target native architecture, not portable code - -include(CompilerFlagsHelpers) - - -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_WARNING_ALL} ${CMAKE_C_OPT_NORMAL}") -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_DEBUGINFO_FLAGS} ${CMAKE_C_WARNING_ALL} ${CMAKE_C_OPT_NONE} ${CMAKE_C_STACK_PROTECTION}") -set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_DEBUGINFO_FLAGS} ${CMAKE_C_WARNING_ALL} ${CMAKE_C_OPT_NORMAL}") -set(CMAKE_C_FLAGS_FAST "${CMAKE_C_WARNING_ALL} ${CMAKE_C_OPT_FASTEST} ${CMAKE_C_LINK_TIME_OPT} ${CMAKE_C_GEN_NATIVE}") - - - -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_WARNING_ALL} ${CMAKE_CXX_OPT_NORMAL}") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_DEBUGINFO_FLAGS} ${CMAKE_CXX_WARNING_ALL} ${CMAKE_CXX_OPT_NONE} ${CMAKE_CXX_STACK_PROTECTION}") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_DEBUGINFO_FLAGS} ${CMAKE_CXX_WARNING_ALL} ${CMAKE_CXX_OPT_NORMAL}") -set(CMAKE_CXX_FLAGS_FAST "${CMAKE_CXX_WARNING_ALL} ${CMAKE_CXX_OPT_FASTEST} ${CMAKE_CXX_LINK_TIME_OPT} ${CMAKE_CXX_GEN_NATIVE}") - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/TestHelpers.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/TestHelpers.cmake deleted file mode 100644 index f3ca1cb74108a..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/config/TestHelpers.cmake +++ /dev/null @@ -1,113 +0,0 @@ -# TestHelpers.cmake -# -# set of Convenience functions for unit testing with cmake -# -# License: BSD 3 -# -# Copyright (c) 2016, Adrien Devresse -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -## -# enable or disable detection of SLURM and MPIEXEC -option(AUTO_TEST_WITH_SLURM "automatically add srun as test prefix in a SLURM environment" TRUE) -option(AUTO_TEST_WITH_MPIEXEC "automatically add mpiexec as test prefix in a MPICH2/OpenMPI environment" TRUE) - -### -## -## Basic SLURM support -## the prefix "srun" is added to any test in the environment -## For a slurm test execution, simply run "salloc [your_exec_parameters] ctest" -## -## -if(AUTO_TEST_WITH_SLURM) - if(NOT DEFINED SLURM_SRUN_COMMAND) - find_program(SLURM_SRUN_COMMAND - NAMES "srun" - HINTS "${SLURM_ROOT}/bin") - endif() - - if(SLURM_SRUN_COMMAND) - set(TEST_EXEC_PREFIX_DEFAULT "${SLURM_SRUN_COMMAND}") - set(TEST_MPI_EXEC_PREFIX_DEFAULT "${SLURM_SRUN_COMMAND}") - set(TEST_MPI_EXEC_BIN_DEFAULT "${SLURM_SRUN_COMMAND}") - set(TEST_WITH_SLURM ON) - message(STATUS " - AUTO_TEST_WITH_SLURM with slurm cmd ${TEST_EXEC_PREFIX_DEFAULT} ") - message(STATUS " -- set test execution prefix to ${TEST_EXEC_PREFIX_DEFAULT} ") - message(STATUS " -- set MPI test execution prefix to ${TEST_MPI_EXEC_PREFIX_DEFAULT} ") - endif() - -endif() - -### -## Basic MPIExec support, will just forward mpiexec as prefix -## -if(AUTO_TEST_WITH_MPIEXEC AND NOT TEST_WITH_SLURM) - - if(NOT DEFINED MPIEXEC) - find_program(MPIEXEC - NAMES "mpiexec" - HINTS "${MPI_ROOT}/bin") - endif() - - - if(MPIEXEC) - set(TEST_MPI_EXEC_PREFIX_DEFAULT "${MPIEXEC}") - set(TEST_MPI_EXEC_BIN_DEFAULT "${MPIEXEC}") - set(TEST_WITH_MPIEXEC ON) - message(STATUS " - AUTO_TEST_WITH_MPIEXEC cmd ${MPIEXEC} ") - message(STATUS " -- set MPI test execution prefix to ${TEST_MPI_EXEC_PREFIX_DEFAULT} ") - - endif() - -endif() - - - -### -## MPI executor program path without arguments used for testing. -## default: srun or mpiexec if found -## -set(TEST_MPI_EXEC_BIN "${TEST_MPI_EXEC_BIN_DEFAULT}" CACHE STRING "path of the MPI executor (mpiexec, mpirun) for test execution") - - - -### -## Test execution prefix. Override this variable for any execution prefix required in clustered environment -## -## To specify manually a command with argument, e.g -DTEST_EXEC_PREFIX="/var/empty/bin/srun;-n;-4" for a srun execution -## with 4 nodes -## -## default: srun if found -## -set(TEST_EXEC_PREFIX "${TEST_EXEC_PREFIX_DEFAULT}" CACHE STRING "prefix command for the test executions") - - - -### -## Test execution prefix specific for MPI programs. -## -## To specify manually a command with argument, use the cmake list syntax. e.g -DTEST_EXEC_PREFIX="/var/empty/bin/mpiexec;-n;-4" for an MPI execution -## with 4 nodes -## -## default: srun or mpiexec if found -## -set(TEST_MPI_EXEC_PREFIX "${TEST_MPI_EXEC_PREFIX_DEFAULT}" CACHE STRING "prefix command for the MPI test executions") - - - - - - - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/packages/FindPandoc.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/packages/FindPandoc.cmake deleted file mode 100644 index c0de1a83c671d..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/packages/FindPandoc.cmake +++ /dev/null @@ -1,13 +0,0 @@ -include(FindPackageHandleStandardArgs) - -if(DEFINED PANDOC_EXECUTABLE) - set(Pandoc_FIND_QUIETLY TRUE) -endif() - -find_program(PANDOC_EXECUTABLE - NAMES pandoc - DOC "Pandoc - a universal document converter") - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pandoc REQUIRED_VARS PANDOC_EXECUTABLE) - -mark_as_advanced(PANDOC_EXECUTABLE) diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/BlueGenePortability.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/BlueGenePortability.cmake deleted file mode 100644 index 504f0839d9be2..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/BlueGenePortability.cmake +++ /dev/null @@ -1,37 +0,0 @@ -## -## Portability check on Blue Gene Q environment - -include(CompilerFlagsHelpers) - -if(IS_DIRECTORY "/bgsys" AND (NOT DEFINED BLUEGENE) ) - set(BLUEGENE TRUE) -endif() - - -if(BLUEGENE AND CMAKE_C_COMPILER_IS_XLC ) - # define library type to static on BGQ - set(COMPILE_LIBRARY_TYPE "STATIC") - ## Blue Gene/Q do not support linking with MPI library when compiled with mpicc wrapper - ## we disable any MPI_X_LIBRARY linking and rely on mpicc wrapper - set(MPI_LIBRARIES "") - set(MPI_C_LIBRARIES "") - set(MPI_CXX_LIBRARIES "") - - ## static linking need to be forced on BlueGene - # Boost need a bit of tuning parameters for static linking - set(Boost_NO_BOOST_CMAKE TRUE) - set(Boost_USE_STATIC_LIBS TRUE) - - #enforce static linking for hdf5 - set(HDF5_USE_STATIC_LIBRARIES TRUE) - -else() - -if(NOT DEFINED COMPILE_LIBRARY_TYPE) - set(COMPILE_LIBRARY_TYPE "SHARED") -endif() - -endif() - - - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/CheckCXX11Portability.cmake b/GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/CheckCXX11Portability.cmake deleted file mode 100644 index 525f054a4dbbe..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMake/portability/CheckCXX11Portability.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# -# Basic check for C++11 compiler support -# - -include(CheckCXXCompilerFlag) - -if(NOT DEFINED CXX11_INCOMPATIBLE_COMPILER) - -if(CMAKE_CXX_COMPILER_ID STREQUAL "XL") - set(CXX11_INCOMPATIBLE_COMPILER TRUE) -else() - set(CXX11_INCOMPATIBLE_COMPILER FALSE) -endif() - -endif() - -if(NOT CXX11_INCOMPATIBLE_COMPILER) - set(CMAKE_REQUIRED_QUIET ON) - CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) -endif() - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/CMakeLists.txt b/GeneratorInterface/LHEInterface/src/HighFive/CMakeLists.txt deleted file mode 100644 index bad30f6a0a7ae..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -project(HighFive) -cmake_minimum_required(VERSION 3.0) - -enable_testing() - -set(HIGHFIVE_VERSION_MAJOR 2) -set(HIGHFIVE_VERSION_MINOR 0) - -list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake - ${PROJECT_SOURCE_DIR}/CMake/portability - ${PROJECT_SOURCE_DIR}/CMake/packages - ${PROJECT_SOURCE_DIR}/CMake/config) - -include(DefineInstallationPaths) -include(ReleaseDebugAutoFlags) -include(CheckCXX11Portability) - -include(BlueGenePortability) - -option(HIGHFIVE_UNIT_TESTS "enable unit tests" TRUE) -option(USE_BOOST "enable Boost Support" TRUE) -option(HIGHFIVE_EXAMPLES "Compile examples" TRUE) -option(HIGHFIVE_PARALLEL_HDF5 "Enable Parallel HDF5 support" FALSE) - -set(HIGHFIVE_CPP_STD_FLAG "-std=c++11" CACHE STRING "flag to use to enforce c++ standard (default:c++11)") - -if(HIGHFIVE_PARALLEL_HDF5) - set(HDF5_PREFER_PARALLEL TRUE) -endif() - -find_package(HDF5 QUIET REQUIRED) - -set(Boost_NO_BOOST_CMAKE TRUE) - -if(USE_BOOST) - find_package(Boost QUIET REQUIRED COMPONENTS system unit_test_framework) - add_definitions(-DH5_USE_BOOST ) - include_directories(SYSTEM ${Boost_INCLUDE_DIR}) -endif() - -if(HIGHFIVE_PARALLEL_HDF5) - find_package(MPI) -endif() - -if(NOT COMPILER_SUPPORTS_CXX11) - message(FATAL "HighFive version >=2.0 requires c++ standard >= c++11") -endif() - -# Absolute include used to avoid interaction with downstream projects including -# HighFive as a subproject and using the the same filename -include(${PROJECT_SOURCE_DIR}/CMake/PackageConfig.cmake) - -if(HIGHFIVE_EXAMPLES) - add_subdirectory(src/examples) -endif() - -add_subdirectory(tests/unit) -add_subdirectory(doc) diff --git a/GeneratorInterface/LHEInterface/src/HighFive/LICENSE b/GeneratorInterface/LHEInterface/src/HighFive/LICENSE deleted file mode 100644 index bc1edcab2e3c7..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/README.md b/GeneratorInterface/LHEInterface/src/HighFive/README.md deleted file mode 100644 index 37bd46cf67bb9..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# HighFive - HDF5 header-only C++ Library - -[![Build Status](https://travis-ci.org/BlueBrain/HighFive.svg?branch=master)](https://travis-ci.org/BlueBrain/HighFive) - -[![Coverity Statys](https://scan.coverity.com/projects/13635/badge.svg)](https://scan.coverity.com/projects/highfive) - -## Brief - -HighFive is a modern C++/C++11 friendly interface for libhdf5. - -HighFive supports STL vector/string, Boost::UBLAS and Boost::Multi-array. It handles C++ from/to HDF5 automatic type mapping. -HighFive does not require an additional library and supports both HDF5 thread safety and Parallel HDF5 (contrary to the official hdf5 cpp) - - -### Design -- Simple C++-ish minimalist interface -- No other dependency than libhdf5 -- Zero overhead -- Support C++11 ( compatible with C++98 ) - - -### Dependencies -- libhdf5 -- (optional) boost >= 1.41 - - -### Usage - -#### Write a std::vector to 1D HDF5 dataset and read it back - -```c++ -using namespace HighFive; -// we create a new hdf5 file -File file("/tmp/new_file.h5", File::ReadWrite | File::Create | File::Truncate); - -std::vector data(50, 1); - -// let's create a dataset of native interger with the size of the vector 'data' -DataSet dataset = file.createDataSet("/dataset_one", DataSpace::From(data)); - -// let's write our vector of int to the HDF5 dataset -dataset.write(data); - -// read back -std::vector result; -dataset.read(result); -``` - -#### Write a 2 dimensional C double float array to a 2D HDF5 dataset - -See [create_dataset_double.cpp](src/examples/create_dataset_double.cpp) - -#### Write and read a matrix of double float (boost::ublas) to a 2D HDF5 dataset - -See [boost_ublas_double.cpp](src/examples/boost_ublas_double.cpp) - -#### Write and read a subset of a 2D double dataset - -See [select_partial_dataset_cpp11.cpp](src/examples/select_partial_dataset_cpp11.cpp) - -#### Create, write and list HDF5 attributes - -See [create_attribute_string_integer.cpp](src/examples/create_attribute_string_integer.cpp) - -#### And others - -See [src/examples/](src/examples/) sub-directory for more infos - -### Compile with HighFive - -```bash -c++ -o program -I/path/to/highfive/include source.cpp -lhdf5 -``` - - -### Test Compilation -Remember: Compilation is not required. Used only for unit test and examples - -```bash -mkdir build; pushd build -cmake ../ -make -make test -``` - -### Feature support - -- create/read/write file, dataset, group, dataspace. -- automatic memory management / ref counting -- automatic convertion of std::vector and nested std::vector from/to any dataset with basic types -- automatic convertion of std::string to/from variable length string dataset -- selection() / slice support -- parallel Read/Write operations from several nodes with Parallel HDF5 -- support HDF5 attributes - - -### Contributors -- Adrien Devresse - Blue Brain Project -- Ali Can Demiralp - -- Fernando Pereira - Blue Brain Project -- Stefan Eilemann - Blue Brain Project -- Tristan Carel - Blue Brain Project -- Wolf Vollprecht - QuantStack - -### License -Boost Software License 1.0 - - - - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/VERSION b/GeneratorInterface/LHEInterface/src/HighFive/VERSION deleted file mode 100644 index cd5ac039d67e0..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.0 diff --git a/GeneratorInterface/LHEInterface/src/HighFive/ci/travis/install.sh b/GeneratorInterface/LHEInterface/src/HighFive/ci/travis/install.sh deleted file mode 100755 index 35a0d347720f9..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/ci/travis/install.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - - -# install all dependencies for linux targets -if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then - - sudo apt update -y - sudo apt install -y libhdf5-serial-dev libboost-all-dev cmake g++ ninja-build - -fi - -# install all dependencies for osx targets -if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then - - brew install boost hdf5 cmake ninja -fi - - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/default.nix b/GeneratorInterface/LHEInterface/src/HighFive/default.nix deleted file mode 100644 index a692025cdae2d..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -# Nix development environment -# -# build: -# nix-build -I "BBPpkgs=https://github.com/BlueBrain/bbp-nixpkgs/archive/master.tar.gz" default.nix -# -# build and test: -# nix-build -I "BBPpkgs=https://goo.gl/wTvE5t" --arg testExec true default.nix -j 4 -# -# dev shell: -# nix-shell -I "BBPpkgs=https://goo.gl/wTvE5t" default.nix -# -with import { }; - -{ - highfive = highfive.overrideDerivation (oldAttr: rec { - name = "highfive-0.1"; - src = ./.; - - }); -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/doc/CMakeLists.txt b/GeneratorInterface/LHEInterface/src/HighFive/doc/CMakeLists.txt deleted file mode 100644 index 3bb01ca16732a..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/doc/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -if(HIGH_FIVE_DOCUMENTATION) -find_package(Pandoc REQUIRED) - -configure_file(build.sh.cmake build.sh @ONLY) - -add_custom_target(doc ALL DEPENDS - COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/build.sh - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/build.sh -) - -install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/index.html - DESTINATION ${HTML_INSTALL_DIR} -) -install( - DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src - DESTINATION ${HTML_INSTALL_DIR} -) -endif(HIGH_FIVE_DOCUMENTATION) \ No newline at end of file diff --git a/GeneratorInterface/LHEInterface/src/HighFive/doc/build.sh.cmake b/GeneratorInterface/LHEInterface/src/HighFive/doc/build.sh.cmake deleted file mode 100755 index d1b0adfe66905..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/doc/build.sh.cmake +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# This script generates HTML documentation of the project: -# - The top-level index.html is built from README.md -# - src/examples/index.html is a listing of C++ code snippets -# - HTML snippets are created for every src/examples/*.cpp file - -PANDOC=@PANDOC_EXECUTABLE@ -if [ x$PANDOC = @PANDOC_EXECUTABLE@ ] ; then - pandoc = pandoc -fi -examples_dir=@CMAKE_CURRENT_BINARY_DIR@/src/examples - -rm -f @CMAKE_CURRENT_BINARY_DIR@/examples.text -rm -rf @CMAKE_CURRENT_BINARY_DIR@/src - -cat < examples.text -# HighFive C++ Examples -EOF - -mkdir -p @CMAKE_CURRENT_BINARY_DIR@/src/examples -for example in @CMAKE_CURRENT_SOURCE_DIR@/../src/examples/*.cpp ; do - # Generate Markdown snippet from C++ snippet - echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.cpp .numberLines}" > $examples_dir/${example##*/}.text - cat $example >> $examples_dir/${example##*/}.text - echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " >> $examples_dir/${example##*/}.text - # Build HTML from Markdown - $PANDOC \ - $examples_dir/${example##*/}.text \ - -s --highlight-style pygments \ - -o $examples_dir/${example##*/}.html - # Get rid of the Markdown - rm $examples_dir/${example##*/}.text - - # Extract snippet title: the comments before the `main` function - comment=`sed -n '/int main/q;p' $example | tac | sed -n '/^\//p; /^[^/]/{q}' | tac | sed '/^\/\/$/d ; s@^// @@' | tr '\n' ' '` - if [ "x$comment" = x ] ;then - comment='description is missing' - fi - # Reference the snippet - echo "- [$comment](${example##*/}.html)" >> @CMAKE_CURRENT_BINARY_DIR@/examples.text -done - -# src/examples/index.html listing C++ snippets -$PANDOC \ - -c @CMAKE_CURRENT_SOURCE_DIR@/github-pandoc.css examples.text \ - -o $examples_dir/index.html - -# Top level index.html -$PANDOC -s -S \ - -c @CMAKE_CURRENT_SOURCE_DIR@/github-pandoc.css \ - @PROJECT_SOURCE_DIR@/README.md \ - -o @CMAKE_CURRENT_BINARY_DIR@/index.html - -# Fix links in top-level index.html -# - Insert ".html" to every links to CPP inside ... -# - Insert "index.html" to the src/examples/ link inside ... -sed '/^/,/<\/body>/ { s/href="\([^"]*cpp\)"/href="\1.html"/ ; s/href="\([^"]*\/\)"/href="\1index.html"/ }' \ - -i @CMAKE_CURRENT_BINARY_DIR@/index.html diff --git a/GeneratorInterface/LHEInterface/src/HighFive/doc/github-pandoc.css b/GeneratorInterface/LHEInterface/src/HighFive/doc/github-pandoc.css deleted file mode 100644 index 0607023b963f6..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/doc/github-pandoc.css +++ /dev/null @@ -1,424 +0,0 @@ -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ - -/* ========================================================================== - HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined in IE 8/9. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -nav, -section, -summary { - display: block; -} - -/** - * Correct `inline-block` display not defined in IE 8/9. - */ - -audio, -canvas, -video { - display: inline-block; -} - -/** - * Prevent modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9. - * Hide the `template` element in IE, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* ========================================================================== - Base - ========================================================================== */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* ========================================================================== - Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background: transparent; -} - -/** - * Address `outline` inconsistency between Chrome and other browsers. - */ - -a:focus { - outline: thin dotted; -} - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ - -a:active, -a:hover { - outline: 0; -} - -/* ========================================================================== - Typography - ========================================================================== */ - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari 5, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/** - * Address styling not present in IE 8/9, Safari 5, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/** - * Address styling not present in Safari 5 and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} - -/** - * Address styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -/** - * Correct font family set oddly in Safari 5 and Chrome. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, serif; - font-size: 1em; -} - -/** - * Improve readability of pre-formatted text in all browsers. - */ - -pre { - white-space: pre-wrap; -} - -/** - * Set consistent quote types. - */ - -q { - quotes: "\201C" "\201D" "\2018" "\2019"; -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* ========================================================================== - Embedded content - ========================================================================== */ - -/** - * Remove border when inside `a` element in IE 8/9. - */ - -img { - border: 0; -} - -/** - * Correct overflow displayed oddly in IE 9. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* ========================================================================== - Figures - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari 5. - */ - -figure { - margin: 0; -} - -/* ========================================================================== - Forms - ========================================================================== */ - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * 1. Correct font family not being inherited in all browsers. - * 2. Correct font size not being inherited in all browsers. - * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. - */ - -button, -input, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 2 */ - margin: 0; /* 3 */ -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -button, -input { - line-height: normal; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. - * Correct `select` style inheritance in Firefox 4+ and Opera. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; -} - -/** - * Remove inner padding and search cancel button in Safari 5 and Chrome - * on OS X. - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * 1. Remove default vertical scrollbar in IE 8/9. - * 2. Improve readability and alignment in all browsers. - */ - -textarea { - overflow: auto; /* 1 */ - vertical-align: top; /* 2 */ -} - -/* ========================================================================== - Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -.go-top { -position: fixed; -bottom: 2em; -right: 2em; -text-decoration: none; -background-color: #E0E0E0; -font-size: 12px; -padding: 1em; -display: inline; -} - -/* Github css */ - -html,body{ margin: auto; - padding-right: 1em; - padding-left: 1em; - max-width: 44em; color:black;}*:not('#mkdbuttons'){margin:0;padding:0}body{font:13.34px helvetica,arial,freesans,clean,sans-serif;-webkit-font-smoothing:subpixel-antialiased;line-height:1.4;padding:3px;background:#fff;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}p{margin:1em 0}a{color:#4183c4;text-decoration:none}body{background-color:#fff;padding:30px;margin:15px;font-size:14px;line-height:1.6}body>*:first-child{margin-top:0!important}body>*:last-child{margin-bottom:0!important}@media screen{body{box-shadow:0 0 0 1px #cacaca,0 0 0 4px #eee}}h1,h2,h3,h4,h5,h6{margin:20px 0 10px;padding:0;font-weight:bold;-webkit-font-smoothing:subpixel-antialiased;cursor:text}h1{font-size:28px;color:#000}h2{font-size:24px;border-bottom:1px solid #ccc;color:#000}h3{font-size:18px;color:#333}h4{font-size:16px;color:#333}h5{font-size:14px;color:#333}h6{color:#777;font-size:14px}p,blockquote,table,pre{margin:15px 0}ul{padding-left:30px}ol{padding-left:30px}ol li ul:first-of-type{margin-top:0}hr{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENDRjNBN0E2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENDRjNBN0I2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0NGM0E3ODY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;border:0 none;color:#ccc;height:4px;padding:0}body>h2:first-child{margin-top:0;padding-top:0}body>h1:first-child{margin-top:0;padding-top:0}body>h1:first-child+h2{margin-top:0;padding-top:0}body>h3:first-child,body>h4:first-child,body>h5:first-child,body>h6:first-child{margin-top:0;padding-top:0}a:first-child h1,a:first-child h2,a:first-child h3,a:first-child h4,a:first-child h5,a:first-child h6{margin-top:0;padding-top:0}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p,ul li>:first-child,ol li>:first-child{margin-top:0}dl{padding:0}dl dt{font-size:14px;font-weight:bold;font-style:italic;padding:0;margin:15px 0 5px}dl dt:first-child{padding:0}dl dt>:first-child{margin-top:0}dl dt>:last-child{margin-bottom:0}dl dd{margin:0 0 15px;padding:0 15px}dl dd>:first-child{margin-top:0}dl dd>:last-child{margin-bottom:0}blockquote{border-left:4px solid #DDD;padding:0 15px;color:#777}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}table{border-collapse:collapse;border-spacing:0;font-size:100%;font:inherit}table th{font-weight:bold;border:1px solid #ccc;padding:6px 13px}table td{border:1px solid #ccc;padding:6px 13px}table tr{border-top:1px solid #ccc;background-color:#fff}table tr:nth-child(2n){background-color:#f8f8f8}img{max-width:100%}code,tt{margin:0 2px;padding:0 5px;white-space:nowrap;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px;font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;color:#333}pre>code{margin:0;padding:0;white-space:pre;border:0;background:transparent}.highlight pre{background-color:#f8f8f8;border:1px solid #ccc;font-size:13px;line-height:19px;overflow:auto;padding:6px 10px;border-radius:3px}pre{background-color:#f8f8f8;border:1px solid #ccc;font-size:13px;line-height:19px;overflow:auto;padding:6px 10px;border-radius:3px}pre code,pre tt{background-color:transparent;border:0}.poetry pre{font-family:Georgia,Garamond,serif!important;font-style:italic;font-size:110%!important;line-height:1.6em;display:block;margin-left:1em}.poetry pre code{font-family:Georgia,Garamond,serif!important;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto;white-space:pre-wrap}sup,sub,a.footnote{font-size:1.4ex;height:0;line-height:1;vertical-align:super;position:relative}sub{vertical-align:sub;top:-1px}@media print{body{background:#fff}img,pre,blockquote,table,figure{page-break-inside:avoid}body{background:#fff;border:0}code{background-color:#fff;color:#333!important;padding:0 .2em;border:1px solid #dedede}pre{background:#fff}pre code{background-color:white!important;overflow:visible}}@media screen{body.inverted{color:#eee!important;border-color:#555;box-shadow:none}.inverted body,.inverted hr .inverted p,.inverted td,.inverted li,.inverted h1,.inverted h2,.inverted h3,.inverted h4,.inverted h5,.inverted h6,.inverted th,.inverted .math,.inverted caption,.inverted dd,.inverted dt,.inverted blockquote{color:#eee!important;border-color:#555;box-shadow:none}.inverted td,.inverted th{background:#333}.inverted h2{border-color:#555}.inverted hr{border-color:#777;border-width:1px!important}::selection{background:rgba(157,193,200,0.5)}h1::selection{background-color:rgba(45,156,208,0.3)}h2::selection{background-color:rgba(90,182,224,0.3)}h3::selection,h4::selection,h5::selection,h6::selection,li::selection,ol::selection{background-color:rgba(133,201,232,0.3)}code::selection{background-color:rgba(0,0,0,0.7);color:#eee}code span::selection{background-color:rgba(0,0,0,0.7)!important;color:#eee!important}a::selection{background-color:rgba(255,230,102,0.2)}.inverted a::selection{background-color:rgba(255,230,102,0.6)}td::selection,th::selection,caption::selection{background-color:rgba(180,237,95,0.5)}.inverted{background:#0b2531;background:#252a2a}.inverted body{background:#252a2a}.inverted a{color:#acd1d5}}.highlight .c{color:#998;font-style:italic}.highlight .err{color:#a61717;background-color:#e3d2d2}.highlight .k,.highlight .o{font-weight:bold}.highlight .cm{color:#998;font-style:italic}.highlight .cp{color:#999;font-weight:bold}.highlight .c1{color:#998;font-style:italic}.highlight .cs{color:#999;font-weight:bold;font-style:italic}.highlight .gd{color:#000;background-color:#fdd}.highlight .gd .x{color:#000;background-color:#faa}.highlight .ge{font-style:italic}.highlight .gr{color:#a00}.highlight .gh{color:#999}.highlight .gi{color:#000;background-color:#dfd}.highlight .gi .x{color:#000;background-color:#afa}.highlight .go{color:#888}.highlight .gp{color:#555}.highlight .gs{font-weight:bold}.highlight .gu{color:#800080;font-weight:bold}.highlight .gt{color:#a00}.highlight .kc,.highlight .kd,.highlight .kn,.highlight .kp,.highlight .kr{font-weight:bold}.highlight .kt{color:#458;font-weight:bold}.highlight .m{color:#099}.highlight .s{color:#d14}.highlight .na{color:#008080}.highlight .nb{color:#0086b3}.highlight .nc{color:#458;font-weight:bold}.highlight .no{color:#008080}.highlight .ni{color:#800080}.highlight .ne,.highlight .nf{color:#900;font-weight:bold}.highlight .nn{color:#555}.highlight .nt{color:#000080}.highlight .nv{color:#008080}.highlight .ow{font-weight:bold}.highlight .w{color:#bbb}.highlight .mf,.highlight .mh,.highlight .mi,.highlight .mo{color:#099}.highlight .sb,.highlight .sc,.highlight .sd,.highlight .s2,.highlight .se,.highlight .sh,.highlight .si,.highlight .sx{color:#d14}.highlight .sr{color:#009926}.highlight .s1{color:#d14}.highlight .ss{color:#990073}.highlight .bp{color:#999}.highlight .vc,.highlight .vg,.highlight .vi{color:#008080}.highlight .il{color:#099}.highlight .gc{color:#999;background-color:#eaf2f5}.type-csharp .highlight .k,.type-csharp .highlight .kt{color:#00F}.type-csharp .highlight .nf{color:#000;font-weight:normal}.type-csharp .highlight .nc{color:#2b91af}.type-csharp .highlight .nn{color:#000}.type-csharp .highlight .s,.type-csharp .highlight .sc{color:#a31515} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Attribute.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Attribute.hpp deleted file mode 100644 index 2c8d7ddf03f94..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Attribute.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c), 2017, Ali Can Demiralp - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5ATTRIBUTE_HPP -#define H5ATTRIBUTE_HPP - -#include - -#include "H5Object.hpp" - -namespace HighFive { - - template - class AnnotateTraits; - class DataType; - class DataSpace; - - class Attribute : public Object { - public: - size_t getStorageSize() const; - - /// - /// \brief getDataType - /// \return return the datatype associated with this dataset - /// - DataType getDataType() const; - - /// - /// \brief getSpace - /// \return return the dataspace associated with this dataset - /// - DataSpace getSpace() const; - - /// - /// \brief getMemSpace - /// \return same than getSpace for DataSet, compatibility with Selection - /// class - /// - DataSpace getMemSpace() const; - - /// - /// Read the attribute into a buffer - /// An exception is raised if the numbers of dimension of the buffer and of - /// the attribute are different - /// - /// The array type can be a N-pointer or a N-vector ( e.g int** integer two - /// dimensional array ) - template - void read(T& array) const; - - /// - /// Write the integrality N-dimension buffer to this attribute - /// An exception is raised if the numbers of dimension of the buffer and of - /// the attribute are different - /// - /// The array type can be a N-pointer or a N-vector ( e.g int** integer two - /// dimensional array ) - template - void write(const T& buffer); - - private: - Attribute(); - template - friend class ::HighFive::AnnotateTraits; - }; -} // namespace HighFive - -#include "bits/H5Attribute_misc.hpp" - -#endif // H5ATTRIBUTE_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSet.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSet.hpp deleted file mode 100644 index f249c3bd90db8..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSet.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5DATASET_HPP -#define H5DATASET_HPP - -#include - -#include "H5Object.hpp" -#include "bits/H5Annotate_traits.hpp" -#include "bits/H5Slice_traits.hpp" - -namespace HighFive { - - template - class NodeTraits; - template - class SliceTraits; - class DataType; - class DataSpace; - - class DataSet : public Object, public SliceTraits, public AnnotateTraits { - public: - size_t getStorageSize() const; - - /// - /// \brief getDataType - /// \return return the datatype associated with this dataset - /// - DataType getDataType() const; - - /// - /// \brief getSpace - /// \return return the dataspace associated with this dataset - /// - DataSpace getSpace() const; - - /// - /// \brief getMemSpace - /// \return same than getSpace for DataSet, compatibility with Selection - /// class - /// - DataSpace getMemSpace() const; - - /// - /// \brief getOffset - /// \return returns DataSet address in file - /// class - /// - size_t getOffset() const; - - /// \brief Change the size of the dataset - /// - /// This requires that the dataset was created with chunking, and you would - /// generally want to have set a larger maxdims setting - /// \param dims New size of the dataset - void resize(const std::vector& dims); - - private: - DataSet(); - template - friend class ::HighFive::NodeTraits; - }; -} // namespace HighFive - -#include "bits/H5DataSet_misc.hpp" - -#endif // H5DATASET_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSpace.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSpace.hpp deleted file mode 100644 index 57a7549270f05..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataSpace.hpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5DATASPACE_HPP -#define H5DATASPACE_HPP - -#include -#include - -#ifdef H5_USE_BOOST -#include -#include -#endif - -#include "H5Object.hpp" - -namespace HighFive { - - class File; - class DataSet; - - class DataSpace : public Object { - public: - static const size_t UNLIMITED = SIZE_MAX; - - /// dataspace type - enum DataspaceType { - datascape_scalar, - datascape_null - // simple dataspace are handle directly from their dimensions - }; - - /// create a dataspace of N-dimensions - /// Each dimension is configured this way - /// size(dim1) = vec[0] - /// size(dim2) = vec[1] - /// etc... - explicit DataSpace(const std::vector& dims); - - /// Create a dataspace from an iterator pair - template - DataSpace(const IT begin, const IT end); - - /// \brief Create a resizable N-dimensional dataspace - /// \params dims Initial size of dataspace - /// \params maxdims Maximum size of the dataspace - explicit DataSpace(const std::vector& dims, const std::vector& maxdims); - - /// - /// \brief DataSpace create a dataspace of a single dimension and of size - /// dim1 - /// \param dim1 - /// - explicit DataSpace(size_t dim1); - - /// - /// \brief DataSpace create a scalar dataspace or a null dataset - /// - explicit DataSpace(DataspaceType dtype); - - /// Create a new DataSpace - /// with a different id available for modifications - DataSpace clone() const; - - /// - /// \brief getNumberDimensions - /// \return the number of dimensions in the current dataspace - /// - size_t getNumberDimensions() const; - - /// \brief getDimensions - /// \return return a vector of N-element, each element is the size of the - /// associated dataset dimension - std::vector getDimensions() const; - - /// \brief getMaxDimensions - /// \return return a vector of N-element, each element is the size of the - /// associated dataset maximum dimension - std::vector getMaxDimensions() const; - - /// Create a dataspace matching a single element of a basic type - /// supported type are integrals (int,long), floating points (float,double) - /// and std::string - template - static DataSpace From(const ScalarValue& scalar_value); - - /// Create a dataspace matching the container dimensions and size - /// Supported Containers are: - /// - vector of fundamental types - /// - vector of std::string - /// - boost::multi_array - template - static DataSpace From(const std::vector& vec); - -#ifdef H5_USE_BOOST - template - static DataSpace From(const boost::multi_array& container); - - template - static DataSpace From(const boost::numeric::ublas::matrix& mat); -#endif - - protected: - explicit DataSpace(); - - friend class Attribute; - friend class File; - friend class DataSet; - }; -} // namespace HighFive - -#include "bits/H5Dataspace_misc.hpp" - -#endif // H5DATASPACE_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataType.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataType.hpp deleted file mode 100644 index b9f7f7d038bc6..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5DataType.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5DATATYPE_HPP -#define H5DATATYPE_HPP - -#include "H5Object.hpp" - -namespace HighFive { - - struct TypeMapper; - - /// - /// \brief HDF5 Data Type - /// - class DataType : public Object { - public: - DataType(); - - bool operator==(const DataType& other) const; - - bool operator!=(const DataType& other) const; - - protected: - friend class Attribute; - friend class File; - friend class DataSet; - }; - - /// - /// \brief create an HDF5 DataType from a C++ type - /// - /// Support only basic data type - /// - template - class AtomicType : public DataType { - public: - AtomicType(); - - typedef T basic_type; - }; -} // namespace HighFive - -#include "bits/H5DataType_misc.hpp" - -#endif // H5DATATYPE_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Exception.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Exception.hpp deleted file mode 100644 index ad04ed59c827d..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Exception.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5EXCEPTION_HPP -#define H5EXCEPTION_HPP - -#include -#include - -#include "bits/H5Utils.hpp" - -namespace HighFive { - - /// - /// \brief Basic HighFive Exception class - /// - /// - class Exception : public std::exception { - public: - Exception(const std::string& err_msg) : _errmsg(err_msg), _next(), _err_major(0), _err_minor(0) {} - - virtual ~Exception() throw() {} - - /// - /// \brief get the current exception error message - /// \return - /// - inline virtual const char* what() const throw() { return _errmsg.c_str(); } - - /// - /// \brief define the error message - /// \param errmsg - /// - inline virtual void setErrorMsg(const std::string& errmsg) { _errmsg = errmsg; } - - /// - /// \brief nextException - /// \return pointer to the next exception in the chain, or NULL if not - /// existing - /// - inline Exception* nextException() const { return _next.get(); } - - /// - /// \brief HDF5 library error mapper - /// \return HDF5 major error number - /// - inline hid_t getErrMajor() const { return _err_major; } - - /// - /// \brief HDF5 library error mapper - /// \return HDF5 minor error number - /// - inline hid_t getErrMinor() const { return _err_minor; } - - protected: - std::string _errmsg; - details::Mem::shared_ptr _next; - hid_t _err_major, _err_minor; - - friend struct HDF5ErrMapper; - }; - - /// - /// \brief Exception specific to HighFive Object interface - /// - class ObjectException : public Exception { - public: - ObjectException(const std::string& err_msg) : Exception(err_msg) {} - }; - - /// - /// \brief Exception specific to HighFive DataType interface - /// - class DataTypeException : public Exception { - public: - DataTypeException(const std::string& err_msg) : Exception(err_msg) {} - }; - - /// - /// \brief Exception specific to HighFive File interface - /// - class FileException : public Exception { - public: - FileException(const std::string& err_msg) : Exception(err_msg) {} - }; - - /// - /// \brief Exception specific to HighFive DataSpace interface - /// - class DataSpaceException : public Exception { - public: - DataSpaceException(const std::string& err_msg) : Exception(err_msg) {} - }; - - /// - /// \brief Exception specific to HighFive Attribute interface - /// - class AttributeException : public Exception { - public: - AttributeException(const std::string& err_msg) : Exception(err_msg) {} - }; - - /// - /// \brief Exception specific to HighFive DataSet interface - /// - class DataSetException : public Exception { - public: - DataSetException(const std::string& err_msg) : Exception(err_msg) {} - }; - - /// - /// \brief Exception specific to HighFive Group interface - /// - class GroupException : public Exception { - public: - GroupException(const std::string& err_msg) : Exception(err_msg) {} - }; - - /// - /// \brief Exception specific to HighFive Property interface - /// - class PropertyException : public Exception { - public: - PropertyException(const std::string& err_msg) : Exception(err_msg) {} - }; -} // namespace HighFive - -#include "bits/H5Exception_misc.hpp" - -#endif // H5EXCEPTION_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5File.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5File.hpp deleted file mode 100644 index b81d37fb7a96f..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5File.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5FILE_HPP -#define H5FILE_HPP - -#include - -#include "H5FileDriver.hpp" -#include "H5Object.hpp" - -#include "bits/H5Annotate_traits.hpp" -#include "bits/H5Node_traits.hpp" - -namespace HighFive { - - /// - /// \brief File class - /// - class File : public Object, public NodeTraits, public AnnotateTraits { - public: - /// Open flag: Read only access - static const int ReadOnly = 0x00; - /// Open flag: Read Write access - static const int ReadWrite = 0x01; - /// Open flag: Truncate a file if already existing - static const int Truncate = 0x02; - /// Open flag: Open will fail if file already exist - static const int Excl = 0x04; - /// Open flag: Open in debug mode - static const int Debug = 0x08; - /// Open flag: Create non existing file - static const int Create = 0x10; - /// Derived open flag: common write mode (=ReadWrite | Create | Truncate) - static const int Overwrite = Truncate; - /// Derived open flag: Opens RW or exclusivelly creates - static const int OpenOrCreate = ReadWrite | Create; - - /// - /// \brief File - /// \param filename: filepath of the HDF5 file - /// \param openFlags: Open mode / flags ( ReadOnly, ReadWrite) - /// - /// Open or create a new HDF5 file - explicit File(const std::string& filename, - int openFlags = ReadOnly, - const Properties& fileAccessProps = FileDriver()); - - /// - /// \brief Return the name of the file - /// - const std::string& getName() const; - - /// - /// \brief flush - /// - /// Flushes all buffers associated with a file to disk - /// - void flush(); - - private: - std::string _filename; - }; -} // namespace HighFive - -#include "bits/H5File_misc.hpp" - -#endif // H5FILE_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5FileDriver.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5FileDriver.hpp deleted file mode 100644 index e9aecdfe615bd..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5FileDriver.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5FILEDRIVER_HPP -#define H5FILEDRIVER_HPP - -#include "H5PropertyList.hpp" - -namespace HighFive { - - /// - /// \brief file driver base concept - /// - class FileDriver : public Properties { - public: - inline FileDriver(); - - private: - }; - - /// - /// \brief MPIIO Driver for Parallel HDF5 - /// - class MPIOFileDriver : public FileDriver { - public: - template - inline MPIOFileDriver(Comm mpi_comm, Info mpi_info); - - private: - }; - -} // namespace HighFive - -#include "bits/H5FileDriver_misc.hpp" - -#endif // H5FILEDRIVER_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Group.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Group.hpp deleted file mode 100644 index 2a41ca1d72f80..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Group.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef HIGHFIVE_H5GROUP_HPP -#define HIGHFIVE_H5GROUP_HPP - -#include "H5Object.hpp" -#include "bits/H5Annotate_traits.hpp" -#include "bits/H5Node_traits.hpp" - -namespace HighFive { - - class File; - - class Group : public Object, public NodeTraits, public AnnotateTraits { - public: - Group(); - - friend class File; - }; -} // namespace HighFive - -#include "bits/H5Group_misc.hpp" - -#endif // HIGHFIVE_H5GROUP_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Object.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Object.hpp deleted file mode 100644 index d75adcc5fb877..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Object.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5OBJECT_HPP -#define H5OBJECT_HPP - -#include - -namespace HighFive { - - template - class NodeTraits; - template - class AnnotateTraits; - - class Object { - public: - // decrease reference counter - ~Object(); - - /// - /// \brief isValid - /// \return true if current Object is a valid HDF5Object - /// - bool isValid() const; - - /// - /// \brief getId - /// \return iternal HDF5 id to the object - /// provided for C API compatibility - /// - hid_t getId() const; - - protected: - // empty constructor - Object(); - - // copy constructor, increase reference counter - Object(const Object& other); - - Object& operator=(const Object& other); - - hid_t _hid; - - private: - template - friend class NodeTraits; - template - friend class AnnotateTraits; - }; -} // namespace HighFive - -#include "bits/H5Object_misc.hpp" - -#endif // H5OBJECT_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5PropertyList.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5PropertyList.hpp deleted file mode 100644 index 41abd4ff30132..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5PropertyList.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c), 2017-2018, Adrien Devresse - * Juan Hernando - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5PROPERTY_LIST_HPP -#define H5PROPERTY_LIST_HPP - -#include "H5Object.hpp" - -#include - -namespace HighFive { - - /// - /// \brief Generic HDF5 property List - /// - class Properties { - public: - enum Type { FILE_ACCESS, DATASET_CREATE }; - - ~Properties(); - -#ifdef H5_USE_CXX11 - Properties(Properties&& other); - Properties& operator=(Properties&& other); -#endif - - Type getType() const { return _type; } - - hid_t getId() const { return _hid; } - - /** - * Add a property to this property list. - * A property is an object which is expected to have a method with the - * following signature void apply(hid_t hid) const - */ - template - void add(const Property& property); - - protected: - // protected constructor - explicit Properties(Type type); - - private: -#ifdef H5_USE_CXX11 - Properties(const Properties&) = delete; - Properties& operator=(const Properties&) = delete; -#else - Properties(const Properties&); - Properties& operator=(const Properties&); -#endif - - Type _type; - hid_t _hid; - }; - - class DataSetCreateProps : public Properties { - public: - DataSetCreateProps() : Properties(DATASET_CREATE) {} - }; - - class Chunking { - public: - Chunking(const std::vector& dims) : _dims(dims) {} - - private: - friend class Properties; - void apply(hid_t hid) const; - std::vector _dims; - }; - - class Deflate { - public: - Deflate(int level) : _level(level) {} - - private: - friend class Properties; - void apply(hid_t hid) const; - int _level; - }; - - class Shuffle { - public: - Shuffle() {} - - private: - friend class Properties; - void apply(hid_t hid) const; - }; - -} // namespace HighFive - -#include "bits/H5PropertyList_misc.hpp" - -#endif // H5PROPERTY_LIST_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Selection.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Selection.hpp deleted file mode 100644 index 75a4525783ab9..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Selection.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5SELECTION_HPP -#define H5SELECTION_HPP - -#include "H5DataSet.hpp" -#include "H5Object.hpp" - -#include "bits/H5Slice_traits.hpp" - -namespace HighFive { - - template - class SliceTraits; - - /// - /// \brief Selection: represent a view on a slice/part of a dataset - /// - /// A Selection is valid only if its parent dataset is valid - /// - class Selection : public SliceTraits { - public: - /// - /// \brief getSpace - /// \return Dataspace associated with this selection - /// - DataSpace getSpace() const; - - /// - /// \brief getMemSpace - /// \return Dataspace associated with the memory representation of this - /// selection - /// - DataSpace getMemSpace() const; - - /// - /// \brief getDataSet - /// \return parent dataset of this selection - /// - DataSet& getDataset(); - const DataSet& getDataset() const; - - private: - Selection(const DataSpace& memspace, const DataSpace& file_space, const DataSet& set); - - DataSpace _mem_space, _file_space; - DataSet _set; - - template - friend class ::HighFive::SliceTraits; - // absolute namespace naming due to GCC bug 52625 - }; -} // namespace HighFive - -#include "bits/H5Selection_misc.hpp" - -#endif // H5SELECTION_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Utility.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Utility.hpp deleted file mode 100644 index ee8238452ee1e..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/H5Utility.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c), 2017, Juan Hernando - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ - -#ifndef H5UTILITY_HPP -#define H5UTILITY_HPP - -#include - -namespace HighFive { - - /// \brief Utility class to disable HDF5 stack printing inside a scope. - class SilenceHDF5 { - public: - inline SilenceHDF5() : _client_data(0) { - H5Eget_auto2(H5E_DEFAULT, &_func, &_client_data); - H5Eset_auto2(H5E_DEFAULT, 0, 0); - } - - inline ~SilenceHDF5() { H5Eset_auto2(H5E_DEFAULT, _func, _client_data); } - - private: - H5E_auto2_t _func; - void* _client_data; - }; -} // namespace HighFive - -#endif // H5UTIL_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits.hpp deleted file mode 100644 index 34f5ffd1af303..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5ANNOTATE_TRAITS_HPP -#define H5ANNOTATE_TRAITS_HPP - -#include - -namespace HighFive { - - class Attribute; - class DataSet; - class Group; - class DataSpace; - class DataType; - - template - class AnnotateTraits { - public: - /// - /// \brief create a new attribute with the name attribute_name - /// \param attribute_name - /// \return the attribute object - /// - Attribute createAttribute(const std::string& attribute_name, const DataSpace& space, const DataType& type); - - /// - /// \brief createDataSet create a new dataset in the current file with a - /// size specified by space - /// \param dataset_name identifier of the dataset - /// \param space Associated DataSpace, see \ref DataSpace for more - /// informations - /// \return DataSet Object - /// - /// - /// - template - Attribute createAttribute(const std::string& attribute_name, const DataSpace& space); - - /// - /// \brief open an existing attribute with the name attribute_name - /// \param attribute_name - /// \return the attribute object - /// - Attribute getAttribute(const std::string& attribute_name) const; - - /// - /// \brief return the number of attributes of the node / group - /// \return number of attributes - size_t getNumberAttributes() const; - - /// - /// \brief list all attribute name of the node / group - /// \return number of attributes - std::vector listAttributeNames() const; - - /// - /// \brief checks an attribute exists - /// \return number of attributes - bool hasAttribute(const std::string& attr_name) const; - - private: - typedef Derivate derivate_type; - }; -} // namespace HighFive - -#include "H5Annotate_traits_misc.hpp" - -#endif // H5ANNOTATE_TRAITS_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits_misc.hpp deleted file mode 100644 index e9c2e7b063709..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Annotate_traits_misc.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5ANNOTATE_TRAITS_MISC_HPP -#define H5ANNOTATE_TRAITS_MISC_HPP - -#include "H5Annotate_traits.hpp" -#include "H5Iterables_misc.hpp" - -#include -#include - -#include "../H5Attribute.hpp" -#include "../H5DataSpace.hpp" -#include "../H5DataType.hpp" -#include "../H5Exception.hpp" - -#include - -namespace HighFive { - - template - inline Attribute AnnotateTraits::createAttribute(const std::string& attribute_name, - const DataSpace& space, - const DataType& dtype) { - Attribute attribute; - if ((attribute._hid = H5Acreate2(static_cast(this)->getId(), - attribute_name.c_str(), - dtype._hid, - space._hid, - H5P_DEFAULT, - H5P_DEFAULT)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to create the attribute \"") + attribute_name + - "\":"); - } - return attribute; - } - - template - template - inline Attribute AnnotateTraits::createAttribute(const std::string& attribute_name, - const DataSpace& space) { - return createAttribute(attribute_name, space, AtomicType()); - } - - template - inline Attribute AnnotateTraits::getAttribute(const std::string& attribute_name) const { - Attribute attribute; - if ((attribute._hid = H5Aopen(static_cast(this)->getId(), attribute_name.c_str(), H5P_DEFAULT)) < - 0) { - HDF5ErrMapper::ToException(std::string("Unable to open the attribute \"") + attribute_name + - "\":"); - } - return attribute; - } - - template - inline size_t AnnotateTraits::getNumberAttributes() const { - int res = H5Aget_num_attrs(static_cast(this)->getId()); - if (res < 0) { - HDF5ErrMapper::ToException( - std::string("Unable to count attributes in existing group or file")); - } - return res; - } - - template - inline std::vector AnnotateTraits::listAttributeNames() const { - std::vector names; - details::HighFiveIterateData iterateData(names); - - size_t num_objs = getNumberAttributes(); - names.reserve(num_objs); - - if (H5Aiterate2(static_cast(this)->getId(), - H5_INDEX_NAME, - H5_ITER_INC, - NULL, - &details::internal_high_five_iterate, - static_cast(&iterateData)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to list attributes in group")); - } - - return names; - } - - template - inline bool AnnotateTraits::hasAttribute(const std::string& attr_name) const { - int res = H5Aexists(static_cast(this)->getId(), attr_name.c_str()); - if (res < 0) { - HDF5ErrMapper::ToException(std::string("Unable to check for attribute in group")); - } - return res; - } -} // namespace HighFive - -#endif // H5ANNOTATE_TRAITS_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Attribute_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Attribute_misc.hpp deleted file mode 100644 index 9da11144f5433..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Attribute_misc.hpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c), 2017, Ali Can Demiralp - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5ATTRIBUTE_MISC_HPP -#define H5ATTRIBUTE_MISC_HPP - -#include -#include -#include -#include -#include - -#ifdef H5_USE_BOOST -#include -#endif - -#include -#include - -#include "../H5Attribute.hpp" -#include "../H5DataSpace.hpp" -#include "../H5DataType.hpp" - -#include "H5Converter_misc.hpp" -#include "H5Utils.hpp" - -namespace HighFive { - - inline Attribute::Attribute() {} - - inline size_t Attribute::getStorageSize() const { return H5Aget_storage_size(_hid); } - - inline DataType Attribute::getDataType() const { - DataType res; - res._hid = H5Aget_type(_hid); - return res; - } - - inline DataSpace Attribute::getSpace() const { - DataSpace space; - if ((space._hid = H5Aget_space(_hid)) < 0) { - HDF5ErrMapper::ToException("Unable to get DataSpace out of Attribute"); - } - return space; - } - - inline DataSpace Attribute::getMemSpace() const { return getSpace(); } - - template - inline void Attribute::read(T& array) const { - typedef typename std::remove_const::type type_no_const; - - type_no_const& nocv_array = const_cast(array); - - const size_t dim_array = details::array_dims::value; - DataSpace space = getSpace(); - DataSpace mem_space = getMemSpace(); - - if (!details::checkDimensions(mem_space, dim_array)) { - std::ostringstream ss; - ss << "Impossible to read attribute of dimensions " << mem_space.getNumberDimensions() - << " into arrays of dimensions " << dim_array; - throw DataSpaceException(ss.str()); - } - - // Create mem datatype - const AtomicType::type> array_datatype; - - // Apply pre read convertions - details::data_converter converter(nocv_array, mem_space); - - if (H5Aread(getId(), array_datatype.getId(), static_cast(converter.transform_read(nocv_array))) < 0) { - HDF5ErrMapper::ToException("Error during HDF5 Read: "); - } - - // re-arrange results - converter.process_result(nocv_array); - } - - template - inline void Attribute::write(const T& buffer) { - typedef typename std::remove_const::type type_no_const; - - type_no_const& nocv_buffer = const_cast(buffer); - - const size_t dim_buffer = details::array_dims::value; - DataSpace space = getSpace(); - DataSpace mem_space = getMemSpace(); - - if (!details::checkDimensions(mem_space, dim_buffer)) { - std::ostringstream ss; - ss << "Impossible to write buffer of dimensions " << dim_buffer << " into attribute of dimensions " - << mem_space.getNumberDimensions(); - throw DataSpaceException(ss.str()); - } - - const AtomicType::type> array_datatype; - - // Apply pre write convertions - details::data_converter converter(nocv_buffer, mem_space); - - if (H5Awrite(getId(), array_datatype.getId(), static_cast(converter.transform_write(nocv_buffer))) < - 0) { - HDF5ErrMapper::ToException("Error during HDF5 Write: "); - } - } -} // namespace HighFive - -#endif // H5ATTRIBUTE_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Converter_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Converter_misc.hpp deleted file mode 100644 index 7bb7a0b5fb2c5..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Converter_misc.hpp +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5CONVERTER_MISC_HPP -#define H5CONVERTER_MISC_HPP - -#include -#include -#include -#include -#include -#include - -#ifdef H5_USE_BOOST -#include -#include -#endif - -#include -#include - -#include "../H5DataSpace.hpp" -#include "../H5DataType.hpp" - -#include "H5Utils.hpp" - -namespace HighFive { - - namespace details { - - inline void check_dimensions_vector(size_t size_vec, size_t size_dataset, size_t dimension) { - if (size_vec != size_dataset) { - std::ostringstream ss; - ss << "Mismatch between vector size (" << size_vec << ") and dataset size (" << size_dataset; - ss << ") on dimension " << dimension; - throw DataSetException(ss.str()); - } - } - - // copy multi dimensional vector in C++ in one C-style multi dimensional buffer - template - inline void vectors_to_single_buffer(const std::vector& vec_single_dim, - const std::vector& dims, - size_t current_dim, - std::vector& buffer) { - check_dimensions_vector(vec_single_dim.size(), dims[current_dim], current_dim); - buffer.insert(buffer.end(), vec_single_dim.begin(), vec_single_dim.end()); - } - - template - inline void vectors_to_single_buffer(const std::vector& vec_multi_dim, - const std::vector& dims, - size_t current_dim, - std::vector::type>& buffer) { - check_dimensions_vector(vec_multi_dim.size(), dims[current_dim], current_dim); - for (typename std::vector::const_iterator it = vec_multi_dim.begin(); it < vec_multi_dim.end(); ++it) { - vectors_to_single_buffer(*it, dims, current_dim + 1, buffer); - } - } - - // copy single buffer to multi dimensional vector, following dimensions - // specified - template - inline typename std::vector::iterator single_buffer_to_vectors(typename std::vector::iterator begin_buffer, - typename std::vector::iterator end_buffer, - const std::vector& dims, - size_t current_dim, - std::vector& vec_single_dim) { - const size_t n_elems = dims[current_dim]; - typename std::vector::iterator end_copy_iter = std::min(begin_buffer + n_elems, end_buffer); - vec_single_dim.assign(begin_buffer, end_copy_iter); - return end_copy_iter; - } - - template - inline typename std::vector::iterator single_buffer_to_vectors(typename std::vector::iterator begin_buffer, - typename std::vector::iterator end_buffer, - const std::vector& dims, - size_t current_dim, - std::vector& vec_multi_dim) { - const size_t n_elems = dims[current_dim]; - vec_multi_dim.resize(n_elems); - - for (typename std::vector::iterator it = vec_multi_dim.begin(); it < vec_multi_dim.end(); ++it) { - begin_buffer = single_buffer_to_vectors(begin_buffer, end_buffer, dims, current_dim + 1, *it); - } - return begin_buffer; - } - - // apply conversion operations to basic scalar type - template - struct data_converter { - inline data_converter(Scalar& datamem, DataSpace& space) { - static_assert((std::is_arithmetic::value || std::is_enum::value || - std::is_same::value), - "supported datatype should be an arithmetic value, a " - "std::string or a container/array"); - (void)datamem; - (void)space; // do nothing - } - - inline Scalar* transform_read(Scalar& datamem) { return &datamem; } - - inline Scalar* transform_write(Scalar& datamem) { return &datamem; } - - inline void process_result(Scalar& datamem) { - (void)datamem; // do nothing - } - }; - - // apply conversion operations to the incoming data - // if they are a cstyle array - template - struct data_converter::value)>::type> { - inline data_converter(CArray& datamem, DataSpace& space) { - (void)datamem; - (void)space; // do nothing - } - - inline CArray& transform_read(CArray& datamem) { return datamem; } - - inline CArray& transform_write(CArray& datamem) { return datamem; } - - inline void process_result(CArray& datamem) { - (void)datamem; // do nothing - } - }; - - // apply conversion for vectors 1D - template - struct data_converter, - typename std::enable_if<(std::is_same::type>::value)>::type> { - inline data_converter(std::vector& vec, DataSpace& space, size_t dim = 0) : _space(&space), _dim(dim) { - assert(_space->getDimensions().size() > dim); - (void)vec; - } - - inline typename type_of_array::type* transform_read(std::vector& vec) { - vec.resize(_space->getDimensions()[_dim]); - return &(vec[0]); - } - - inline typename type_of_array::type* transform_write(std::vector& vec) { return &(vec[0]); } - - inline void process_result(std::vector& vec) { (void)vec; } - - DataSpace* _space; - size_t _dim; - }; - -#ifdef H5_USE_BOOST - // apply conversion to boost multi array - template - struct data_converter, void> { - typedef typename boost::multi_array MultiArray; - - inline data_converter(MultiArray& array, DataSpace& space, size_t dim = 0) : _dims(space.getDimensions()) { - assert(_dims.size() == Dims); - (void)dim; - (void)array; - } - - inline typename type_of_array::type* transform_read(MultiArray& array) { - if (std::equal(_dims.begin(), _dims.end(), array.shape()) == false) { - boost::array ext; - std::copy(_dims.begin(), _dims.end(), ext.begin()); - array.resize(ext); - } - return array.data(); - } - - inline typename type_of_array::type* transform_write(MultiArray& array) { return array.data(); } - - inline void process_result(MultiArray& array) { (void)array; } - - std::vector _dims; - }; - - // apply conversion to boost matrix ublas - template - struct data_converter, void> { - typedef typename boost::numeric::ublas::matrix Matrix; - - inline data_converter(Matrix& array, DataSpace& space, size_t dim = 0) : _dims(space.getDimensions()) { - assert(_dims.size() == 2); - (void)dim; - (void)array; - } - - inline typename type_of_array::type* transform_read(Matrix& array) { - boost::array sizes = {{array.size1(), array.size2()}}; - - if (std::equal(_dims.begin(), _dims.end(), sizes.begin()) == false) { - array.resize(_dims[0], _dims[1], false); - array(0, 0) = 0; // force initialization - } - - return &(array(0, 0)); - } - - inline typename type_of_array::type* transform_write(Matrix& array) { return &(array(0, 0)); } - - inline void process_result(Matrix& array) { (void)array; } - - std::vector _dims; - }; -#endif - - // apply conversion for vectors nested vectors - template - struct data_converter, typename std::enable_if<(is_container::value)>::type> { - inline data_converter(std::vector& vec, DataSpace& space, size_t dim = 0) - : _dims(space.getDimensions()), _dim(dim), _vec_align() { - (void)vec; - } - - inline typename type_of_array::type* transform_read(std::vector& vec) { - (void)vec; - _vec_align.resize(get_total_size()); - return &(_vec_align[0]); - } - - inline typename type_of_array::type* transform_write(std::vector& vec) { - _vec_align.reserve(get_total_size()); - vectors_to_single_buffer(vec, _dims, 0, _vec_align); - return &(_vec_align[0]); - } - - inline void process_result(std::vector& vec) { - single_buffer_to_vectors::type, T>( - _vec_align.begin(), _vec_align.end(), _dims, 0, vec); - } - - inline size_t get_total_size() { - return std::accumulate(_dims.begin(), _dims.end(), 1, std::multiplies()); - } - - std::vector _dims; - size_t _dim; - std::vector::type> _vec_align; - }; - - // apply conversion to scalar string - template <> - struct data_converter { - inline data_converter(std::string& vec, DataSpace& space) : _c_vec(nullptr), _space(space) { (void)vec; } - - // create a C vector adapted to HDF5 - // fill last element with NULL to identify end - inline char** transform_read(std::string&) { return (&_c_vec); } - - static inline char* char_converter(const std::string& str) { return const_cast(str.c_str()); } - - inline char** transform_write(std::string& str) { - _c_vec = const_cast(str.c_str()); - return &_c_vec; - } - - inline void process_result(std::string& str) { - assert(_c_vec != nullptr); - str = std::string(_c_vec); - - if (_c_vec != nullptr) { - AtomicType str_type; - (void)H5Dvlen_reclaim(str_type.getId(), _space.getId(), H5P_DEFAULT, &_c_vec); - } - } - - char* _c_vec; - DataSpace& _space; - }; - - // apply conversion for vectors of string (derefence) - template <> - struct data_converter, void> { - inline data_converter(std::vector& vec, DataSpace& space) : _space(space) { (void)vec; } - - // create a C vector adapted to HDF5 - // fill last element with NULL to identify end - inline char** transform_read(std::vector& vec) { - (void)vec; - _c_vec.resize(_space.getDimensions()[0], nullptr); - return (&_c_vec[0]); - } - - static inline char* char_converter(const std::string& str) { return const_cast(str.c_str()); } - - inline char** transform_write(std::vector& vec) { - _c_vec.resize(vec.size() + 1, nullptr); - std::transform(vec.begin(), vec.end(), _c_vec.begin(), &char_converter); - return (&_c_vec[0]); - } - - inline void process_result(std::vector& vec) { - (void)vec; - vec.resize(_c_vec.size()); - for (size_t i = 0; i < vec.size(); ++i) { - vec[i] = std::string(_c_vec[i]); - } - - if (_c_vec.empty() == false && _c_vec[0] != nullptr) { - AtomicType str_type; - (void)H5Dvlen_reclaim(str_type.getId(), _space.getId(), H5P_DEFAULT, &(_c_vec[0])); - } - } - - std::vector _c_vec; - DataSpace& _space; - }; - } // namespace details -} // namespace HighFive - -#endif // H5CONVERTER_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataSet_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataSet_misc.hpp deleted file mode 100644 index 73869d2917272..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataSet_misc.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5DATASET_MISC_HPP -#define H5DATASET_MISC_HPP - -#include -#include -#include -#include -#include - -#ifdef H5_USE_BOOST -#include -#endif - -#include -#include - -#include "../H5DataSet.hpp" -#include "../H5DataSpace.hpp" -#include "../H5DataType.hpp" - -#include "H5Slice_traits_misc.hpp" -#include "H5Utils.hpp" - -namespace HighFive { - - inline DataSet::DataSet() {} - - inline size_t DataSet::getStorageSize() const { return H5Dget_storage_size(_hid); } - - inline DataType DataSet::getDataType() const { - DataType res; - res._hid = H5Dget_type(_hid); - return res; - } - - inline DataSpace DataSet::getSpace() const { - DataSpace space; - if ((space._hid = H5Dget_space(_hid)) < 0) { - HDF5ErrMapper::ToException("Unable to get DataSpace out of DataSet"); - } - return space; - } - - inline DataSpace DataSet::getMemSpace() const { return getSpace(); } - - inline size_t DataSet::getOffset() const { - haddr_t addr = H5Dget_offset(_hid); - if (addr == HADDR_UNDEF) { - HDF5ErrMapper::ToException("Cannot get offset of DataSet."); - } - return addr; - } - - inline void DataSet::resize(const std::vector& dims) { - const size_t numDimensions = getSpace().getDimensions().size(); - if (dims.size() != numDimensions) { - HDF5ErrMapper::ToException("Invalid dataspace dimensions, got " + std::to_string(dims.size()) + - " expected " + std::to_string(numDimensions)); - } - - std::vector real_dims(dims.begin(), dims.end()); - - if (H5Dset_extent(getId(), real_dims.data()) < 0) { - HDF5ErrMapper::ToException("Could not resize dataset."); - } - } - -} // namespace HighFive - -#endif // H5DATASET_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataType_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataType_misc.hpp deleted file mode 100644 index 90198d0da29d4..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5DataType_misc.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5DATATYPE_MISC_HPP -#define H5DATATYPE_MISC_HPP - -#include -#include - -#include "../H5DataType.hpp" -#include "../H5Exception.hpp" - -#include - -namespace HighFive { - - inline DataType::DataType() {} - - inline bool DataType::operator==(const DataType& other) const { return (H5Tequal(_hid, other._hid) > 0); } - - inline bool DataType::operator!=(const DataType& other) const { return !(*this == other); } - - // char mapping - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_CHAR); - } - - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_CHAR); - } - - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_UCHAR); - } - - // short mapping - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_SHORT); - } - - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_USHORT); - } - - // integer mapping - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_INT); - } - - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_UINT); - } - - // long mapping - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_LONG); - } - - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_ULONG); - } - - // long long mapping - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_LLONG); - } - - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_ULLONG); - } - - // float and double mapping - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_FLOAT); - } - - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_DOUBLE); - } - - // boolean mapping - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_NATIVE_HBOOL); - } - - // std string - template <> - inline AtomicType::AtomicType() { - _hid = H5Tcopy(H5T_C_S1); - if (H5Tset_size(_hid, H5T_VARIABLE) < 0) { - HDF5ErrMapper::ToException("Unable to define datatype size to variable"); - } - // define encoding to UTF-8 by default - H5Tset_cset(_hid, H5T_CSET_UTF8); - } - - template <> - inline AtomicType >::AtomicType() { - static hid_t cplx_hid; - static size_t real_offset; // - static size_t imag_offset; // - - cplx_hid = H5Tcreate(H5T_COMPOUND, sizeof(std::complex)); - - real_offset = 0.; - imag_offset = sizeof(double); - - // h5py/numpy compatible datatype - H5Tinsert(cplx_hid, "r", real_offset, H5T_NATIVE_DOUBLE); - H5Tinsert(cplx_hid, "i", imag_offset, H5T_NATIVE_DOUBLE); - _hid = H5Tcopy(cplx_hid); - } - -} // namespace HighFive - -#endif // H5DATATYPE_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Dataspace_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Dataspace_misc.hpp deleted file mode 100644 index d62789376fc06..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Dataspace_misc.hpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5DATASPACE_MISC_HPP -#define H5DATASPACE_MISC_HPP - -#include - -#include - -#include "../H5DataSpace.hpp" -#include "../H5Exception.hpp" - -#include "H5Utils.hpp" - -namespace HighFive { - - inline DataSpace::DataSpace(const std::vector& dims) : DataSpace(dims.begin(), dims.end()) {} - - template - inline DataSpace::DataSpace(const IT begin, const IT end) { - std::vector real_dims(begin, end); - - if ((_hid = H5Screate_simple(int(real_dims.size()), real_dims.data(), nullptr)) < 0) { - throw DataSpaceException("Impossible to create dataspace"); - } - } - - inline DataSpace::DataSpace(const std::vector& dims, const std::vector& maxdims) { - if (dims.size() != maxdims.size()) { - throw DataSpaceException("dims and maxdims must be the same length."); - } - - std::vector real_dims(dims.begin(), dims.end()); - std::vector real_maxdims(maxdims.begin(), maxdims.end()); - - // Replace unlimited flag with actual HDF one - std::replace(real_maxdims.begin(), real_maxdims.end(), static_cast(DataSpace::UNLIMITED), H5S_UNLIMITED); - - if ((_hid = H5Screate_simple(int(dims.size()), real_dims.data(), real_maxdims.data())) < 0) { - throw DataSpaceException("Impossible to create dataspace"); - } - } // namespace HighFive - - inline DataSpace::DataSpace(const size_t dim1) { - const hsize_t dims = hsize_t(dim1); - if ((_hid = H5Screate_simple(1, &dims, nullptr)) < 0) { - throw DataSpaceException("Unable to create dataspace"); - } - } - - inline DataSpace::DataSpace(DataSpace::DataspaceType dtype) { - H5S_class_t h5_dataspace_type; - switch (dtype) { - case DataSpace::datascape_scalar: - h5_dataspace_type = H5S_SCALAR; - break; - case DataSpace::datascape_null: - h5_dataspace_type = H5S_NULL; - break; - default: - throw DataSpaceException( - "Invalid dataspace type: should be " - "datascape_scalar or datascape_null"); - } - - if ((_hid = H5Screate(h5_dataspace_type)) < 0) { - throw DataSpaceException("Unable to create dataspace"); - } - } - - inline DataSpace::DataSpace() {} - - inline DataSpace DataSpace::clone() const { - DataSpace res; - if ((res._hid = H5Scopy(_hid)) < 0) { - throw DataSpaceException("Unable to copy dataspace"); - } - return res; - } - - inline size_t DataSpace::getNumberDimensions() const { - const int ndim = H5Sget_simple_extent_ndims(_hid); - if (ndim < 0) { - HDF5ErrMapper::ToException("Unable to get dataspace number of dimensions"); - } - return size_t(ndim); - } - - inline std::vector DataSpace::getDimensions() const { - std::vector dims(getNumberDimensions()); - if (!dims.empty()) { - if (H5Sget_simple_extent_dims(_hid, dims.data(), nullptr) < 0) { - HDF5ErrMapper::ToException("Unable to get dataspace dimensions"); - } - } - return details::to_vector_size_t(std::move(dims)); - } - - inline std::vector DataSpace::getMaxDimensions() const { - std::vector maxdims(getNumberDimensions()); - if (H5Sget_simple_extent_dims(_hid, nullptr, maxdims.data()) < 0) { - HDF5ErrMapper::ToException("Unable to get dataspace dimensions"); - } - - std::vector res(maxdims.begin(), maxdims.end()); - std::replace(maxdims.begin(), maxdims.end(), static_cast(H5S_UNLIMITED), DataSpace::UNLIMITED); - return res; - } - - template - inline DataSpace DataSpace::From(const ScalarValue& scalar) { - (void)scalar; -#if H5_USE_CXX11 - static_assert((std::is_arithmetic::value || std::is_enum::value || - std::is_same::value), - "Only the following types are supported by DataSpace::From: \n" - " signed_arithmetic_types = int | long | float | double \n" - " unsigned_arithmetic_types = unsigned signed_arithmetic_types \n" - " string_types = std::string \n" - " all_basic_types = string_types | unsigned_arithmetic_types | " - "signed_arithmetic_types \n " - " stl_container_types = std::vector " - " boost_container_types = " - "boost::numeric::ublas::matrix | " - "boost::multi_array \n" - " all_supported_types = all_basic_types | stl_container_types | " - "boost_container_types"); -#endif - return DataSpace(DataSpace::datascape_scalar); - } - - template - inline DataSpace DataSpace::From(const std::vector& container) { - return DataSpace(details::get_dim_vector(container)); - } - -#ifdef H5_USE_BOOST - template - inline DataSpace DataSpace::From(const boost::multi_array& container) { - std::vector dims(Dims); - for (std::size_t i = 0; i < Dims; ++i) { - dims[i] = container.shape()[i]; - } - return DataSpace(dims); - } - - template - inline DataSpace DataSpace::From(const boost::numeric::ublas::matrix& mat) { - std::vector dims(2); - dims[0] = mat.size1(); - dims[1] = mat.size2(); - return DataSpace(dims); - } - -#endif - - namespace details { - - /// dimension checks @internal - inline bool checkDimensions(const DataSpace& mem_space, size_t input_dims) { - size_t dataset_dims = mem_space.getNumberDimensions(); - if (input_dims == dataset_dims) - return true; - - const std::vector dims = mem_space.getDimensions(); - for (std::vector::const_reverse_iterator i = dims.rbegin(); i != --dims.rend() && *i == 1; ++i) - --dataset_dims; - - if (input_dims == dataset_dims) - return true; - - dataset_dims = dims.size(); - for (std::vector::const_iterator i = dims.begin(); i != --dims.end() && *i == 1; ++i) - --dataset_dims; - - if (input_dims == dataset_dims) - return true; - - // The final tests is for scalars - return input_dims == 0 && dataset_dims == 1 && dims[dims.size() - 1] == 1; - } - - } // namespace details -} // namespace HighFive - -#endif // H5DATASPACE_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Exception_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Exception_misc.hpp deleted file mode 100644 index 5a0119b488995..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Exception_misc.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5EXCEPTION_MISC_HPP -#define H5EXCEPTION_MISC_HPP - -#include "../H5Exception.hpp" - -#include -#include - -namespace HighFive { - - struct HDF5ErrMapper { - template - static inline herr_t stackWalk(unsigned n, const H5E_error2_t* err_desc, void* client_data) { - ExceptionType** e_iter = static_cast(client_data); - (void)n; - - char* major_err = H5Eget_major(err_desc->maj_num); - char* minor_err = H5Eget_minor(err_desc->min_num); - - std::string err_string("("); - err_string += major_err; - err_string += ") "; - err_string += minor_err; - - free(major_err); - free(minor_err); - - ExceptionType* e = new ExceptionType(err_string); - e->_err_major = err_desc->maj_num; - e->_err_minor = err_desc->min_num; - (*e_iter)->_next.reset(e); - *e_iter = e; - return 0; - } - - template - static inline void ToException(const std::string& prefix_msg) { - hid_t err_stack = H5Eget_current_stack(); - if (err_stack >= 0) { - ExceptionType e(""); - ExceptionType* e_iter = &e; - - H5Ewalk2(err_stack, H5E_WALK_UPWARD, &HDF5ErrMapper::stackWalk, &e_iter); - H5Eclear2(err_stack); - - const char* next_err_msg = (e.nextException() != nullptr) ? (e.nextException()->what()) : (""); - - e.setErrorMsg(prefix_msg + " " + next_err_msg); - throw e; - } - // throw generic error, unrecognized error - throw ExceptionType(prefix_msg + ": Unknown HDF5 error"); - } - }; -} // namespace HighFive - -#endif // H5OBJECT_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5FileDriver_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5FileDriver_misc.hpp deleted file mode 100644 index a9f0d84ca7d6d..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5FileDriver_misc.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c), 2017-2018, Adrien Devresse - * Juan Hernando - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5FILEDRIVER_MISC_HPP -#define H5FILEDRIVER_MISC_HPP - -#include "../H5FileDriver.hpp" - -#include - -#ifdef H5_HAVE_PARALLEL -#include -#endif - -namespace HighFive { - - namespace { - - template - class MPIOFileAccess { - public: - MPIOFileAccess(Comm comm, Info info) : _comm(comm), _info(info) {} - - void apply(const hid_t list) const { - if (H5Pset_fapl_mpio(list, _comm, _info) < 0) { - HDF5ErrMapper::ToException("Unable to setup MPIO Driver configuration"); - } - } - - private: - Comm _comm; - Info _info; - }; - - // depecrated, use Properties(Properties::FILE_ACCESS) instead - class DefaultFileDriver : public FileDriver {}; - } // namespace - - // file access property - inline FileDriver::FileDriver() : Properties(FILE_ACCESS) {} - - template - inline MPIOFileDriver::MPIOFileDriver(Comm comm, Info info) { - add(MPIOFileAccess(comm, info)); - } -} // namespace HighFive - -#endif // H5FILEDRIVER_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5File_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5File_misc.hpp deleted file mode 100644 index a825f4accf88c..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5File_misc.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5FILE_MISC_HPP -#define H5FILE_MISC_HPP - -#include -#include "../H5Exception.hpp" -#include "../H5File.hpp" -#include "../H5Utility.hpp" - -#include - -namespace HighFive { - - namespace { - - // libhdf5 uses a preprocessor trick on their oflags - // we can not declare them constant without a mapper - inline int convert_open_flag(int openFlags) { - int res_open = 0; - if (openFlags & File::ReadOnly) - res_open |= H5F_ACC_RDONLY; - if (openFlags & File::ReadWrite) - res_open |= H5F_ACC_RDWR; - if (openFlags & File::Create) - res_open |= H5F_ACC_CREAT; - if (openFlags & File::Truncate) - res_open |= H5F_ACC_TRUNC; - if (openFlags & File::Excl) - res_open |= H5F_ACC_EXCL; - return res_open; - } - } // namespace - - inline File::File(const std::string& filename, int openFlags, const Properties& fileAccessProps) - : _filename(filename) { - openFlags = convert_open_flag(openFlags); - - int createMode = openFlags & (H5F_ACC_TRUNC | H5F_ACC_EXCL); - int openMode = openFlags & (H5F_ACC_RDWR | H5F_ACC_RDONLY); - bool mustCreate = createMode > 0; - bool openOrCreate = (openFlags & H5F_ACC_CREAT) > 0; - - // open is default. It's skipped only if flags require creation - // If open fails it will try create() if H5F_ACC_CREAT is set - if (!mustCreate) { - // Silence open errors if create is allowed - std::unique_ptr silencer; - if (openOrCreate) - silencer.reset(new SilenceHDF5()); - - _hid = H5Fopen(_filename.c_str(), openMode, fileAccessProps.getId()); - - if (isValid()) - return; // Done - - if (openOrCreate) { - // Will attempt to create ensuring wont clobber any file - createMode = H5F_ACC_EXCL; - } else { - HDF5ErrMapper::ToException(std::string("Unable to open file " + _filename)); - } - } - - if ((_hid = H5Fcreate(_filename.c_str(), createMode, H5P_DEFAULT, fileAccessProps.getId())) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to create file " + _filename)); - } - } - - inline const std::string& File::getName() const { return _filename; } - - inline void File::flush() { - if (H5Fflush(_hid, H5F_SCOPE_GLOBAL) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to flush file " + _filename)); - } - } -} // namespace HighFive - -#endif // H5FILE_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Group_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Group_misc.hpp deleted file mode 100644 index d1fe06e132b61..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Group_misc.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ - -#include "../H5Group.hpp" - -#include - -namespace HighFive { - - inline Group::Group() {} - -} // namespace HighFive diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Iterables_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Iterables_misc.hpp deleted file mode 100644 index 71945a1155472..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Iterables_misc.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5ITERABLE_MISC_HPP -#define H5ITERABLE_MISC_HPP - -#include -#include -#include - -#include "../H5Exception.hpp" - -#include - -namespace HighFive { - - namespace details { - - // iterator for H5 iterate - - struct HighFiveIterateData { - inline HighFiveIterateData(std::vector& my_names) : names(my_names), err(nullptr) {} - - std::vector& names; - std::exception* err; - - inline void throwIfError() { - if (err) { - throw *err; - } - } - }; - - template - inline herr_t internal_high_five_iterate(hid_t id, const char* name, const InfoType* info, void* op_data) { - (void)id; - (void)info; - - HighFiveIterateData* data = static_cast(op_data); - try { - data->names.push_back(name); - return 0; - } catch (...) { - data->err = new ObjectException("Exception during H5Iterate, abort listing"); - } - return -1; - } - - } // namespace details -} // namespace HighFive - -#endif // H5ITERABLE_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits.hpp deleted file mode 100644 index b2ec4f7d09a06..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5NODE_TRAITS_HPP -#define H5NODE_TRAITS_HPP - -#include - -namespace HighFive { - - class Attribute; - class DataSet; - class Group; - class DataSpace; - class DataType; - - template - class NodeTraits { - public: - /// - /// \brief createDataSet Create a new dataset in the current file of - /// datatype type and of size space - /// \param dataset_name identifier of the dataset - /// \param space Associated DataSpace, see \ref DataSpace for more - /// informations - /// \param type Type of Data - /// \param createProps A property list with data set creation properties - /// \return DataSet Object - DataSet createDataSet(const std::string& dataset_name, - const DataSpace& space, - const DataType& type, - const DataSetCreateProps& createProps = DataSetCreateProps()); - - /// - /// \brief createDataSet create a new dataset in the current file with a - /// size specified by space - /// \param dataset_name identifier of the dataset - /// \param space Associated DataSpace, see \ref DataSpace for more - /// informations - /// \param createProps A property list with data set creation properties - /// \return DataSet Object - /// - /// - /// - template - DataSet createDataSet(const std::string& dataset_name, - const DataSpace& space, - const DataSetCreateProps& createProps = DataSetCreateProps()); - - /// - /// \brief get an existing dataset in the current file - /// \param dataset_name - /// \return return the named dataset, or throw exception if not found - /// - DataSet getDataSet(const std::string& dataset_name) const; - - /// - /// \brief create a new group with the name group_name - /// \param group_name - /// \return the group object - /// - Group createGroup(const std::string& group_name); - - /// - /// \brief open an existing group with the name group_name - /// \param group_name - /// \return the group object - /// - Group getGroup(const std::string& group_name) const; - - /// - /// \brief return the number of leaf objects of the node / group - /// \return number of leaf objects - size_t getNumberObjects() const; - - /// - /// \brief return the name of the object with the given index - /// \return the name of the object - std::string getObjectName(size_t index) const; - - /// - /// \brief list all leaf objects name of the node / group - /// \return number of leaf objects - std::vector listObjectNames() const; - - /// - /// \brief check a dataset or group exists in the current node / group - /// - /// \param dataset/group name to check - /// \return true if a dataset/group with the asssociated name exist, or - /// false - bool exist(const std::string& node_name) const; - - private: - typedef Derivate derivate_type; - }; -} // namespace HighFive - -#include "H5Node_traits_misc.hpp" - -#endif // H5NODE_TRAITS_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits_misc.hpp deleted file mode 100644 index 260ead562aa43..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Node_traits_misc.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5NODE_TRAITS_MISC_HPP -#define H5NODE_TRAITS_MISC_HPP - -#include "H5Iterables_misc.hpp" -#include "H5Node_traits.hpp" - -#include -#include - -#include "../H5Attribute.hpp" -#include "../H5DataSet.hpp" -#include "../H5DataSpace.hpp" -#include "../H5DataType.hpp" -#include "../H5Exception.hpp" -#include "../H5Group.hpp" - -#include -#include -#include -#include -#include -#include - -namespace HighFive { - - template - inline DataSet NodeTraits::createDataSet(const std::string& dataset_name, - const DataSpace& space, - const DataType& dtype, - const DataSetCreateProps& createProps) { - DataSet set; - if ((set._hid = H5Dcreate2(static_cast(this)->getId(), - dataset_name.c_str(), - dtype._hid, - space._hid, - H5P_DEFAULT, - createProps.getId(), - H5P_DEFAULT)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to create the dataset \"") + dataset_name + - "\":"); - } - return set; - } - - template - template - inline DataSet NodeTraits::createDataSet(const std::string& dataset_name, - const DataSpace& space, - const DataSetCreateProps& createProps) { - return createDataSet(dataset_name, space, AtomicType(), createProps); - } - - template - inline DataSet NodeTraits::getDataSet(const std::string& dataset_name) const { - DataSet set; - if ((set._hid = H5Dopen2(static_cast(this)->getId(), dataset_name.c_str(), H5P_DEFAULT)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to open the dataset \"") + dataset_name + "\":"); - } - return set; - } - - template - inline Group NodeTraits::createGroup(const std::string& group_name) { - Group group; - if ((group._hid = H5Gcreate2( - static_cast(this)->getId(), group_name.c_str(), H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to create the group \"") + group_name + "\":"); - } - return group; - } - - template - inline Group NodeTraits::getGroup(const std::string& group_name) const { - Group group; - if ((group._hid = H5Gopen2(static_cast(this)->getId(), group_name.c_str(), H5P_DEFAULT)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to open the group \"") + group_name + "\":"); - } - return group; - } - - template - inline size_t NodeTraits::getNumberObjects() const { - hsize_t res; - if (H5Gget_num_objs(static_cast(this)->getId(), &res) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to count objects in existing group or file")); - } - return res; - } - - template - inline std::string NodeTraits::getObjectName(size_t index) const { - const ssize_t maxLength = 1023; - char buffer[maxLength + 1]; - ssize_t length = H5Lget_name_by_idx(static_cast(this)->getId(), - ".", - H5_INDEX_NAME, - H5_ITER_INC, - index, - buffer, - maxLength, - H5P_DEFAULT); - if (length < 0) - HDF5ErrMapper::ToException("Error accessing object name"); - if (length <= maxLength) - return std::string(buffer, length); - std::vector bigBuffer(length + 1, 0); - H5Lget_name_by_idx(static_cast(this)->getId(), - ".", - H5_INDEX_NAME, - H5_ITER_INC, - index, - bigBuffer.data(), - length, - H5P_DEFAULT); - return std::string(bigBuffer.data(), length); - } - - template - inline std::vector NodeTraits::listObjectNames() const { - std::vector names; - details::HighFiveIterateData iterateData(names); - - size_t num_objs = getNumberObjects(); - names.reserve(num_objs); - - if (H5Literate(static_cast(this)->getId(), - H5_INDEX_NAME, - H5_ITER_INC, - NULL, - &details::internal_high_five_iterate, - static_cast(&iterateData)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to list objects in group")); - } - - return names; - } - - template - inline bool NodeTraits::exist(const std::string& node_name) const { - htri_t val = H5Lexists(static_cast(this)->getId(), node_name.c_str(), H5P_DEFAULT); - if (val < 0) { - HDF5ErrMapper::ToException(std::string("Invalid link for exist() ")); - } - - return (val > 0); - } - -} // namespace HighFive - -#endif // H5NODE_TRAITS_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Object_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Object_misc.hpp deleted file mode 100644 index f4c11b1a1f59c..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Object_misc.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5OBJECT_MISC_HPP -#define H5OBJECT_MISC_HPP - -#include "../H5Exception.hpp" -#include "../H5Object.hpp" - -#include - -namespace HighFive { - - inline Object::Object() : _hid(H5I_INVALID_HID) {} - - inline Object::Object(const Object& other) : _hid(other._hid) { - if (other.isValid() && H5Iinc_ref(_hid) < 0) { - throw ObjectException("Reference counter increase failure"); - } - } - - inline Object& Object::operator=(const Object& other) { - if (this != &other) { - if (_hid != H5I_INVALID_HID) - H5Idec_ref(_hid); - - _hid = other._hid; - if (other.isValid() && H5Iinc_ref(_hid) < 0) { - throw ObjectException("Reference counter increase failure"); - } - } - return *this; - } - - inline Object::~Object() { - if (isValid() && H5Idec_ref(_hid) < 0) { - std::cerr << "HighFive::~Object: reference counter decrease failure" << std::endl; - } - } - - inline bool Object::isValid() const { return (_hid != H5I_INVALID_HID) && (H5Iis_valid(_hid) != false); } - - inline hid_t Object::getId() const { return _hid; } -} // namespace HighFive - -#endif // H5OBJECT_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5PropertyList_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5PropertyList_misc.hpp deleted file mode 100644 index 87ed94e747ed7..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5PropertyList_misc.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c), 2017-2018, Adrien Devresse - * Juan Hernando - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5PROPERTY_LIST_MISC_HPP -#define H5PROPERTY_LIST_MISC_HPP - -#include - -#include "../H5PropertyList.hpp" - -namespace HighFive { - - inline Properties::Properties(Type type) : _type(type), _hid(H5P_DEFAULT) {} - -#ifdef H5_USE_CXX11 - inline Properties::Properties(Properties&& other) : _type(other._type), _hid(other._hid) { other._hid = H5P_DEFAULT; } - - inline Properties& Properties::operator=(Properties&& other) { - _type = other._type; - // This code handles self-assigment without ifs - const auto hid = other._hid; - other._hid = H5P_DEFAULT; - _hid = hid; - return *this; - } -#endif - - inline Properties::~Properties() { - // H5P_DEFAULT and H5I_INVALID_HID are not the same Ensuring that ~Object - if (_hid != H5P_DEFAULT) - H5Pclose(_hid); - } - - template - inline void Properties::add(const Property& property) { - if (_hid == H5P_DEFAULT) { - hid_t type; - // The HP5_XXX are macros with function calls - switch (_type) { - case FILE_ACCESS: { - type = H5P_FILE_ACCESS; - break; - } - case DATASET_CREATE: { - type = H5P_DATASET_CREATE; - break; - } - default: - HDF5ErrMapper::ToException(std::string("Unsupported property list type")); - } - if ((_hid = H5Pcreate(type)) < 0) { - HDF5ErrMapper::ToException(std::string("Unable to create property list")); - } - } - - property.apply(_hid); - } - - inline void Chunking::apply(const hid_t hid) const { - if (H5Pset_chunk(hid, _dims.size(), _dims.data()) < 0) { - HDF5ErrMapper::ToException("Error setting chunk property"); - } - } - - inline void Deflate::apply(const hid_t hid) const { - if (!H5Zfilter_avail(H5Z_FILTER_DEFLATE)) { - HDF5ErrMapper::ToException("Error setting deflate property"); - } - - if (H5Pset_deflate(hid, _level) < 0) { - HDF5ErrMapper::ToException("Error setting deflate property"); - } - } - - inline void Shuffle::apply(const hid_t hid) const { - if (!H5Zfilter_avail(H5Z_FILTER_SHUFFLE)) { - HDF5ErrMapper::ToException("Error setting shuffle property"); - } - - if (H5Pset_shuffle(hid) < 0) { - HDF5ErrMapper::ToException("Error setting shuffle property"); - } - } -} // namespace HighFive -#endif // H5PROPERTY_LIST_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Selection_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Selection_misc.hpp deleted file mode 100644 index 3b3fe88690697..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Selection_misc.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5SELECTION_MISC_HPP -#define H5SELECTION_MISC_HPP - -#include "../H5Selection.hpp" -#include "H5Slice_traits_misc.hpp" - -namespace HighFive { - - inline Selection::Selection(const DataSpace& memspace, const DataSpace& file_space, const DataSet& set) - : _mem_space(memspace), _file_space(file_space), _set(set) {} - - inline DataSpace Selection::getSpace() const { return _file_space; } - - inline DataSpace Selection::getMemSpace() const { return _mem_space; } - - inline DataSet& Selection::getDataset() { return _set; } - - inline const DataSet& Selection::getDataset() const { return _set; } -} // namespace HighFive - -#endif // H5SELECTION_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits.hpp deleted file mode 100644 index a6b39c06c9ce2..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5SLICE_TRAITS_HPP -#define H5SLICE_TRAITS_HPP - -#include -#include - -#include "H5Utils.hpp" - -namespace HighFive { - - class DataSet; - class Group; - class DataSpace; - class DataType; - class Selection; - - template - class SliceTraits; - - class ElementSet { - public: - explicit ElementSet(const std::vector& element_ids); - - private: - std::vector _ids; - - template - friend class SliceTraits; - }; - - template - class SliceTraits { - public: - /// - /// select a region in the current Slice/Dataset of 'count' points at - /// 'offset' separated by 'stride'. If strides are not provided they will - /// default to 1 in all dimensions. - /// vector offset and count have to be from the same dimension - /// - Selection select(const std::vector& offset, - const std::vector& count, - const std::vector& stride = std::vector()) const; - - /// - /// select a set of columns in the last dimension of this dataset. - /// The column indices must be smaller than the dimension size. - /// - Selection select(const std::vector& columns) const; - - /// - /// select a region in the current Slice/Dataset out of a list of elements - /// - Selection select(const ElementSet& elements) const; - - /// - /// Read the entire dataset into a buffer - /// An exception is raised is if the numbers of dimension of the buffer and - /// of the dataset are different - /// - /// The array type can be a N-pointer or a N-vector. For plain pointers - /// not dimensionality checking will be performed, it is the user's - /// reponsibility to ensure that the right amount of space has been - /// allocated. - template - void read(T& array) const; - - /// - /// Read the entire dataset into a raw buffer - /// - /// No dimensionality checks will be performed, it is the user's - /// reponsibility to ensure that the right amount of space has been - /// allocated. - template - void read(T* array) const; - - /// - /// Write the integrality N-dimension buffer to this dataset - /// An exception is raised is if the numbers of dimension of the buffer and - /// of the dataset are different - /// - /// The array type can be a N-pointer or a N-vector ( e.g int** integer two - /// dimensional array ) - template - void write(const T& buffer); - - /// - /// Write from a raw buffer into this dataset - /// - /// No dimensionality checks will be performed, it is the user's - /// reponsibility to ensure that the buffer holds the right amount of - /// elements. For n-dimensional matrices the buffer layout follows H5 - /// default conventions. - template - void write(const T* buffer); - - private: - typedef Derivate derivate_type; - }; -} // namespace HighFive - -#endif // H5SLICE_TRAITS_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits_misc.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits_misc.hpp deleted file mode 100644 index 57ff30ae16c8d..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Slice_traits_misc.hpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5SLICE_TRAITS_MISC_HPP -#define H5SLICE_TRAITS_MISC_HPP - -#include "H5Slice_traits.hpp" - -#include -#include -#include -#include -#include -#include - -#ifdef H5_USE_BOOST -#include -#include -#endif - -#include -#include - -#include "../H5DataSpace.hpp" -#include "../H5DataType.hpp" -#include "../H5Selection.hpp" - -#include "H5Converter_misc.hpp" - -namespace HighFive { - - namespace details { - - // map the correct reference to the dataset depending of the layout - // dataset -> itself - // subselection -> parent dataset - inline const DataSet& get_dataset(const Selection* ptr) { return ptr->getDataset(); } - - inline const DataSet& get_dataset(const DataSet* ptr) { return *ptr; } - - // map the correct memspace identifier depending of the layout - // dataset -> entire memspace - // selection -> resolve space id - inline hid_t get_memspace_id(const Selection* ptr) { return ptr->getMemSpace().getId(); } - - inline hid_t get_memspace_id(const DataSet* ptr) { - (void)ptr; - return H5S_ALL; - } - } // namespace details - - inline ElementSet::ElementSet(const std::vector& element_ids) : _ids(element_ids) {} - - template - inline Selection SliceTraits::select(const std::vector& offset, - const std::vector& count, - const std::vector& stride) const { - // hsize_t type convertion - // TODO : normalize hsize_t type in HighFive namespace - std::vector offset_local(offset.size()); - std::vector count_local(count.size()); - std::vector stride_local(stride.size()); - std::copy(offset.begin(), offset.end(), offset_local.begin()); - std::copy(count.begin(), count.end(), count_local.begin()); - std::copy(stride.begin(), stride.end(), stride_local.begin()); - - DataSpace space = static_cast(this)->getSpace().clone(); - if (H5Sselect_hyperslab(space.getId(), - H5S_SELECT_SET, - offset_local.data(), - stride.empty() ? nullptr : stride_local.data(), - count_local.data(), - nullptr) < 0) { - HDF5ErrMapper::ToException("Unable to select hyperslap"); - } - - return Selection(DataSpace(count), space, details::get_dataset(static_cast(this))); - } - - template - inline Selection SliceTraits::select(const std::vector& columns) const { - const DataSpace& space = static_cast(this)->getSpace(); - const DataSet& dataset = details::get_dataset(static_cast(this)); - std::vector dims = space.getDimensions(); - std::vector counts(dims.size()); - std::copy(dims.begin(), dims.end(), counts.begin()); - counts[dims.size() - 1] = 1; - std::vector offsets(dims.size(), 0); - - H5Sselect_none(space.getId()); - for (std::vector::const_iterator i = columns.begin(); i != columns.end(); ++i) { - offsets[offsets.size() - 1] = *i; - if (H5Sselect_hyperslab(space.getId(), H5S_SELECT_OR, offsets.data(), nullptr, counts.data(), nullptr) < 0) { - HDF5ErrMapper::ToException("Unable to select hyperslap"); - } - } - - dims[dims.size() - 1] = columns.size(); - return Selection(DataSpace(dims), space, dataset); - } - - template - inline Selection SliceTraits::select(const ElementSet& elements) const { - hsize_t* data = nullptr; - const std::size_t length = elements._ids.size(); - std::vector raw_elements; - - // optimised at compile time - // switch for data conversion on 32bits platforms - if (std::is_same::value) { - data = (hsize_t*)(&(elements._ids[0])); - } else { - raw_elements.resize(length); - std::copy(elements._ids.begin(), elements._ids.end(), raw_elements.begin()); - data = &(raw_elements[0]); - } - - DataSpace space = static_cast(this)->getSpace().clone(); - if (H5Sselect_elements(space.getId(), H5S_SELECT_SET, length, data) < 0) { - HDF5ErrMapper::ToException("Unable to select elements"); - } - - return Selection(DataSpace(length), space, details::get_dataset(static_cast(this))); - } - - template - template - inline void SliceTraits::read(T& array) const { - typedef typename std::remove_const::type type_no_const; - - type_no_const& nocv_array = const_cast(array); - - const size_t dim_array = details::array_dims::value; - DataSpace space = static_cast(this)->getSpace(); - DataSpace mem_space = static_cast(this)->getMemSpace(); - - if (!details::checkDimensions(mem_space, dim_array)) { - std::ostringstream ss; - ss << "Impossible to read DataSet of dimensions " << mem_space.getNumberDimensions() - << " into arrays of dimensions " << dim_array; - throw DataSpaceException(ss.str()); - } - - // Create mem datatype - const AtomicType::type> array_datatype; - - // Apply pre read convertions - details::data_converter converter(nocv_array, mem_space); - - if (H5Dread(details::get_dataset(static_cast(this)).getId(), - array_datatype.getId(), - details::get_memspace_id((static_cast(this))), - space.getId(), - H5P_DEFAULT, - static_cast(converter.transform_read(nocv_array))) < 0) { - HDF5ErrMapper::ToException("Error during HDF5 Read: "); - } - - // re-arrange results - converter.process_result(array); - } - - template - template - inline void SliceTraits::read(T* array) const { - DataSpace space = static_cast(this)->getSpace(); - DataSpace mem_space = static_cast(this)->getMemSpace(); - - // Create mem datatype - const AtomicType::type> array_datatype; - - if (H5Dread(details::get_dataset(static_cast(this)).getId(), - array_datatype.getId(), - details::get_memspace_id((static_cast(this))), - space.getId(), - H5P_DEFAULT, - static_cast(array)) < 0) { - HDF5ErrMapper::ToException("Error during HDF5 Read: "); - } - } - - template - template - inline void SliceTraits::write(const T& buffer) { - typedef typename std::remove_const::type type_no_const; - - type_no_const& nocv_buffer = const_cast(buffer); - - const size_t dim_buffer = details::array_dims::value; - DataSpace space = static_cast(this)->getSpace(); - DataSpace mem_space = static_cast(this)->getMemSpace(); - - if (!details::checkDimensions(mem_space, dim_buffer)) { - std::ostringstream ss; - ss << "Impossible to write buffer of dimensions " << dim_buffer << " into dataset of dimensions " - << mem_space.getNumberDimensions(); - throw DataSpaceException(ss.str()); - } - - const AtomicType::type> array_datatype; - - // Apply pre write convertions - details::data_converter converter(nocv_buffer, mem_space); - - if (H5Dwrite(details::get_dataset(static_cast(this)).getId(), - array_datatype.getId(), - details::get_memspace_id((static_cast(this))), - space.getId(), - H5P_DEFAULT, - static_cast(converter.transform_write(nocv_buffer))) < 0) { - HDF5ErrMapper::ToException("Error during HDF5 Write: "); - } - } - - template - template - inline void SliceTraits::write(const T* buffer) { - DataSpace space = static_cast(this)->getSpace(); - DataSpace mem_space = static_cast(this)->getMemSpace(); - - const AtomicType::type> array_datatype; - - if (H5Dwrite(details::get_dataset(static_cast(this)).getId(), - array_datatype.getId(), - details::get_memspace_id((static_cast(this))), - space.getId(), - H5P_DEFAULT, - static_cast(buffer)) < 0) { - HDF5ErrMapper::ToException("Error during HDF5 Write: "); - } - } -} // namespace HighFive - -#endif // H5SLICE_TRAITS_MISC_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Utils.hpp b/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Utils.hpp deleted file mode 100644 index b60e35521e541..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/include/highfive/bits/H5Utils.hpp +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#ifndef H5UTILS_HPP -#define H5UTILS_HPP - -// internal utilities functions -#include // __GLIBCXX__ -#include -#include -#include -#include -#include - -#ifdef H5_USE_BOOST -#include -#include -#endif - -#include - -#ifndef H5_USE_CXX11 -#if ___cplusplus >= 201103L -#define H5_USE_CXX11 1 -#else -#define H5_USE_CXX11 0 -#endif -#endif - -namespace HighFive { - - namespace details { - - // determine at compile time number of dimensions of in memory datasets - template - struct array_dims { - static const size_t value = 0; - }; - - template - struct array_dims > { - static const size_t value = 1 + array_dims::value; - }; - - template - struct array_dims { - static const size_t value = 1 + array_dims::value; - }; - - template - struct array_dims { - static const size_t value = 1 + array_dims::value; - }; - -#ifdef H5_USE_BOOST - template - struct array_dims > { - static const size_t value = Dims; - }; - - template - struct array_dims > { - static const size_t value = 2; - }; -#endif - - // determine recursively the size of each dimension of a N dimension vector - template - void get_dim_vector_rec(const T& vec, std::vector& dims) { - (void)dims; - (void)vec; - } - - template - void get_dim_vector_rec(const std::vector& vec, std::vector& dims) { - dims.push_back(vec.size()); - get_dim_vector_rec(vec[0], dims); - } - - template - std::vector get_dim_vector(const std::vector& vec) { - std::vector dims; - get_dim_vector_rec(vec, dims); - return dims; - } - - // determine at compile time recursively the basic type of the data - template - struct type_of_array { - typedef T type; - }; - - template - struct type_of_array > { - typedef typename type_of_array::type type; - }; - -#ifdef H5_USE_BOOST - template - struct type_of_array > { - typedef typename type_of_array::type type; - }; - - template - struct type_of_array > { - typedef typename type_of_array::type type; - }; -#endif - - template - struct type_of_array { - typedef typename type_of_array::type type; - }; - - template - struct type_of_array { - typedef typename type_of_array::type type; - }; - - // check if the type is a container ( only vector supported for now ) - template - struct is_container { - static const bool value = false; - }; - - template - struct is_container > { - static const bool value = true; - }; - - // check if the type is a basic C-Array - // check if the type is a container ( only vector supported for now ) - template - struct is_c_array { - static const bool value = false; - }; - - template - struct is_c_array { - static const bool value = true; - }; - - template - struct is_c_array { - static const bool value = true; - }; - - // convertor function for hsize_t -> size_t when hsize_t != size_t - template - inline std::vector to_vector_size_t(std::vector vec) { - static_assert(std::is_same::value == false, " hsize_t != size_t mandatory here"); - std::vector res(vec.size()); - std::copy(vec.begin(), vec.end(), res.begin()); - return res; - } - - // convertor function for hsize_t -> size_t when size_t == hsize_t - inline std::vector to_vector_size_t(std::vector vec) { return vec; } - - // shared ptr portability - // was used pre-C++11, kept for compatibility - namespace Mem { - using namespace std; - } // namespace Mem - - } // namespace details -} // namespace HighFive - -#endif // H5UTILS_HPP diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/CMakeLists.txt b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/CMakeLists.txt deleted file mode 100644 index a4180b66dcadc..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -include_directories(${PROJECT_SOURCE_DIR}/include ${HDF5_INCLUDE_DIRS}) - -FILE(GLOB headers_highfive "${PROJECT_SOURCE_DIR}/include/highfive/*.hpp") -FILE(GLOB headers_highfive_bits "${PROJECT_SOURCE_DIR}/include/highfive/bits/*.hpp") - - -function(compile_example exemple_source) - - get_filename_component(example_filename ${exemple_source} NAME) - string(REPLACE ".cpp" "_bin" example_name ${example_filename}) - - set(require_cpp11 FALSE) - - if(${example_filename} MATCHES ".*boost.*") - if(NOT USE_BOOST) - return() - endif() - endif() - - if(${example_filename} MATCHES ".*parallel_hdf5.*") - if(NOT HIGHFIVE_PARALLEL_HDF5) - return() - endif() - endif() - - if(require_cpp11) - if(NOT COMPILER_SUPPORTS_CXX11) - return() - endif() - endif() - - add_executable(${example_name} ${exemple_source} ${headers_highfive} ${headers_highfive_bits}) - target_link_libraries(${example_name} ${HDF5_C_LIBRARIES}) - if(HIGHFIVE_PARALLEL_HDF5) - target_link_libraries(${example_name} ${MPI_C_LIBRARIES}) - endif() - target_compile_options(${example_name} PUBLIC ${HIGHFIVE_CPP_STD_FLAG}) - -endfunction() - - -file(GLOB list_example "*.cpp") - -foreach(example_src ${list_example}) - compile_example(${example_src}) -endforeach() diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_multi_array_2D.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_multi_array_2D.cpp deleted file mode 100644 index 923e7e8c230cf..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_multi_array_2D.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include - -#undef H5_USE_BOOST -#define H5_USE_BOOST - -#include -#include - -using namespace HighFive; - -const std::string FILE_NAME("boost_multiarray_example.h5"); -const std::string DATASET_NAME("dset"); -const size_t size_x = 10; -const size_t size_y = 3; - -// Create a 2D dataset 10x3 of double with boost multi array -// and write it to a file -int main(void) { - try { - boost::multi_array my_array(boost::extents[size_x][size_y]); - - for (size_t i = 0; i < size_x; ++i) { - for (size_t j = 0; j < size_y; ++j) { - my_array[i][j] = double(j + i * size_y); - } - } - - // we create a new hdf5 file - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // let's create our dataset of the size of the boost::multi_array - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(my_array)); - - // we fill it - dataset.write(my_array); - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_ublas_double.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_ublas_double.cpp deleted file mode 100644 index ddf7ba04e641c..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/boost_ublas_double.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include - -#undef H5_USE_BOOST -#define H5_USE_BOOST - -#include -#include -#include - -using namespace HighFive; - -const std::string FILE_NAME("boost_ublas_double.h5"); -const std::string DATASET_NAME("dset"); - -const size_t size_x = 10; -const size_t size_y = 10; - -int main(void) { - try { - typedef typename boost::numeric::ublas::matrix Matrix; - - // create a 10x10 matrix - Matrix mat(size_x, size_y); - - // fill it - for (std::size_t i = 0; i < size_x; ++i) { - mat(i, i) = i; - } - - // Create a new HDF5 file - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // create a new dataset with the 10x10 Matrix dimension - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(mat)); - - // write it - dataset.write(mat); - - // now, let read it back - Matrix result; - dataset.read(result); - - // print what we read - std::cout << "Matrix result:\n" << result << std::endl; - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_attribute_string_integer.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_attribute_string_integer.cpp deleted file mode 100644 index b3ae9071770fc..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_attribute_string_integer.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include - -#include -#include -#include -#include - -using namespace HighFive; - -const std::string FILE_NAME("create_attribute.h5"); -const std::string DATASET_NAME("my_dataset"); - -const std::string ATTRIBUTE_NAME_NOTE("note"); -const std::string ATTRIBUTE_NAME_VERSION("version_string"); - -// create a dataset from a vector of string -// read it back and print it -int main(void) { - try { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // Create a dummy dataset of one single integer - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace(1), AtomicType()); - - // Now let's add a attribute on this dataset - // This attribute will be named "note" - // and have the following content - std::string string_list("very important Dataset !"); - - Attribute a = dataset.createAttribute(ATTRIBUTE_NAME_NOTE, DataSpace::From(string_list)); - a.write(string_list); - - // We also add a "version" attribute - // that will be an array 1x2 of integer - std::vector version; - version.push_back(1); - version.push_back(0); // version 1.0 - - Attribute v = dataset.createAttribute(ATTRIBUTE_NAME_VERSION, DataSpace::From(version)); - v.write(version); - - // Ok all attributes are now written - - // let's list the keys of all attributes now - std::vector all_attributes_keys = dataset.listAttributeNames(); - for (std::vector::const_iterator it = all_attributes_keys.begin(); it < all_attributes_keys.end(); - ++it) { - std::cout << "attribute: " << *it << std::endl; - } - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_dataset_double.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_dataset_double.cpp deleted file mode 100644 index ffbd514e93cea..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_dataset_double.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include - -#include -#include -#include - -const std::string FILE_NAME("create_dataset_example.h5"); -const std::string DATASET_NAME("dset"); - -// Create a dataset name "dset" of double 4x6 -// -int main(void) { - using namespace HighFive; - try { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // Define the size of our dataset: 2x6 - std::vector dims(2); - dims[0] = 2; - dims[1] = 6; - - // Create the dataset - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace(dims)); - - double data[2][6] = {{1.1, 2.2, 3.3, 4.4, 5.5, 6.6}, {11.11, 12.12, 13.13, 14.14, 15.15, 16.16}}; - - // write it - dataset.write(data); - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_extensible_dataset.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_extensible_dataset.cpp deleted file mode 100644 index 21baa8272e622..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/create_extensible_dataset.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include - -#include -#include -#include - -const std::string FILE_NAME("create_extensible_dataset_example.h5"); -const std::string DATASET_NAME("dset"); - -// Create a dataset name "dset" of double 4x6 -// -int main(void) { - using namespace HighFive; - try { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // Create a dataspace with initial shape and max shape - DataSpace dataspace = DataSpace({4, 5}, {17, DataSpace::UNLIMITED}); - - // Use chunking - DataSetCreateProps props; - props.add(Chunking(std::vector{2, 2})); - - // Create the dataset - DataSet dataset = file.createDataSet(DATASET_NAME, dataspace, AtomicType(), props); - - // Write into the initial part of the dataset - double t1[3][1] = {{2.0}, {2.0}, {4.0}}; - dataset.select({0, 0}, {3, 1}).write(t1); - - // Resize the dataset to a larger size - dataset.resize({4, 6}); - - // Write into the new part of the dataset - double t2[1][3] = {{4.0, 8.0, 6.0}}; - dataset.select({3, 3}, {1, 3}).write(t2); - - // now we read it back - std::vector> result; - dataset.read(result); - - // we print it out and see: - // 2 0 0 0 0 0 - // 2 0 0 0 0 0 - // 4 0 0 0 0 0 - // 0 0 0 4 8 6 - for (auto row : result) { - for (auto col : row) - std::cout << " " << col; - std::cout << std::endl; - } - - } catch (const Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/parallel_hdf5_write_dataset.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/parallel_hdf5_write_dataset.cpp deleted file mode 100644 index 0256f426f4ed0..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/parallel_hdf5_write_dataset.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include - -#include - -#include -#include -#include - -const std::string FILE_NAME("parallel_dataset_example.h5"); -const std::string DATASET_NAME("dset"); - -// -// simple example to write a dataset with Parallel HDF5 with MPI-IO -// -// The dataset is written from several MPI node in parallel -// -// -int main(int argc, char** argv) { - int mpi_rank, mpi_size; - - // initialize MPI - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - - using namespace HighFive; - try { - // open a new file with the MPI IO driver for parallel Read/Write - File file( - FILE_NAME, File::ReadWrite | File::Create | File::Truncate, MPIOFileDriver(MPI_COMM_WORLD, MPI_INFO_NULL)); - - // we define the size of our dataset to - // lines : total number of mpi_rank - // columns : 2 - std::vector dims(2); - dims[0] = std::size_t(mpi_size); - dims[1] = 2; - - // Create the dataset - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace(dims)); - - // Each node want to write its own rank two time in - // its associated row - int data[1][2] = {{mpi_rank, mpi_rank}}; - - // write it to the associated mpi_rank - dataset.select({std::size_t(mpi_rank), 0}, {1, 2}).write(data); - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - MPI_Abort(MPI_COMM_WORLD, 1); - } - - MPI_Finalize(); - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_dataset_string.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_dataset_string.cpp deleted file mode 100644 index 5346f6455a441..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_dataset_string.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include - -#include -#include -#include - -using namespace HighFive; - -const std::string FILE_NAME("create_dataset_string_example.h5"); -const std::string DATASET_NAME("story"); - -// create a dataset from a vector of string -// read it back and print it -int main(void) { - try { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - std::vector string_list; - string_list.push_back("Hello World !"); - string_list.push_back( - "This string list is mapped to a dataset of " - "variable length string"); - string_list.push_back("Encoding is done in UTF-8 - 你好 - Здравствуйте!"); - string_list.push_back("May the force be with you"); - string_list.push_back("Enjoy !"); - - // create a dataset ready to contains strings of the size of the vector - // string_list - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(string_list)); - - // let's write our vector of string - dataset.write(string_list); - - // now we read it back - std::vector result_string_list; - dataset.read(result_string_list); - - for (size_t i = 0; i < result_string_list.size(); ++i) { - std::cout << ":" << i << " " << result_string_list[i] << "\n"; - } - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_single_scalar.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_single_scalar.cpp deleted file mode 100644 index 2683a2224b4e1..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_single_scalar.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include - -#include -#include -#include - -const std::string FILE_NAME("read_write_scalar.h5"); -const std::string DATASET_NAME("single_scalar"); - -// Create a dataset name "single_scalar" -// which contains only the perfect integer number "42" -// -int main(void) { - using namespace HighFive; - try { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - int perfect_number = 42; - - // Create the dataset - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(perfect_number)); - - // write it - dataset.write(perfect_number); - - // flush everything - file.flush(); - - // let's read it back - int potentially_perfect_number; - - dataset.read(potentially_perfect_number); - - std::cout << "perfect number: " << potentially_perfect_number << std::endl; - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_vector_dataset.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_vector_dataset.cpp deleted file mode 100644 index 5a83bfab218be..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/read_write_vector_dataset.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include - -#include -#include -#include - -using namespace HighFive; - -const std::string FILE_NAME("dataset_integer.h5"); -const std::string DATASET_NAME("dset"); -const size_t size_dataset = 20; - -// create a dataset 1D from a vector of string -void write_dataset() { - // we create a new hdf5 file - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - std::vector data(size_dataset); - for (size_t i = 0; i < data.size(); ++i) { - data[i] = int(i); - } - - // let's create a dataset of native integer with the size of the vector - // 'data' - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(data)); - - // let's write our vector of int to the HDF5 dataset - dataset.write(data); -} - -// read our data back -void read_dataset() { - // we open the existing hdf5 file we created before - File file(FILE_NAME, File::ReadOnly); - - std::vector read_data; - - // we get the dataset - DataSet dataset = file.getDataSet(DATASET_NAME); - - // we convert the hdf5 dataset to a single dimension vector - dataset.read(read_data); - - for (size_t i = 0; i < read_data.size(); ++i) { - std::cout << read_data[i] << " "; - } - std::cout << "\n"; -} - -int main(void) { - try { - write_dataset(); - read_dataset(); - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_by_id_dataset_cpp11.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_by_id_dataset_cpp11.cpp deleted file mode 100644 index 2b9a1358b0707..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_by_id_dataset_cpp11.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include -#include - -#include -#include -#include - -const std::string FILE_NAME("select_partial_string.h5"); -const std::string DATASET_NAME("message"); - -// Create a dataset name "dset" of double 4x6 -// -int main(void) { - using namespace HighFive; - try { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - { - // We have a set of string - std::vector values = { - "Cat", - "Dog", - "Hello", - "Tree", - "World", - "Plane", - ", ", - "你好", - "Tea", - "Moon", - "صباح جميل", - "Spaceship", - }; - - // let's create a dataset - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(values)); - - // and write them - dataset.write(values); - } - - { - DataSet dataset = file.getDataSet(DATASET_NAME); - - // now let's read back by cherry pick our interesting string - std::vector result; - // we select only element N° 2 and 5 - dataset.select(ElementSet({2, 4, 6, 7, 6, 10})).read(result); - - // and display it - for (auto i : result) { - std::cout << i << " "; - } - std::cout << "\n"; - } - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_partial_dataset_cpp11.cpp b/GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_partial_dataset_cpp11.cpp deleted file mode 100644 index 60415bd84d314..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/src/examples/select_partial_dataset_cpp11.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ -#include -#include -#include -#include - -#include -#include -#include - -const std::string FILE_NAME("select_partial_example.h5"); -const std::string DATASET_NAME("dset"); - -// Create a dataset name "dset" of double 4x6 -// -int main(void) { - using namespace HighFive; - try { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // we have some example values in a 2D vector 2x5 - std::vector> values = {{1.0, 2.0, 4.0, 8.0, 16.0}, {32.0, 64.0, 128.0, 256.0, 512.0}}; - - // let's create a dataset of this size - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(values)); - // and write them - dataset.write(values); - - // now we read back 2x2 values after an offset of 0x2 - std::vector> result; - dataset.select({0, 2}, {2, 2}).read(result); - - // we print out 4 values - for (auto i : result) { - for (auto j : i) { - std::cout << " " << j; - } - std::cout << "\n"; - } - - } catch (Exception& err) { - // catch and print any HDF5 error - std::cerr << err.what() << std::endl; - } - - return 0; // successfully terminated -} diff --git a/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/CMakeLists.txt b/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/CMakeLists.txt deleted file mode 100644 index 0cadeec3d0458..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -if(NOT HIGHFIVE_UNIT_TESTS OR NOT USE_BOOST) - return() -endif() - -include_directories(${PROJECT_SOURCE_DIR}/include ${HDF5_INCLUDE_DIRS}) - -if(NOT MSVC) - # silent boost warnings - add_definitions(-Wno-unused-parameter -Wno-unused-local-typedef) -endif() - -if(NOT Boost_USE_STATIC_LIBS) - add_definitions(-DBOOST_TEST_DYN_LINK=TRUE) -endif() - -## base tests -file(GLOB tests_high_five_src "*base.cpp") - -add_executable(tests_high_five_cpp11_bin ${tests_high_five_src}) -target_link_libraries(tests_high_five_cpp11_bin -${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES} ${HDF5_C_LIBRARIES}) - -if(HIGHFIVE_PARALLEL_HDF5) - target_link_libraries(tests_high_five_cpp11_bin ${MPI_C_LIBRARIES}) -endif() - -target_compile_options(tests_high_five_cpp11_bin PRIVATE "${HIGHFIVE_CPP_STD_FLAG}") -target_compile_definitions(tests_high_five_cpp11_bin PRIVATE "-DHIGHFIVE_CPP11_ENABLE=1") - -add_test(NAME tests_high_five_cpp11 COMMAND tests_high_five_cpp11_bin) - - - -if(HIGHFIVE_PARALLEL_HDF5) - - include(TestHelpers) - - ## parallel MPI tests - file(GLOB tests_parallel_src "*parallel.cpp") - - add_executable(tests_parallel_bin ${tests_parallel_src}) - target_link_libraries(tests_parallel_bin - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES} ${HDF5_C_LIBRARIES} - ${MPI_C_LIBRARIES}) - add_test(NAME tests_parallel COMMAND ${TEST_MPI_EXEC_PREFIX_DEFAULT} -n 8 - ${CMAKE_CURRENT_BINARY_DIR}/tests_parallel_bin) - -endif() - diff --git a/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_base.cpp b/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_base.cpp deleted file mode 100644 index ffdded4394e34..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_base.cpp +++ /dev/null @@ -1,1112 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HIGHFIVE_CPP11_ENABLE -#include -#endif - -#include - -#include -#include -#include -#include -#include - -#define BOOST_TEST_MAIN HighFiveTest - -#include -#include - -#ifdef H5_USE_BOOST -#include -#endif - -using namespace HighFive; - -typedef boost::mpl::list floating_numerics_test_types; -typedef boost::mpl:: - list - numerical_test_types; -typedef boost::mpl::list - dataset_test_types; - -template -void generate2D(T* table, size_t x, size_t y, Func& func) { - for (size_t i = 0; i < x; i++) { - for (size_t j = 0; j < y; j++) { - table[i][j] = func(); - } - } -} - -template -void generate2D(std::vector>& vec, size_t x, size_t y, Func& func) { - vec.resize(x); - for (size_t i = 0; i < x; i++) { - vec[i].resize(y); - for (size_t j = 0; j < y; j++) { - vec[i][j] = func(); - } - } -} - -template -struct ContentGenerate { - explicit ContentGenerate(T init_val = T(0), T inc_val = T(1) + T(1) / T(10)) : _init(init_val), _inc(inc_val) {} - - T operator()() { - T ret = _init; - _init += _inc; - return ret; - } - - T _init, _inc; -}; - -template <> -struct ContentGenerate { - ContentGenerate() : _init('a') {} - - char operator()() { - char ret = _init; - if (++_init >= ('a' + 26)) - _init = 'a'; - return ret; - } - - char _init; -}; - -template <> -struct ContentGenerate { - ContentGenerate() {} - - std::string operator()() { - ContentGenerate gen; - std::string random_string; - std::mt19937_64 rgen; - rgen.seed(88); - std::uniform_int_distribution int_dist(0, 1000); - const size_t size_string = int_dist(rgen); - - random_string.resize(size_string); - std::generate(random_string.begin(), random_string.end(), gen); - return random_string; - } -}; - -BOOST_AUTO_TEST_CASE(HighFiveBasic) { - const std::string FILE_NAME("h5tutr_dset.h5"); - const std::string DATASET_NAME("dset"); - - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - BOOST_CHECK_EQUAL(file.getName(), FILE_NAME); - - // Create the data space for the dataset. - std::vector dims; - dims.push_back(4); - dims.push_back(6); - - DataSpace dataspace(dims); - - // check if the dataset exist - bool dataset_exist = file.exist(DATASET_NAME + "_double"); - BOOST_CHECK_EQUAL(dataset_exist, false); - - // Create a dataset with double precision floating points - DataSet dataset_double = file.createDataSet(DATASET_NAME + "_double", dataspace, AtomicType()); - - BOOST_CHECK_EQUAL(file.getObjectName(0), DATASET_NAME + "_double"); - - { - // check if it exist again - dataset_exist = file.exist(DATASET_NAME + "_double"); - BOOST_CHECK_EQUAL(dataset_exist, true); - - // and also try to recreate it to the sake of exception testing - BOOST_CHECK_THROW( - { DataSet fail_duplicated = file.createDataSet(DATASET_NAME + "_double", dataspace, AtomicType()); }, - DataSetException); - } - - DataSet dataset_size_t = file.createDataSet(DATASET_NAME + "_size_t", dataspace); -} - -BOOST_AUTO_TEST_CASE(HighFiveSilence) { - // Setting up a buffer for stderr so we can detect if the stack trace - // was disabled - fflush(stderr); - char buffer[1024]; - memset(buffer, 0, sizeof(char) * 1024); - setvbuf(stderr, buffer, _IOLBF, 1023); - - try { - SilenceHDF5 silence; - File file("nonexistent", File::ReadOnly); - } catch (const FileException&) { - } - BOOST_CHECK_EQUAL(buffer[0], '\0'); - - // restore the dyn allocated buffer - // or using stderr will segfault when buffer get out of scope - fflush(stderr); - setvbuf(stderr, NULL, _IONBF, 0); -} - -BOOST_AUTO_TEST_CASE(HighFiveOpenMode) { - const std::string FILE_NAME("openmodes.h5"); - const std::string DATASET_NAME("dset"); - - std::remove(FILE_NAME.c_str()); - - // Attempt open file only ReadWrite should fail (wont create) - BOOST_CHECK_THROW({ File file(FILE_NAME, File::ReadWrite); }, FileException); - - // But with Create flag should be fine - { File file(FILE_NAME, File::ReadWrite | File::Create); } - - // But if its there and exclusive is given, should fail - BOOST_CHECK_THROW({ File file(FILE_NAME, File::ReadWrite | File::Excl); }, FileException); - // ReadWrite and Excl flags are fine together (posix) - std::remove(FILE_NAME.c_str()); - { File file(FILE_NAME, File::ReadWrite | File::Excl); } - // All three are fine as well (as long as the file does not exist) - std::remove(FILE_NAME.c_str()); - { File file(FILE_NAME, File::ReadWrite | File::Create | File::Excl); } - - // Just a few combinations are incompatible, detected by hdf5lib - BOOST_CHECK_THROW({ File file(FILE_NAME, File::Truncate | File::Excl); }, FileException); - - std::remove(FILE_NAME.c_str()); - BOOST_CHECK_THROW({ File file(FILE_NAME, File::Truncate | File::Excl); }, FileException); - - // But in most cases we will truncate and that should always work - { File file(FILE_NAME, File::Truncate); } - std::remove(FILE_NAME.c_str()); - { File file(FILE_NAME, File::Truncate); } - - // Last but not least, defaults should be ok - { File file(FILE_NAME); } // ReadOnly - { File file(FILE_NAME, 0); } // force empty-flags, does open without flags -} - -BOOST_AUTO_TEST_CASE(HighFiveGroupAndDataSet) { - const std::string FILE_NAME("h5_group_test.h5"); - const std::string DATASET_NAME("dset"); - const std::string CHUNKED_DATASET_NAME("chunked_dset"); - const std::string CHUNKED_DATASET_SMALL_NAME("chunked_dset_small"); - const std::string GROUP_NAME1("/group1"); - const std::string GROUP_NAME2("group2"); - const std::string GROUP_NESTED_NAME("group_nested"); - - { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // absolute group - file.createGroup(GROUP_NAME1); - // nested group absolute - file.createGroup(GROUP_NAME1 + "/" + GROUP_NESTED_NAME); - // relative group - Group g1 = file.createGroup(GROUP_NAME2); - // relative group - Group nested = g1.createGroup(GROUP_NESTED_NAME); - - // Create the data space for the dataset. - std::vector dims; - dims.push_back(4); - dims.push_back(6); - - DataSpace dataspace(dims); - - DataSet dataset_absolute = - file.createDataSet(GROUP_NAME1 + "/" + GROUP_NESTED_NAME + "/" + DATASET_NAME, dataspace, AtomicType()); - - DataSet dataset_relative = nested.createDataSet(DATASET_NAME, dataspace, AtomicType()); - - DataSetCreateProps goodChunking; - goodChunking.add(Chunking(std::vector{2, 2})); - - // will fail because exceeds dimensions - DataSetCreateProps badChunking0; - badChunking0.add(Chunking(std::vector{10, 10})); - - DataSetCreateProps badChunking1; - badChunking1.add(Chunking(std::vector{1, 1, 1})); - - BOOST_CHECK_THROW(file.createDataSet(CHUNKED_DATASET_NAME, dataspace, AtomicType(), badChunking0), - DataSetException); - - BOOST_CHECK_THROW(file.createDataSet(CHUNKED_DATASET_NAME, dataspace, AtomicType(), badChunking1), - DataSetException); - - // here we use the other signature - DataSet dataset_chunked = file.createDataSet(CHUNKED_DATASET_NAME, dataspace, goodChunking); - - // Here we resize to smaller than the chunking size - DataSet dataset_chunked_small = file.createDataSet(CHUNKED_DATASET_SMALL_NAME, dataspace, goodChunking); - - dataset_chunked_small.resize({1, 1}); - } - // read it back - { - File file(FILE_NAME, File::ReadOnly); - Group g1 = file.getGroup(GROUP_NAME1); - Group g2 = file.getGroup(GROUP_NAME2); - Group nested_group2 = g2.getGroup(GROUP_NESTED_NAME); - - DataSet dataset_absolute = file.getDataSet(GROUP_NAME1 + "/" + GROUP_NESTED_NAME + "/" + DATASET_NAME); - BOOST_CHECK_EQUAL(4, dataset_absolute.getSpace().getDimensions()[0]); - - DataSet dataset_relative = nested_group2.getDataSet(DATASET_NAME); - BOOST_CHECK_EQUAL(4, dataset_relative.getSpace().getDimensions()[0]); - - DataSet dataset_chunked = file.getDataSet(CHUNKED_DATASET_NAME); - BOOST_CHECK_EQUAL(4, dataset_chunked.getSpace().getDimensions()[0]); - - DataSet dataset_chunked_small = file.getDataSet(CHUNKED_DATASET_SMALL_NAME); - BOOST_CHECK_EQUAL(1, dataset_chunked_small.getSpace().getDimensions()[0]); - } -} - -BOOST_AUTO_TEST_CASE(HighFiveExtensibleDataSet) { - const std::string FILE_NAME("create_extensible_dataset_example.h5"); - const std::string DATASET_NAME("dset"); - constexpr double t1[3][1] = {{2.0}, {2.0}, {4.0}}; - constexpr double t2[1][3] = {{4.0, 8.0, 6.0}}; - - { - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // Create a dataspace with initial shape and max shape - DataSpace dataspace = DataSpace({4, 5}, {17, DataSpace::UNLIMITED}); - - // Use chunking - DataSetCreateProps props; - props.add(Chunking(std::vector{2, 2})); - - // Create the dataset - DataSet dataset = file.createDataSet(DATASET_NAME, dataspace, AtomicType(), props); - - // Write into the initial part of the dataset - dataset.select({0, 0}, {3, 1}).write(t1); - - // Resize the dataset to a larger size - dataset.resize({4, 6}); - - BOOST_CHECK_EQUAL(4, dataset.getSpace().getDimensions()[0]); - BOOST_CHECK_EQUAL(6, dataset.getSpace().getDimensions()[1]); - - // Write into the new part of the dataset - dataset.select({3, 3}, {1, 3}).write(t2); - - // Try resize out of bounds - BOOST_CHECK_THROW(dataset.resize({18, 1}), DataSetException); - // Try resize invalid dimensions - BOOST_CHECK_THROW(dataset.resize({1, 2, 3}), DataSetException); - } - - // read it back - { - File file(FILE_NAME, File::ReadOnly); - - DataSet dataset_absolute = file.getDataSet("/" + DATASET_NAME); - const auto dims = dataset_absolute.getSpace().getDimensions(); - double values[4][6]; - dataset_absolute.read(values); - BOOST_CHECK_EQUAL(4, dims[0]); - BOOST_CHECK_EQUAL(6, dims[1]); - - BOOST_CHECK_EQUAL(t1[0][0], values[0][0]); - BOOST_CHECK_EQUAL(t1[1][0], values[1][0]); - BOOST_CHECK_EQUAL(t1[2][0], values[2][0]); - - BOOST_CHECK_EQUAL(t2[0][0], values[3][3]); - BOOST_CHECK_EQUAL(t2[0][1], values[3][4]); - BOOST_CHECK_EQUAL(t2[0][2], values[3][5]); - } -} - -#ifdef HIGHFIVE_CPP11_ENABLE -BOOST_AUTO_TEST_CASE(HighFiveRefCountMove) { - const std::string FILE_NAME("h5_ref_count_test.h5"); - const std::string DATASET_NAME("dset"); - const std::string GROUP_NAME1("/group1"); - const std::string GROUP_NAME2("/group2"); - - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - std::unique_ptr d1_ptr; - std::unique_ptr g_ptr; - - { - // create group - Group g1 = file.createGroup(GROUP_NAME1); - - // override object - g1 = file.createGroup(GROUP_NAME2); - - // Create the data space for the dataset. - std::vector dims = {10, 10}; - - DataSpace dataspace(dims); - - DataSet d1 = file.createDataSet(GROUP_NAME1 + DATASET_NAME, dataspace, AtomicType()); - - double values[10][10] = {0}; - values[5][0] = 1; - d1.write(values); - - // force move - d1_ptr.reset(new DataSet(std::move(d1))); - - // force copy - g_ptr.reset(new Group(g1)); - } - // read it back - { - DataSet d2(std::move(*d1_ptr)); - d1_ptr.reset(); - - double values[10][10]; - memset(values, 255, 10 * 10); - - d2.read(values); - - for (std::size_t i = 0; i < 10; ++i) { - for (std::size_t j = 0; j < 10; ++j) { - double v = values[i][j]; - - if (i == 5 && j == 0) { - BOOST_CHECK_EQUAL(v, 1); - } else { - BOOST_CHECK_EQUAL(v, 0); - } - } - } - - // force copy - Group g2 = *g_ptr; - - // add a subgroup - g2.createGroup("blabla"); - } -} - -#endif - -BOOST_AUTO_TEST_CASE(HighFiveSimpleListing) { - const std::string FILE_NAME("h5_list_test.h5"); - const std::string GROUP_NAME_CORE("group_name"); - const std::string GROUP_NESTED_NAME("/group_nested"); - - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - { - // absolute group - for (int i = 0; i < 2; ++i) { - std::ostringstream ss; - ss << "/" << GROUP_NAME_CORE << "_" << i; - file.createGroup(ss.str()); - } - - size_t n_elem = file.getNumberObjects(); - BOOST_CHECK_EQUAL(2, n_elem); - - std::vector elems = file.listObjectNames(); - BOOST_CHECK_EQUAL(2, elems.size()); - std::vector reference_elems; - for (int i = 0; i < 2; ++i) { - std::ostringstream ss; - ss << GROUP_NAME_CORE << "_" << i; - reference_elems.push_back(ss.str()); - } - - BOOST_CHECK_EQUAL_COLLECTIONS(elems.begin(), elems.end(), reference_elems.begin(), reference_elems.end()); - } - - { - file.createGroup(GROUP_NESTED_NAME); - Group g_nest = file.getGroup(GROUP_NESTED_NAME); - - for (int i = 0; i < 50; ++i) { - std::ostringstream ss; - ss << GROUP_NAME_CORE << "_" << i; - g_nest.createGroup(ss.str()); - } - - size_t n_elem = g_nest.getNumberObjects(); - BOOST_CHECK_EQUAL(50, n_elem); - - std::vector elems = g_nest.listObjectNames(); - BOOST_CHECK_EQUAL(50, elems.size()); - std::vector reference_elems; - - for (int i = 0; i < 50; ++i) { - std::ostringstream ss; - ss << GROUP_NAME_CORE << "_" << i; - reference_elems.push_back(ss.str()); - } - // there is no guarantee on the order of the hdf5 index, let's sort it - // to put them in order - std::sort(elems.begin(), elems.end()); - std::sort(reference_elems.begin(), reference_elems.end()); - - BOOST_CHECK_EQUAL_COLLECTIONS(elems.begin(), elems.end(), reference_elems.begin(), reference_elems.end()); - } -} - -BOOST_AUTO_TEST_CASE(DataTypeEqualSimple) { - using namespace HighFive; - - AtomicType d_var; - AtomicType size_var; - AtomicType d_var_test; - AtomicType size_var_cpy(size_var); - AtomicType int_var; - AtomicType uint_var; - - // check different type matching - BOOST_CHECK(d_var == d_var_test); - BOOST_CHECK(d_var != size_var); - - // check type copy matching - BOOST_CHECK(size_var_cpy == size_var); - - // check sign change not matching - BOOST_CHECK(int_var != uint_var); -} - -BOOST_AUTO_TEST_CASE(DataTypeEqualTakeBack) { - using namespace HighFive; - - const std::string FILE_NAME("h5tutr_dset.h5"); - const std::string DATASET_NAME("dset"); - - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // Create the data space for the dataset. - std::vector dims; - dims.push_back(10); - dims.push_back(1); - - DataSpace dataspace(dims); - - // Create a dataset with double precision floating points - DataSet dataset = file.createDataSet(DATASET_NAME + "_double", dataspace); - - AtomicType s; - AtomicType d; - - BOOST_CHECK(s == dataset.getDataType()); - BOOST_CHECK(d != dataset.getDataType()); -} - -BOOST_AUTO_TEST_CASE(DataSpaceTest) { - using namespace HighFive; - - const std::string FILE_NAME("h5tutr_space.h5"); - const std::string DATASET_NAME("dset"); - - // Create a new file using the default property lists. - File file(FILE_NAME, File::ReadWrite | File::Create | File::Truncate); - - // Create the data space for the dataset. - std::vector dims; - dims.push_back(10); - dims.push_back(1); - - DataSpace dataspace(dims); - - // Create a dataset with size_t type - DataSet dataset = file.createDataSet(DATASET_NAME, dataspace); - - DataSpace space = dataset.getSpace(); - DataSpace space2 = dataset.getSpace(); - - // verify space id are different - BOOST_CHECK_NE(space.getId(), space2.getId()); - - // verify space id are consistent - BOOST_CHECK_EQUAL(space.getDimensions().size(), 2); - BOOST_CHECK_EQUAL(space.getDimensions()[0], 10); - BOOST_CHECK_EQUAL(space.getDimensions()[1], 1); -} - -template -void readWrite2DArrayTest() { - std::ostringstream filename; - filename << "h5_rw_2d_array_" << typeid(T).name() << "_test.h5"; - const std::string DATASET_NAME("dset"); - const size_t x_size = 100; - const size_t y_size = 10; - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - // Create the data space for the dataset. - std::vector dims; - dims.push_back(x_size); - dims.push_back(y_size); - - DataSpace dataspace(dims); - - // Create a dataset with arbitrary type - DataSet dataset = file.createDataSet(DATASET_NAME, dataspace); - - T array[x_size][y_size]; - - ContentGenerate generator; - generate2D(array, x_size, y_size, generator); - - dataset.write(array); - - T result[x_size][y_size]; - - dataset.read(result); - - for (size_t i = 0; i < x_size; ++i) { - for (size_t j = 0; j < y_size; ++j) { - BOOST_CHECK_EQUAL(result[i][j], array[i][j]); - } - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(ReadWrite2DArray, T, numerical_test_types) { readWrite2DArrayTest(); } - -template -void readWriteVectorTest() { - using namespace HighFive; - - std::ostringstream filename; - filename << "h5_rw_vec_" << typeid(T).name() << "_test.h5"; - - std::srand((unsigned int)std::time(0)); - const size_t x_size = 800; - const std::string DATASET_NAME("dset"); - typename std::vector vec; - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - // Create a dataset with double precision floating points - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(vec)); - - dataset.write(vec); - - typename std::vector result; - - dataset.read(result); - - BOOST_CHECK_EQUAL(vec.size(), x_size); - BOOST_CHECK_EQUAL(result.size(), x_size); - - for (size_t i = 0; i < x_size; ++i) { - // std::cout << result[i] << " " << vec[i] << " "; - BOOST_CHECK_EQUAL(result[i], vec[i]); - } -} - -template -void readWriteAttributeVectorTest() { - using namespace HighFive; - - std::ostringstream filename; - filename << "h5_rw_attribute_vec_" << typeid(T).name() << "_test.h5"; - - std::srand((unsigned int)std::time(0)); - const size_t x_size = 25; - const std::string DATASET_NAME("dset"); - typename std::vector vec; - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - vec.resize(x_size); - ContentGenerate generator; - - std::generate(vec.begin(), vec.end(), generator); - - { - // Create a dummy group to annotate with an attribute - Group g = file.createGroup("dummy_group"); - - // check that no attributes are there - std::size_t n = g.getNumberAttributes(); - BOOST_CHECK_EQUAL(n, 0); - - std::vector all_attribute_names = g.listAttributeNames(); - BOOST_CHECK_EQUAL(all_attribute_names.size(), 0); - - bool has_attribute = g.hasAttribute("my_attribute"); - BOOST_CHECK_EQUAL(has_attribute, false); - - Attribute a1 = g.createAttribute("my_attribute", DataSpace::From(vec)); - a1.write(vec); - - // check now that we effectively have an attribute listable - std::size_t n2 = g.getNumberAttributes(); - BOOST_CHECK_EQUAL(n2, 1); - - has_attribute = g.hasAttribute("my_attribute"); - BOOST_CHECK_EQUAL(has_attribute, true); - - all_attribute_names = g.listAttributeNames(); - BOOST_CHECK_EQUAL(all_attribute_names.size(), 1); - BOOST_CHECK_EQUAL(all_attribute_names[0], std::string("my_attribute")); - - // Create the same attribute on a newly created dataset - DataSet s = g.createDataSet("dummy_dataset", DataSpace(1), AtomicType()); - - Attribute a2 = s.createAttribute("my_attribute_copy", DataSpace::From(vec)); - a2.write(vec); - } - - typename std::vector result1, result2; - - { - Attribute a1_read = file.getGroup("dummy_group").getAttribute("my_attribute"); - a1_read.read(result1); - - BOOST_CHECK_EQUAL(vec.size(), x_size); - BOOST_CHECK_EQUAL(result1.size(), x_size); - - for (size_t i = 0; i < x_size; ++i) { - // std::cout << result[i] << " " << vec[i] << " "; - BOOST_CHECK_EQUAL(result1[i], vec[i]); - } - - Attribute a2_read = file.getDataSet("/dummy_group/dummy_dataset").getAttribute("my_attribute_copy"); - a2_read.read(result2); - - BOOST_CHECK_EQUAL(vec.size(), x_size); - BOOST_CHECK_EQUAL(result2.size(), x_size); - - for (size_t i = 0; i < x_size; ++i) { - // std::cout << result[i] << " " << vec[i] << " "; - BOOST_CHECK_EQUAL(result2[i], vec[i]); - } - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(ReadWriteAttributeVector, T, dataset_test_types) { readWriteAttributeVectorTest(); } - -template -void readWriteVector2DTest() { - using namespace HighFive; - - std::ostringstream filename; - filename << "h5_rw_vec_2d_" << typeid(T).name() << "_test.h5"; - - const size_t x_size = 10; - const size_t y_size = 10; - const std::string DATASET_NAME("dset"); - typename std::vector> vec; - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - vec.resize(x_size); - ContentGenerate generator; - - generate2D(vec, x_size, y_size, generator); - - // Create a dataset with double precision floating points - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(vec)); - - dataset.write(vec); - - typename std::vector> result; - - dataset.read(result); - - BOOST_CHECK_EQUAL(vec.size(), x_size); - BOOST_CHECK_EQUAL(result.size(), x_size); - - BOOST_CHECK_EQUAL(vec[0].size(), y_size); - BOOST_CHECK_EQUAL(result[0].size(), y_size); - - for (size_t i = 0; i < x_size; ++i) { - for (size_t j = 0; i < y_size; ++i) { - BOOST_CHECK_EQUAL(result[i][j], vec[i][j]); - } - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(readWriteVector2D, T, numerical_test_types) { readWriteVector2DTest(); } - -BOOST_AUTO_TEST_CASE(datasetOffset) { - std::string filename = "datasetOffset.h5"; - std::string dsetname = "dset"; - const size_t size_dataset = 20; - - File file(filename, File::ReadWrite | File::Create | File::Truncate); - std::vector data(size_dataset); - DataSet ds = file.createDataSet(dsetname, DataSpace::From(data)); - ds.write(data); - DataSet ds_read = file.getDataSet(dsetname); - BOOST_CHECK(ds_read.getOffset() > 0); -} - -#ifdef H5_USE_BOOST - -template -void MultiArray3DTest() { - typedef typename boost::multi_array MultiArray; - - std::ostringstream filename; - filename << "h5_rw_multiarray_" << typeid(T).name() << "_test.h5"; - - const size_t size_x = 10, size_y = 10, size_z = 10; - const std::string DATASET_NAME("dset"); - MultiArray array(boost::extents[size_x][size_y][size_z]); - - ContentGenerate generator; - std::generate(array.data(), array.data() + array.num_elements(), generator); - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(array)); - - dataset.write(array); - - // read it back - MultiArray result; - - dataset.read(result); - - for (size_t i = 0; i < size_x; ++i) { - for (size_t j = 0; j < size_y; ++j) { - for (size_t k = 0; k < size_z; ++k) { - // std::cout << array[i][j][k] << " "; - BOOST_CHECK_EQUAL(array[i][j][k], result[i][j][k]); - } - } - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(MultiArray3D, T, numerical_test_types) { MultiArray3DTest(); } - -template -void ublas_matrix_Test() { - typedef typename boost::numeric::ublas::matrix Matrix; - - std::ostringstream filename; - filename << "h5_rw_multiarray_" << typeid(T).name() << "_test.h5"; - - const size_t size_x = 10, size_y = 10; - const std::string DATASET_NAME("dset"); - - Matrix mat(size_x, size_y); - - ContentGenerate generator; - for (std::size_t i = 0; i < mat.size1(); ++i) { - for (std::size_t j = 0; j < mat.size2(); ++j) { - mat(i, j) = generator(); - } - } - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(mat)); - - dataset.write(mat); - - // read it back - Matrix result; - - dataset.read(result); - - for (size_t i = 0; i < size_x; ++i) { - for (size_t j = 0; j < size_y; ++j) { - // std::cout << array[i][j][k] << " "; - BOOST_CHECK_EQUAL(mat(i, j), result(i, j)); - } - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(ublas_matrix, T, numerical_test_types) { ublas_matrix_Test(); } - -#endif - -template -void selectionArraySimpleTest() { - typedef typename std::vector Vector; - - std::ostringstream filename; - filename << "h5_rw_select_test_" << typeid(T).name() << "_test.h5"; - - const size_t size_x = 10; - const size_t offset_x = 2, count_x = 5; - - const std::string DATASET_NAME("dset"); - - Vector values(size_x); - - ContentGenerate generator; - std::generate(values.begin(), values.end(), generator); - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(values)); - - dataset.write(values); - - file.flush(); - - // select slice - { - // read it back - Vector result; - std::vector offset; - offset.push_back(offset_x); - std::vector size; - size.push_back(count_x); - - Selection slice = dataset.select(offset, size); - - BOOST_CHECK_EQUAL(slice.getSpace().getDimensions()[0], size_x); - BOOST_CHECK_EQUAL(slice.getMemSpace().getDimensions()[0], count_x); - - slice.read(result); - - BOOST_CHECK_EQUAL(result.size(), 5); - - for (size_t i = 0; i < count_x; ++i) { - BOOST_CHECK_EQUAL(values[i + offset_x], result[i]); - } - } - - // select cherry pick - { - // read it back - Vector result; - std::vector ids; - ids.push_back(1); - ids.push_back(3); - ids.push_back(4); - ids.push_back(7); - - Selection slice = dataset.select(ElementSet(ids)); - - BOOST_CHECK_EQUAL(slice.getSpace().getDimensions()[0], size_x); - BOOST_CHECK_EQUAL(slice.getMemSpace().getDimensions()[0], ids.size()); - - slice.read(result); - - BOOST_CHECK_EQUAL(result.size(), ids.size()); - - for (size_t i = 0; i < ids.size(); ++i) { - const std::size_t id = ids[i]; - BOOST_CHECK_EQUAL(values[id], result[i]); - } - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(selectionArraySimple, T, dataset_test_types) { selectionArraySimpleTest(); } - -template -void columnSelectionTest() { - std::ostringstream filename; - filename << "h5_rw_select_column_test_" << typeid(T).name() << "_test.h5"; - - const size_t x_size = 10; - const size_t y_size = 7; - - const std::string DATASET_NAME("dset"); - - T values[x_size][y_size]; - - ContentGenerate generator; - generate2D(values, x_size, y_size, generator); - - // Create a new file using the default property lists. - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - // Create the data space for the dataset. - std::vector dims; - dims.push_back(x_size); - dims.push_back(y_size); - - DataSpace dataspace(dims); - // Create a dataset with arbitrary type - DataSet dataset = file.createDataSet(DATASET_NAME, dataspace); - - dataset.write(values); - - file.flush(); - - std::vector columns; - columns.push_back(1); - columns.push_back(3); - columns.push_back(5); - - Selection slice = dataset.select(columns); - T result[x_size][3]; - slice.read(result); - - BOOST_CHECK_EQUAL(slice.getSpace().getDimensions()[0], x_size); - BOOST_CHECK_EQUAL(slice.getMemSpace().getDimensions()[0], x_size); - - for (size_t i = 0; i < 3; ++i) - for (size_t j = 0; j < x_size; ++j) - BOOST_CHECK_EQUAL(result[j][i], values[j][columns[i]]); -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(columnSelection, T, numerical_test_types) { columnSelectionTest(); } - -template -void attribute_scalar_rw() { - std::ostringstream filename; - filename << "h5_rw_attribute_scalar_rw" << typeid(T).name() << "_test.h5"; - - File h5file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - ContentGenerate generator; - - const T attribute_value(generator()); - - Group g = h5file.createGroup("metadata"); - - bool family_exist = g.hasAttribute("family"); - BOOST_CHECK_EQUAL(family_exist, false); - - // write a scalar attribute - { - T out(attribute_value); - Attribute att = g.createAttribute("family", DataSpace::From(out)); - att.write(out); - } - - h5file.flush(); - - // test if attribute exist - family_exist = g.hasAttribute("family"); - BOOST_CHECK_EQUAL(family_exist, true); - - // read back a scalar attribute - { - T res; - Attribute att = g.getAttribute("family"); - att.read(res); - BOOST_CHECK_EQUAL(res, attribute_value); - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(attribute_scalar_rw_all, T, dataset_test_types) { attribute_scalar_rw(); } - -// regression test https://github.com/BlueBrain/HighFive/issues/98 -BOOST_AUTO_TEST_CASE(HighFiveOutofDimension) { - std::string filename("h5_rw_reg_zero_dim_test.h5"); - - const std::string DATASET_NAME("dset"); - - { - // Create a new file using the default property lists. - File file(filename, File::ReadWrite | File::Create | File::Truncate); - - DataSpace d_null(DataSpace::DataspaceType::datascape_null); - - DataSet d1 = file.createDataSet(DATASET_NAME, d_null); - - file.flush(); - - DataSpace recovered_d1 = d1.getSpace(); - - auto ndim = recovered_d1.getNumberDimensions(); - BOOST_CHECK_EQUAL(ndim, 0); - - auto dims = recovered_d1.getDimensions(); - BOOST_CHECK_EQUAL(dims.size(), 0); - } -} - -template -void readWriteShuffleDeflateTest() { - std::ostringstream filename; - filename << "h5_rw_deflate_" << typeid(T).name() << "_test.h5"; - const std::string DATASET_NAME("dset"); - const size_t x_size = 128; - const size_t y_size = 32; - const size_t x_chunk = 16; - const size_t y_chunk = 16; - - const int deflate_level = 9; - - T array[x_size][y_size]; - - // write a compressed file - { - File file(filename.str(), File::ReadWrite | File::Create | File::Truncate); - - // Create the data space for the dataset. - std::vector dims; - dims.push_back(x_size); - dims.push_back(y_size); - - DataSpace dataspace(dims); - - // Use chunking - DataSetCreateProps props; - props.add(Chunking(std::vector{x_chunk, y_chunk})); - - // Enable shuffle - props.add(Shuffle()); - - // Enable deflate - props.add(Deflate(deflate_level)); - - // Create a dataset with arbitrary type - DataSet dataset = file.createDataSet(DATASET_NAME, dataspace, props); - - ContentGenerate generator; - generate2D(array, x_size, y_size, generator); - - dataset.write(array); - - file.flush(); - } - - // read it back - { - File file_read(filename.str(), File::ReadOnly); - DataSet dataset_read = file_read.getDataSet("/" + DATASET_NAME); - - T result[x_size][y_size]; - - dataset_read.read(result); - - for (size_t i = 0; i < x_size; ++i) { - for (size_t j = 0; i < y_size; ++i) { - BOOST_CHECK_EQUAL(result[i][j], array[i][j]); - } - } - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(ReadWriteShuffleDeflate, T, numerical_test_types) { readWriteShuffleDeflateTest(); } diff --git a/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_parallel.cpp b/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_parallel.cpp deleted file mode 100644 index 00a36fe843eb3..0000000000000 --- a/GeneratorInterface/LHEInterface/src/HighFive/tests/unit/tests_high_five_parallel.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c), 2017, Adrien Devresse - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define BOOST_TEST_MAIN HighFiveTest -#include -#include - -using namespace HighFive; - -int argc = boost::unit_test::framework::master_test_suite().argc; -char** argv = boost::unit_test::framework::master_test_suite().argv; - -struct MpiFixture { - MpiFixture() { MPI_Init(&argc, &argv); } - - ~MpiFixture() { MPI_Finalize(); } -}; - -BOOST_GLOBAL_FIXTURE(MpiFixture); - -typedef boost::mpl:: - list - numerical_test_types; - -template -struct ContentGenerate { - ContentGenerate(T init_val = T(0), T inc_val = T(1) + T(1) / T(10)) : _init(init_val), _inc(inc_val) {} - - T operator()() { - T ret = _init; - _init += _inc; - return ret; - } - - T _init, _inc; -}; - -template <> -struct ContentGenerate { - ContentGenerate() : _init('a') {} - - char operator()() { - char ret = _init; - if (++_init >= ('a' + 26)) - _init = 'a'; - return ret; - } - - char _init; -}; - -template <> -struct ContentGenerate { - ContentGenerate() {} - - std::string operator()() { - ContentGenerate gen; - std::string random_string; - const size_t size_string = std::rand() % 1000; - random_string.resize(size_string); - std::generate(random_string.begin(), random_string.end(), gen); - return random_string; - } -}; - -template -void selectionArraySimpleTestParallel() { - int mpi_rank, mpi_size; - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - - typedef typename std::vector Vector; - - std::ostringstream filename; - filename << "h5_rw_select_parallel_test_" << typeid(T).name() << "_test.h5"; - - const size_t size_x = mpi_size; - const size_t offset_x = mpi_rank, count_x = mpi_size - mpi_rank; - - const std::string DATASET_NAME("dset"); - - Vector values(size_x); - - ContentGenerate generator; - std::generate(values.begin(), values.end(), generator); - - // Create a new file using the default property lists. - File file( - filename.str(), File::ReadWrite | File::Create | File::Truncate, MPIOFileDriver(MPI_COMM_WORLD, MPI_INFO_NULL)); - - DataSet dataset = file.createDataSet(DATASET_NAME, DataSpace::From(values)); - - dataset.write(values); - - file.flush(); - - // read it back - Vector result; - std::vector offset; - offset.push_back(offset_x); - std::vector size; - size.push_back(count_x); - - Selection slice = dataset.select(offset, size); - - BOOST_CHECK_EQUAL(slice.getSpace().getDimensions()[0], size_x); - BOOST_CHECK_EQUAL(slice.getMemSpace().getDimensions()[0], count_x); - - slice.read(result); - - BOOST_CHECK_EQUAL(result.size(), count_x); - - for (size_t i = offset_x; i < count_x; ++i) { - // std::cout << result[i] << " "; - BOOST_CHECK_EQUAL(values[i + offset_x], result[i]); - } -} - -BOOST_AUTO_TEST_CASE_TEMPLATE(selectionArraySimple, T, numerical_test_types) { selectionArraySimpleTestParallel(); } diff --git a/GeneratorInterface/LHEInterface/src/LH5Reader.cc b/GeneratorInterface/LHEInterface/src/LH5Reader.cc index 2ae36fe78eca6..35dc435b16cff 100644 --- a/GeneratorInterface/LHEInterface/src/LH5Reader.cc +++ b/GeneratorInterface/LHEInterface/src/LH5Reader.cc @@ -65,15 +65,14 @@ namespace lhef { ~StringSource() override {} }; - H5Handler::H5Handler(const std::string &fileNameIn) : - h5file( new HighFive::File(fileNameIn) ), - indexStatus( h5file->exist("/index") ), - _index( h5file->getGroup( indexStatus ? "index" : "event") ), - _particle( h5file->getGroup("particle") ), - _event( h5file->getGroup("event") ), - _init( h5file->getGroup("init") ), - _procInfo( h5file->getGroup("procInfo") ) - { + H5Handler::H5Handler(const std::string &fileNameIn) + : h5file(new HighFive::File(fileNameIn)), + indexStatus(h5file->exist("/index")), + _index(h5file->getGroup(indexStatus ? "index" : "event")), + _particle(h5file->getGroup("particle")), + _event(h5file->getGroup("event")), + _init(h5file->getGroup("init")), + _procInfo(h5file->getGroup("procInfo")) { hid_t dspace; _formatType = 1; @@ -82,6 +81,7 @@ namespace lhef { _formatType = 2; } else { _index = h5file->getGroup("event"); + dspace = H5Dget_space(h5file->getDataSet("event/start").getId()); _formatType = 1; }