2022-09-03 08:31:29 +08:00
cmake_minimum_required ( VERSION 3.18 )
2018-04-20 23:11:55 +08:00
project ( HDF5 C )
2010-05-14 00:01:50 +08:00
2020-01-29 03:14:59 +08:00
if ( POLICY CMP0074 )
2022-06-09 21:35:33 +08:00
# find_package() uses <PackageName>_ROOT variables.
2020-01-29 03:14:59 +08:00
cmake_policy ( SET CMP0074 NEW )
endif ( )
2019-09-06 05:54:24 +08:00
2020-02-22 06:16:06 +08:00
if ( POLICY CMP0083 )
2022-06-09 21:35:33 +08:00
# To control generation of Position Independent Executable (PIE) or not,
# some flags are required at link time.
2020-02-22 06:16:06 +08:00
cmake_policy ( SET CMP0083 NEW )
endif ( )
2022-09-15 04:44:24 +08:00
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if ( CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0" )
cmake_policy ( SET CMP0135 NEW )
endif ( )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Instructions for use : Normal Build
#
# For standard build of HDF5 libraries,tests and tools.
# Run cmake using the HDF5 source tree to generate a build tree.
# Enable/Disable options according to requirements and
# set CMAKE_INSTALL_PREFIX to the required install path.
# Make install can be used to install all components for system-wide use.
#
2019-02-16 05:48:24 +08:00
if ( CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR )
2020-01-29 03:14:59 +08:00
message ( FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
2015-04-23 23:41:22 +08:00
" C M A K E _ C U R R E N T _ S O U R C E _ D I R = $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } "
" = = C M A K E _ C U R R E N T _ B I N A R Y _ D I R = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } \ n "
" N E X T S T E P S : \ n "
" ( 1 ) D e l e t e t h e C M a k e C a c h e . t x t f i l e a n d t h e C M a k e F i l e s / d i r e c t o r y \ n "
" u n d e r t h e s o u r c e d i r e c t o r y f o r $ { P R O J E C T _ N A M E } , o t h e r w i s e y o u \ n "
" w i l l n o t b e a b l e t o c o n f i g u r e $ { P R O J E C T _ N A M E } c o r r e c t l y ! \ n "
" * F o r e x a m p l e , o n l i n u x m a c h i n e s d o : \ n "
" $ r m - r C M a k e C a c h e . t x t C M a k e F i l e s / \ n "
" ( 2 ) C r e a t e a d i f f e r e n t d i r e c t o r y a n d c o n f i g u r e $ { P R O J E C T _ N A M E } i n t h a t d i r e c t o r y . \ n "
" * F o r e x a m p l e , o n l i n u x m a c h i n e s d o : \ n "
" $ m k d i r M Y _ B U I L D \ n "
" $ c d M Y _ B U I L D \ n "
" $ c m a k e [ O P T I O N S ] . . \ n "
)
endif ( )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Instructions for use : Sub-Project Build
#
# To include HDF5 as a sub-project within another project.
# Set HDF5_EXTERNALLY_CONFIGURED to 1 in the parent project and
# supply values for the following variables...
#
# HDF5_EXPORTED_TARGETS :
# Set this to the name of the targets variable which controls exports
# If unset (because parent project does not support/use the
2014-03-12 05:14:57 +08:00
# install (EXPORT target...) syntax), then targets are not configured
2010-05-14 00:01:50 +08:00
# for export during install.
#
# HDF5_LIB_DEPENDENCIES :
# If the build of HDF5 libs is being customized, then rules for the
# dependencies of the HDF5 libs may be 'incomplete', add additional
# dependencies to this variable so that external projects pick them up
#
2018-09-25 03:38:46 +08:00
#option (HDF5_EXTERNAL_LIB_PREFIX "Use prefix for custom library naming." "")
set ( HDF5_EXTERNAL_LIB_PREFIX "" CACHE STRING "Use prefix for custom library naming." )
mark_as_advanced ( HDF5_EXTERNAL_LIB_PREFIX )
2010-05-14 00:01:50 +08:00
# HDF5_EXTERNAL_LIB_PREFIX :
2015-05-15 00:51:20 +08:00
# If the parent project needs to install hdf libraries, but avoid
2010-05-14 00:01:50 +08:00
# name conflicts with system versions, then a prefix may be added
# to ensure that the correct versions configured are used.
2021-03-26 07:11:32 +08:00
set ( HDF5_LIB_INFIX "" CACHE STRING "Use infix for custom library naming." )
mark_as_advanced ( HDF5_LIB_INFIX )
# HDF5_LIB_INFIX :
# This infix is added to all library names after 'hdf5'.
# e.g. the infix '_openmpi' results in the library name 'libhdf5_openmpi.so'
# This name is used in packages on debian based systems.
# (see https://packages.debian.org/jessie/amd64/libhdf5-openmpi-8/filelist)
2010-05-14 00:01:50 +08:00
#
2010-12-09 04:55:25 +08:00
# HDF5_INSTALL_BIN_DIR, HDF5_INSTALL_LIB_DIR, HDF5_INSTALL_INCLUDE_DIR, HDF5_INSTALL_DATA_DIR :
# Customize the 'bin', 'lib', 'include', and 'share' installation directories.
2010-08-20 23:37:50 +08:00
#
# HDF5_INSTALL_NO_DEVELOPMENT :
# Set to true to skip installation of headers and CMake package files.
#
2010-05-14 00:01:50 +08:00
# Consider this example from the ParaView project, it builds its own zlib
# library and tells HDF5 to add it as a dependency - this ensures that
# any project making use of this build of HDF5 will use the correct zlib
#
# # Tell hdf5 that we are manually overriding certain settings
2014-03-12 05:14:57 +08:00
# set (HDF5_EXTERNALLY_CONFIGURED 1)
2010-05-14 00:01:50 +08:00
# # Avoid duplicating names of installed libraries
2014-03-12 05:14:57 +08:00
# set (HDF5_EXTERNAL_LIB_PREFIX "vtk")
2010-05-14 00:01:50 +08:00
# # Export configuration to this export variable
2014-03-12 05:14:57 +08:00
# set (HDF5_EXPORTED_TARGETS "paraview-targets")
2010-05-14 00:01:50 +08:00
#
# # Setup all necessary overrides for zlib so that HDF5 uses our
# # internally compiled zlib rather than any other version
2014-03-19 00:21:46 +08:00
# if (HDF5_ENABLE_Z_LIB_SUPPORT)
2015-05-15 00:51:20 +08:00
# # We must tell the main HDF5 library that it depends on our zlib
# set (HDF5_LIB_DEPENDENCIES vtkzlib)
2010-05-14 00:01:50 +08:00
# # Override the zlib header file
2014-03-19 00:21:46 +08:00
# if (VTK_USE_SYSTEM_ZLIB)
2014-03-12 05:14:57 +08:00
# set (H5_ZLIB_HEADER "zlib.h")
2017-01-11 07:09:53 +08:00
# else ()
2014-03-12 05:14:57 +08:00
# set (H5_ZLIB_HEADER "vtk_zlib.h")
2010-05-14 00:01:50 +08:00
# # Set vars that FindZlib would have set if used in sub project
2014-03-12 05:14:57 +08:00
# set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}")
# set (ZLIB_LIBRARIES vtkzlib)
2017-01-11 07:09:53 +08:00
# endif ()
# endif ()
2015-05-15 00:51:20 +08:00
#
2010-05-14 00:01:50 +08:00
# # Add the sub project
2014-03-19 00:21:46 +08:00
# add_subdirectory (Utilities/hdf5-1.8)
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
2020-01-29 03:14:59 +08:00
string ( TIMESTAMP CONFIG_DATE "%Y-%m-%d" )
2011-10-26 00:52:58 +08:00
#-----------------------------------------------------------------------------
# Allow Visual Studio solution directories
#-----------------------------------------------------------------------------
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
# organization feature. Default to ON for non-Express users. Express users must
# explicitly turn off this option to build HDF5 in the Express IDE...
#
2014-03-12 05:14:57 +08:00
option ( HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON )
2014-03-19 00:21:46 +08:00
mark_as_advanced ( HDF5_USE_FOLDERS )
2014-03-12 05:14:57 +08:00
if ( HDF5_USE_FOLDERS )
set_property ( GLOBAL PROPERTY USE_FOLDERS ON )
2017-01-11 07:09:53 +08:00
endif ( )
2014-03-12 05:14:57 +08:00
option ( HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF )
2014-03-19 00:21:46 +08:00
mark_as_advanced ( HDF5_NO_PACKAGES )
2015-08-27 00:48:42 +08:00
option ( ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF )
mark_as_advanced ( ALLOW_UNSUPPORTED )
2011-10-26 00:52:58 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Set the core names of all the libraries
#-----------------------------------------------------------------------------
2021-03-26 07:11:32 +08:00
set ( HDF5_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}" )
set ( HDF5_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test" )
set ( HDF5_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_cpp" )
set ( HDF5_HL_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl" )
set ( HDF5_HL_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_cpp" )
set ( HDF5_TOOLS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_tools" )
set ( HDF5_UTILS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_utils" )
set ( HDF5_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_fortran" )
set ( HDF5_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_f90cstub" )
set ( HDF5_F90_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_fortran" )
set ( HDF5_F90_C_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_f90cstub" )
set ( HDF5_HL_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_fortran" )
set ( HDF5_HL_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_f90cstub" )
set ( HDF5_JAVA_JNI_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_java" )
2016-02-29 10:43:00 +08:00
set ( HDF5_JAVA_HDF5_LIB_CORENAME "jarhdf5" )
set ( HDF5_JAVA_TEST_LIB_CORENAME "jartest5" )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Set the true names of all the libraries if customized by external project
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
set ( HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}" )
set ( HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}" )
set ( HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}" )
set ( HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}" )
set ( HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}" )
set ( HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}" )
2020-03-14 06:13:17 +08:00
set ( HDF5_UTILS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_UTILS_LIB_CORENAME}" )
2014-03-12 05:14:57 +08:00
set ( HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}" )
set ( HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}" )
set ( HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}" )
set ( HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}" )
set ( HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}" )
set ( HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}" )
2016-02-29 10:43:00 +08:00
set ( HDF5_JAVA_JNI_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_JNI_LIB_CORENAME}" )
set ( HDF5_JAVA_HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_HDF5_LIB_CORENAME}" )
set ( HDF5_JAVA_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_TEST_LIB_CORENAME}" )
2010-05-14 00:01:50 +08:00
2010-07-21 22:00:47 +08:00
#-----------------------------------------------------------------------------
# Set the target names of all the libraries
#-----------------------------------------------------------------------------
2015-08-06 05:01:07 +08:00
set ( HDF5_LIB_TARGET "${HDF5_LIB_CORENAME}-static" )
set ( HDF5_TEST_LIB_TARGET "${HDF5_TEST_LIB_CORENAME}-static" )
set ( HDF5_CPP_LIB_TARGET "${HDF5_CPP_LIB_CORENAME}-static" )
set ( HDF5_HL_LIB_TARGET "${HDF5_HL_LIB_CORENAME}-static" )
set ( HDF5_HL_CPP_LIB_TARGET "${HDF5_HL_CPP_LIB_CORENAME}-static" )
set ( HDF5_TOOLS_LIB_TARGET "${HDF5_TOOLS_LIB_CORENAME}-static" )
2020-03-14 06:13:17 +08:00
set ( HDF5_UTILS_LIB_TARGET "${HDF5_UTILS_LIB_CORENAME}-static" )
2015-08-06 05:01:07 +08:00
set ( HDF5_F90_LIB_TARGET "${HDF5_F90_LIB_CORENAME}-static" )
set ( HDF5_F90_C_LIB_TARGET "${HDF5_F90_C_LIB_CORENAME}-static" )
set ( HDF5_F90_TEST_LIB_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-static" )
set ( HDF5_F90_C_TEST_LIB_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-static" )
set ( HDF5_HL_F90_LIB_TARGET "${HDF5_HL_F90_LIB_CORENAME}-static" )
set ( HDF5_HL_F90_C_LIB_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-static" )
2016-02-29 10:43:00 +08:00
set ( HDF5_JAVA_JNI_LIB_TARGET "${HDF5_JAVA_JNI_LIB_CORENAME}" )
set ( HDF5_JAVA_HDF5_LIB_TARGET "${HDF5_JAVA_HDF5_LIB_CORENAME}" )
set ( HDF5_JAVA_TEST_LIB_TARGET "${HDF5_JAVA_TEST_LIB_CORENAME}" )
2015-08-06 05:01:07 +08:00
set ( HDF5_LIBSH_TARGET "${HDF5_LIB_CORENAME}-shared" )
set ( HDF5_TEST_LIBSH_TARGET "${HDF5_TEST_LIB_CORENAME}-shared" )
set ( HDF5_CPP_LIBSH_TARGET "${HDF5_CPP_LIB_CORENAME}-shared" )
set ( HDF5_HL_LIBSH_TARGET "${HDF5_HL_LIB_CORENAME}-shared" )
set ( HDF5_HL_CPP_LIBSH_TARGET "${HDF5_HL_CPP_LIB_CORENAME}-shared" )
set ( HDF5_TOOLS_LIBSH_TARGET "${HDF5_TOOLS_LIB_CORENAME}-shared" )
2020-03-14 06:13:17 +08:00
set ( HDF5_UTILS_LIBSH_TARGET "${HDF5_UTILS_LIB_CORENAME}-shared" )
2015-08-06 05:01:07 +08:00
set ( HDF5_F90_LIBSH_TARGET "${HDF5_F90_LIB_CORENAME}-shared" )
set ( HDF5_F90_C_LIBSH_TARGET "${HDF5_F90_C_LIB_CORENAME}-shared" )
set ( HDF5_F90_TEST_LIBSH_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-shared" )
set ( HDF5_F90_C_TEST_LIBSH_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-shared" )
set ( HDF5_HL_F90_LIBSH_TARGET "${HDF5_HL_F90_LIB_CORENAME}-shared" )
set ( HDF5_HL_F90_C_LIBSH_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-shared" )
2010-07-21 22:00:47 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Define some CMake variables for use later in the project
#-----------------------------------------------------------------------------
2021-01-13 22:29:15 +08:00
set ( HDF_CONFIG_DIR ${ HDF5_SOURCE_DIR } /config )
2014-05-15 03:50:28 +08:00
set ( HDF_RESOURCES_DIR ${ HDF5_SOURCE_DIR } /config/cmake )
2014-03-12 05:14:57 +08:00
set ( HDF5_SRC_DIR ${ HDF5_SOURCE_DIR } /src )
set ( HDF5_TEST_SRC_DIR ${ HDF5_SOURCE_DIR } /test )
set ( HDF5_CPP_SRC_DIR ${ HDF5_SOURCE_DIR } /c++ )
set ( HDF5_CPP_TST_DIR ${ HDF5_SOURCE_DIR } /c++/test )
set ( HDF5_HL_SRC_DIR ${ HDF5_SOURCE_DIR } /hl )
set ( HDF5_HL_CPP_SRC_DIR ${ HDF5_SOURCE_DIR } /hl/c++ )
2016-05-04 23:06:05 +08:00
set ( HDF5_HL_TOOLS_DIR ${ HDF5_SOURCE_DIR } /hl/tools )
set ( HDF5_TOOLS_DIR ${ HDF5_SOURCE_DIR } /tools )
2016-10-27 23:12:39 +08:00
set ( HDF5_TOOLS_SRC_DIR ${ HDF5_SOURCE_DIR } /tools/src )
set ( HDF5_PERFORM_SRC_DIR ${ HDF5_SOURCE_DIR } /tools/src/perform )
2020-03-14 06:13:17 +08:00
set ( HDF5_UTILS_DIR ${ HDF5_SOURCE_DIR } /utils )
2014-03-12 05:14:57 +08:00
set ( HDF5_F90_SRC_DIR ${ HDF5_SOURCE_DIR } /fortran )
2016-02-29 10:43:00 +08:00
set ( HDF5_JAVA_JNI_SRC_DIR ${ HDF5_SOURCE_DIR } /java/src/jni )
set ( HDF5_JAVA_HDF5_SRC_DIR ${ HDF5_SOURCE_DIR } /java/src/hdf )
set ( HDF5_JAVA_TEST_SRC_DIR ${ HDF5_SOURCE_DIR } /java/test )
set ( HDF5_JAVA_LIB_DIR ${ HDF5_SOURCE_DIR } /java/lib )
2022-01-18 21:44:11 +08:00
set ( HDF5_JAVA_LOGGING_JAR ${ HDF5_SOURCE_DIR } /java/lib/slf4j-api-1.7.33.jar )
set ( HDF5_JAVA_LOGGING_NOP_JAR ${ HDF5_SOURCE_DIR } /java/lib/ext/slf4j-nop-1.7.33.jar )
set ( HDF5_JAVA_LOGGING_SIMPLE_JAR ${ HDF5_SOURCE_DIR } /java/lib/ext/slf4j-simple-1.7.33.jar )
2020-11-04 00:42:09 +08:00
set ( HDF5_DOXYGEN_DIR ${ HDF5_SOURCE_DIR } /doxygen )
2016-02-29 10:43:00 +08:00
Subfiling VFD (#1883)
* Added support for vector I/O calls to the VFD layer, and
associated test code. Note that this includes the optimization
to allow shortened sizes and types arrays to allow more space
efficient representations of vectors in which all entries are
of the same size and/or type. See the Selection I/o RFC for
further details.
Tested serial and parallel, debug and production on Charis.
serial and parallel debug only on Jelly.
* ran code formatter
quick serial build and test on jelly
* Add H5FD_read_selection() and H5FD_write_selection(). Currently only
translate to scalar calls. Fix const buf in H5FD_write_vector().
* Format source
* Fix comments
* Add selection I/O to chunk code, used when: not using chunk cache, no
datatype conversion, no I/O filters, no page buffer, not using collective
I/O. Requires global variable H5_use_selection_io_g be set to TRUE.
Implemented selection to vector I/O transaltion at the file driver
layer.
* Fix formatting unrelated to previous change to stop github from
complaining.
* Add full API support for selection I/O. Add tests for this.
* Implement selection I/O for contiguous datasets. Fix bug in selection
I/O translation. Add const qualifiers to some internal selection I/O
routines to maintain const-correctness while avoiding memcpys.
* Added vector read / write support to the MPIO VFD, with associated
test code (see testpar/t_vfd.c).
Note that this implementation does NOT support vector entries of
size greater than 2 GB. This must be repaired before release,
but it should be good enough for correctness testing.
As MPIO requires vector I/O requests to be sorted in increasing
address order, also added a vector sort utility in H5FDint.c This
function is tested in passing by the MPIO vector I/O extension.
In passing, repaired a bug in size / type vector extension management
in H5FD_read/write_vector()
Tested parallel debug and production on charis and Jelly.
* Ran source code formatter
* Add support for independent parallel I/O with selection I/O. Add
HDF5_USE_SELECTION_IO env var to control selection I/O (default off).
* Implement parallel collective support for selection I/O.
* Fix comments and run formatter.
* Update selection IO branch with develop (#1215)
Merged branch 'develop' into selection_io
* Sync with develop (#1262)
Updated the branch with develop changes.
* Implement big I/O support for vector I/O requests in the MPIO file
driver.
* Free arrays in H5FD__mpio_read/write_vector() as soon as they're not
needed, to cut down on memory usage during I/O.
* Address comments from code review. Fix const warnings with
H5S_SEL_ITER_INIT().
* Committing clang-format changes
* Feature/subfiling (#1464)
* Initial checkin of merged sub-filing VFD.
Passes regression tests (debug/shared/paralle) on Jelly.
However, bugs and many compiler warnings remain -- not suitable
for merge to develop.
* Minor mods to src/H5FDsubfile_mpi.c to address errors reported by autogen.sh
* Code formatting run -- no test
* Merged my subfiling code fixes into the new selection_io_branch
* Forgot to add the FindMERCURY.cmake file. This will probably disappear soon
* attempting to make a more reliable subfile file open which doesn't return errors. For some unknown reason, the regular posix open will occasionally fail to create a subfile. Some better error handling for file close has been added.
* added NULL option for H5FD_subfiling_config_t in H5Pset_fapl_subfiling (#1034)
* NULL option automatically stacks IOC VFD for subfiling and returns a valid fapl.
* added doxygen subfiling APIs
* Various fixes which allow the IOR benchmark to run correctly
* Lots of updates including the packaging up of the mercury_util source files to enable easier builds for our Benchmarking
* Interim checkin of selection_io_with_subfiling_vfd branch
Moddified testpar/t_vfd.c to test the subfiling vfd with default configuration.
Must update this code to run with a variety of configurations -- most particularly
multiple IO concentrators, and stripe depth small enough to test the other IO
concentrators.
testpar/t_vfd.c exposed a large number of race condidtions -- symtoms included:
1) Crashes (usually seg faults)
2) Heap corruption
3) Stack corruption
4) Double frees of heap space
5) Hangs
6) Out of order execution of I/O requests / violations of POSIX semantics
7) Swapped write requests
Items 1 - 4 turned out to be primarily caused by file close issues --
specifically, the main I/O concentrator thread and its pool of worker threads
were not being shut down properly on file close. Addressing this issue in
combination with some other minor fixes seems to have addressed these issues.
Items 5 & 6 appear to have been caused by issue of I/O requests to the
thread pool in an order that did not maintain POSIX semantics. A rewrite of
the I/O request dispatch code appears to have solved these issues.
Item 7 seems to have been caused by multiple write requests from a given
rank being read by the wrong worker thread. Code to issue "unique" tags for
each write request via the ACK message appears to have cleaned this up.
Note that the code is still in poor condtition. A partial list of known
defects includes:
a) Race condiditon on file close that allows superblock writes to arrive
at the I/O concentrator after it has been shutdown. This defect is
most evident when testpar/t_subfiling_vfd is run with 8 ranks.
b) No error reporting from I/O concentrators -- must design and implement
this. For now, mostly just asserts, which suggests that it should be
run in debug mode.
c) Much commented out and/or un-used code.
d) Code orgnaization
e) Build system with bits of Mercury is awkward -- think of shifting
to pthreads with our own thread pool code.
f) Need to add native support for vector and selection I/O to the subfiling
VFD.
g) Need to review, and posibly rework configuration code.
h) Need to store subfile configuration data in a superblock extension message,
and add code to use this data on file open.
i) Test code is inadequate -- expect more issues as it is extended.
In particular, there is no unit test code for the I/O request dispatch code.
While I think it is correct at present, we need test code to verify this.
Similarly, we need to test with multiple I/O concentrators and much smaller
stripe depth.
My actual code changes were limited to:
src/H5FDioc.c
src/H5FDioc_threads.c
src/H5FDsubfile_int.c
src/H5FDsubfile_mpi.c
src/H5FDsubfiling.c
src/H5FDsubfiling.h
src/H5FDsubfiling_priv.h
testpar/t_subfiling_vfd.c
testpar/t_vfd.c
I'm not sure what is going on with the deletions in src/mercury/src/util.
Tested parallel/debug on Charis and Jelly
* subfiling with selection IO (#1219)
Merged branch 'selection_io' into subfiling branch.
* Subfile name fixes (#1250)
* fixed subfiling naming convention, and added leading zero to rank names.
* Merge branch 'selection_io' into selection_io_with_subfiling_vfd (#1265)
* Added script to join subfiles into a single HDF5 file (#1350)
* Modified H5FD__subfiling_query() to report that the sub-filing VFD supports MPI
This exposed issues with truncate and get EOF in the sub-filing VFD.
I believe I have addressed these issues (get EOF not as fully tested as it should be), howeer,
it exposed race conditions resulting in hangs. As of this writing, I have not been able
to chase these down.
Note that the tests that expose these race conditions are in testpar/t_subfiling_vfd.c, and
are currently skipped. Unskip these tests to reproduce the race conditions.
tested (to the extent possible) debug/parallel on charis and jelly.
* Committing clang-format changes
* fixed H5MM_free
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Move Subfiling VFD components into H5FDsubfiling source directory
* Update Autotools build and add H5_HAVE_SUBFILING_VFD macro to H5pubconf.h
* Tidy up CMake build of subfiling sources
* Merge branch 'develop' into feature/subfiling (#1539)
Merge branch 'develop' into feature/subfiling
* Add VFD interface version field to Subfiling and IOC VFDs
* Merge branch 'develop' into feature/subfiling (#1557)
Merge branch 'develop' into feature/subfiling
* Merge branch 'develop' into feature/subfiling (#1563)
Merge branch 'develop' into feature/subfiling
* Tidy up merge artifacts after rebase on develop
* Fix incorrect variable in mirror VFD utils CMake
* Ensure VFD values are always defined
* Add subfiling to CMake VFD_LIST if built
* Mark MPI I/O driver self-initialization global as static
* Add Subfiling VFD to predefined VFDs for HDF5_DRIVER env. variable
* Initial progress towards separating private vs. public subfiling code
* include libgen.h in t_vfd tests for correct dirname/basename
* Committing clang-format changes
* removed mercury option, included subfiling header path (#1577)
Added subfiling status to configure output, installed h5fuse.sh to build directory for use in future tests.
* added check for stdatomic.h (#1578)
* added check for stdatomic.h with subfiling
* added H5_HAVE_SUBFILING_VFD for cmake
* fix old-style-definition warning (#1582)
* fix old-style-definition warning
* added test for enable parallel with subfiling VFD (#1586)
Fails if subfiling VFD is not used with parallel support.
* Subfiling/IOC VFD fixes and tidying (#1619)
* Rename CMake option for Subfiling VFD to be consistent with other VFDs
* Miscellaneous Subfiling fixes
Add error message for unset MPI communicator
Support dynamic loading of subfiling VFD with default configuration
* Temporary fix for subfile name issue
* Added subfile checks (#1634)
* added subfile checks
* Feature/subfiling (#1655)
* Subfiling/IOC VFD cleanup
Fix misuse of MPI_COMM_WORLD in IOC VFD
Propagate Subfiling FAPL MPI settings down to IOC FAPL in default
configuration case
Cleanup IOC VFD debugging code
Change sprintf to snprintf in a few places
* Major work on separating Subfiling and IOC VFDs from each other
* Re-write async_completion func to not overuse stack
* Replace usage of MPI_COMM_WORLD with file's actual MPI communicator
* Refactor H5FDsubfile_mpi.c
* Remove empty file H5FDsubfile_mpi.c
* Separate IOC VFD errors to its own error stack
* Committing clang-format changes
* Remove H5TRACE macros from H5FDioc.c
* Integrate H5FDioc_threads.c with IOC error stack
* Fix for subfile name generation
Use number of I/O concentrators from existing subfiling configuration file, if one exists
* Add temporary barrier in "Get EOF" operation to prevent races on EOF
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Fix for retrieval of machine Host ID
* Default to MPI_COMM_WORLD if no MPI params set
* added libs rt and pthreads (#1673)
* added libs rt and pthreads
* Feature/subfiling (#1689)
* More tidying of IOC VFD and subfiling debug code
* Remove old unused log file code
* Clear FID from active file map on failure
* Fix bug in generation of subfile names when truncating file
* Change subfile names to start from 1 instead of 0
* Use long long for user-specified stripe size from environment variable
* Skip 0-sized I/Os in low-level IOC I/O routines
* Don't update EOF on read
* Convert printed warning about data size mismatch to assertion
* Don't add base file address to I/O addresses twice
Base address should already be applied as part of H5FDwrite/read_vector calls
* Account for 0-sized I/O vector entries in subfile write/read functions
* Rewrite init_indep_io for clarity
* Correction for IOC wraparound calculations
* Some corrections to iovec calculations
* Remove temporary barrier on EOF retrieval
* Complete work request queue entry on error instead of skipping over
* Account for stripe size wraparound for sf_col_offset calculation
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Re-write and fix bugs in I/O vector filling routines (#1703)
* Rewrite I/O vector filling routines for clarity
* Fix bug with iovec_fill_last when last I/O size is 0
* added subfiling_dir line read (#1714)
* added subfiling_dir line read and use it
* shellcheck fixes
* I/O request dispatch logic update (#1731)
Short-circuit I/O request dispatch when head of I/O queue is an
in-progress get EOF or truncate operation. This prevents an issue where
a write operation can be dispatched alongside a get EOF/truncate
operation, whereas all I/O requests are supposed to be ineligible for
dispatch until the get EOF/truncate is completed
* h5fuse.sh.in clean-up (#1757)
* Added command-line options
* Committing clang-format changes
* Align with changes from develop
* Mimic MPI I/O VFD for EOF handling
* Initialize context_id field for work request objects
* Use logfile for some debugging information
* Use atomic store to set IOC ready flag
* Use separate communicator for sending file EOF data
Minor IOC cleanup
* Use H5_subfile_fid_to_context to get context ID for file in Subfiling
VFD
* IOVEC calculation fixes
* Updates for debugging code
* Minor fixes for threaded code
* Committing clang-format changes
* Use separate MPI communicator for barrier operations
* Committing clang-format changes
* Rewrite EOF routine to use nonblocking MPI communication
* Committing clang-format changes
* Always dispatch I/O work requests in IOC main loop
* Return distinct MPI communicator to library when requested
* Minor warning cleanup
* Committing clang-format changes
* Generate h5fuse.sh from h5fuse.sh.in in CMake
* Send truncate messages to correct IOC rank
* Committing clang-format changes
* Miscellaneous cleanup
Post some MPI receives before sends
Free some duplicated MPI communicator/Info objects
Remove unnecessary extra MPI_Barrier
* Warning cleanup
* Fix for leaked MPI communicator
* Retrieve file EOF on single rank and bcast it
* Fixes for a few failure paths
* Cleanup of IOC file opens
* Committing clang-format changes
* Use plan MPI_Send for send of EOF messages
* Always check MPI thread support level during Subfiling init
* Committing clang-format changes
* Handle a hang on failure when IOCs can't open subfiles
* Committing clang-format changes
* Refactor file open status consensus check
* Committing clang-format changes
* Fix for MPI_Comm_free being called after MPI_Finalize
* Fix VFD test by setting MPI params before setting subfiling on FAPL
* Update Subfiling VFD error handling and error stack usage
* Improvements for Subfiling logfiles
* Remove prototypes for currently unused routines
* Disable I/O queue stat collecting by default
* Remove unused serialization mutex variable
* Update VFD testing to take subfiling VFD into account
* Fix usage of global subfiling application layout object
* Minor fixes for failure pathways
* Keep track of the number of failures in an IOC I/O queue
* Make sure not to exceed MPI_TAG_UB value for data communication messages
* Committing clang-format changes
* Update for rename of some H5FD 'ctl' opcodes
* Always include Subfiling's public header files in hdf5.h
* Remove old unused code and comments
* Implement support for per-file I/O queues
Allows the subfiling VFD to have multiple HDF5 files open simultaneously
* Use simple MPI_Iprobe over unnecessary MPI_Improbe
* Committing clang-format changes
* Update HDF5 testing to query driver for H5FD_FEAT_DEFAULT_VFD_COMPATIBLE
flag
* Fix a few bugs related to file multi-opens
* Avoid calling MPI routines if subfiling gets reinitialized
* Fix issue when files are closed in a random order
* Update HDF5 testing to query VFD for "using MPI" feature flag
* Register atexit handler in subfiling VFD to call MPI_Finalize after HDF5
closes
* Fail for collective I/O requests until support is implemented
* Correct VOL test function prototypes
* Minor cleanup of old code and comments
* Update mercury dependency
* Cleanup of subfiling configuration structure
* Committing clang-format changes
* Build system updates for Subfiling VFD
* Fix possible hang on failure in t_vfd tests caused by mismatched
MPI_Barrier calls
* Copy subfiling IOC fapl in "fapl get" method
* Mirror subfiling superblock writes to stub file for legacy POSIX-y HDF5
applications
* Allow collective I/O for MPI_BYTE types and rank 0 bcast strategy
* Committing clang-format changes
* Use different scheme for subfiling write message MPI tag calculations
* Committing clang-format changes
* Avoid performing fstat calls on all MPI ranks
* Add MPI_Barrier before finalizing IOC threads
* Use try_lock in I/O queue dispatch to minimize contention from worker threads
* Use simple Waitall for nonblocking I/O waits
* Add configurable IOC main thread delay and try_lock option to I/O queue dispatch
* Fix bug that could cause serialization of non-overlapping I/O requests
* Temporarily treat collective subfiling vector I/O calls as independent
* Removed unused mercury bits
* Add stubs for subfiling and IOC file delete callback
* Update VFD testing for Subfiling VFD
* Work around HDF5 metadata cache bug for Subfiling VFD when MPI Comm size
= 1
* Committing clang-format changes
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
2022-07-23 04:03:12 +08:00
set ( HDF5_SRC_INCLUDE_DIRS ${ HDF5_SRC_DIR } )
2010-07-21 22:00:47 +08:00
#-----------------------------------------------------------------------------
# parse the full version number from H5public.h and include in H5_VERS_INFO
#-----------------------------------------------------------------------------
2014-03-19 00:21:46 +08:00
file ( READ ${ HDF5_SRC_DIR } /H5public.h _h5public_h_contents )
2014-03-12 05:14:57 +08:00
string ( REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$"
2010-07-21 22:00:47 +08:00
" \ \ 1 " H 5 _ V E R S _ M A J O R $ { _ h 5 p u b l i c _ h _ c o n t e n t s } )
2014-03-12 05:14:57 +08:00
string ( REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$"
2010-07-21 22:00:47 +08:00
" \ \ 1 " H 5 _ V E R S _ M I N O R $ { _ h 5 p u b l i c _ h _ c o n t e n t s } )
2014-03-12 05:14:57 +08:00
string ( REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$"
2010-07-21 22:00:47 +08:00
" \ \ 1 " H 5 _ V E R S _ R E L E A S E $ { _ h 5 p u b l i c _ h _ c o n t e n t s } )
2021-02-16 05:26:48 +08:00
string ( REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\" ( [0-9A-Za-z._-]* ) \".*$"
2012-05-22 05:32:21 +08:00
" \ \ 1 " H 5 _ V E R S _ S U B R E L E A S E $ { _ h 5 p u b l i c _ h _ c o n t e n t s } )
2022-09-03 08:31:29 +08:00
message ( TRACE "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}" )
2010-07-21 22:00:47 +08:00
2011-05-25 22:57:16 +08:00
#-----------------------------------------------------------------------------
# parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO
#-----------------------------------------------------------------------------
2014-03-19 00:21:46 +08:00
file ( READ ${ HDF5_SOURCE_DIR } /config/lt_vers.am _lt_vers_am_contents )
2014-03-12 05:14:57 +08:00
string ( REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
2018-04-10 21:55:17 +08:00
" \ \ 1 " H 5 _ L I B _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2014-03-12 05:14:57 +08:00
string ( REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
2018-04-10 21:55:17 +08:00
" \ \ 1 " H 5 _ L I B _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2014-03-12 05:14:57 +08:00
string ( REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
2018-04-10 21:55:17 +08:00
" \ \ 1 " H 5 _ L I B _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
math ( EXPR H5_LIB_SOVERS_MAJOR ${ H5_LIB_SOVERS_INTERFACE } - ${ H5_LIB_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
2016-02-29 10:43:00 +08:00
string ( REGEX MATCH ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_TOOLS_SOVERS_EXISTS ${ _lt_vers_am_contents } )
2017-01-11 07:09:53 +08:00
if ( H5_TOOLS_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
string ( REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ T O O L S _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_TOOLS_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ T O O L S _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ T O O L S _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2017-03-03 02:20:26 +08:00
math ( EXPR H5_TOOLS_SOVERS_MAJOR ${ H5_TOOLS_SOVERS_INTERFACE } - ${ H5_TOOLS_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2017-04-07 00:22:29 +08:00
string ( REGEX MATCH ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${ _lt_vers_am_contents } )
2017-01-11 07:09:53 +08:00
if ( H5_CXX_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
string ( REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ C X X _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ C X X _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ C X X _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2017-03-03 02:20:26 +08:00
math ( EXPR H5_CXX_SOVERS_MAJOR ${ H5_CXX_SOVERS_INTERFACE } - ${ H5_CXX_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2017-04-07 00:22:29 +08:00
string ( REGEX MATCH ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${ _lt_vers_am_contents } )
2017-01-11 07:09:53 +08:00
if ( H5_F_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
string ( REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ F _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ F _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ F _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2017-03-03 02:20:26 +08:00
math ( EXPR H5_F_SOVERS_MAJOR ${ H5_F_SOVERS_INTERFACE } - ${ H5_F_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2017-04-07 00:22:29 +08:00
string ( REGEX MATCH ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${ _lt_vers_am_contents } )
2017-01-11 07:09:53 +08:00
if ( H5_HL_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
string ( REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_HL_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2017-03-03 02:20:26 +08:00
math ( EXPR H5_HL_SOVERS_MAJOR ${ H5_HL_SOVERS_INTERFACE } - ${ H5_HL_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2017-04-07 00:22:29 +08:00
string ( REGEX MATCH ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${ _lt_vers_am_contents } )
2017-01-11 07:09:53 +08:00
if ( H5_HL_CXX_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
string ( REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ C X X _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_HL_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ C X X _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ C X X _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2017-03-03 02:20:26 +08:00
math ( EXPR H5_HL_CXX_SOVERS_MAJOR ${ H5_HL_CXX_SOVERS_INTERFACE } - ${ H5_HL_CXX_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2017-04-07 00:22:29 +08:00
string ( REGEX MATCH ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${ _lt_vers_am_contents } )
2017-01-11 07:09:53 +08:00
if ( H5_HL_F_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
string ( REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ F _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_HL_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ F _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ H L _ F _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2017-03-03 02:20:26 +08:00
math ( EXPR H5_HL_F_SOVERS_MAJOR ${ H5_HL_F_SOVERS_INTERFACE } - ${ H5_HL_F_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2017-04-07 00:22:29 +08:00
string ( REGEX MATCH ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${ _lt_vers_am_contents } )
2016-02-29 10:43:00 +08:00
if ( H5_JAVA_SOVERS_EXISTS )
string ( REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ J A V A _ S O V E R S _ I N T E R F A C E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_JAVA_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ J A V A _ S O V E R S _ M I N O R $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
string ( REGEX REPLACE ".*LT_JAVA_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
" \ \ 1 " H 5 _ J A V A _ S O V E R S _ R E L E A S E $ { _ l t _ v e r s _ a m _ c o n t e n t s } )
2017-03-03 02:20:26 +08:00
math ( EXPR H5_JAVA_SOVERS_MAJOR ${ H5_JAVA_SOVERS_INTERFACE } - ${ H5_JAVA_SOVERS_RELEASE } )
2022-09-03 08:31:29 +08:00
message ( VERBOSE "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2011-05-25 22:57:16 +08:00
2010-07-21 22:00:47 +08:00
#-----------------------------------------------------------------------------
# Basic HDF5 stuff here
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
set ( HDF5_PACKAGE "hdf5" )
set ( HDF5_PACKAGE_NAME "HDF5" )
set ( HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}" )
set ( HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}" )
set ( HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}" )
2020-08-24 19:55:00 +08:00
if ( H5_VERS_SUBRELEASE )
2020-08-26 22:03:43 +08:00
set ( HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}.${H5_VERS_SUBRELEASE}" )
set ( HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}" )
2020-08-24 19:55:00 +08:00
else ( )
2020-08-24 21:01:01 +08:00
set ( HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}" )
2020-08-26 22:03:43 +08:00
set ( HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}" )
2017-01-11 07:09:53 +08:00
endif ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
if ( H5_TOOLS_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
set ( HDF5_TOOLS_PACKAGE_SOVERSION "${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}" )
2018-04-10 21:55:17 +08:00
set ( HDF5_TOOLS_PACKAGE_SOVERSION_MAJOR "${H5_TOOLS_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
else ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_TOOLS_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_TOOLS_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
if ( H5_CXX_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
set ( HDF5_CXX_PACKAGE_SOVERSION "${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}" )
2018-04-10 21:55:17 +08:00
set ( HDF5_CXX_PACKAGE_SOVERSION_MAJOR "${H5_CXX_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
else ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_CXX_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_CXX_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
if ( H5_F_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
set ( HDF5_F_PACKAGE_SOVERSION "${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}" )
2018-04-10 21:55:17 +08:00
set ( HDF5_F_PACKAGE_SOVERSION_MAJOR "${H5_F_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
else ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_F_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_F_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
if ( H5_HL_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
set ( HDF5_HL_PACKAGE_SOVERSION "${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}" )
2018-04-10 21:55:17 +08:00
set ( HDF5_HL_PACKAGE_SOVERSION_MAJOR "${H5_HL_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
else ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_HL_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_HL_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
if ( H5_HL_F_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
set ( HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}" )
2018-04-10 21:55:17 +08:00
set ( HDF5_HL_CXX_PACKAGE_SOVERSION_MAJOR "${H5_HL_CXX_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
else ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_HL_CXX_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_HL_CXX_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
if ( H5_HL_F_SOVERS_EXISTS )
2016-02-29 10:43:00 +08:00
set ( HDF5_HL_F_PACKAGE_SOVERSION "${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}" )
2018-04-10 21:55:17 +08:00
set ( HDF5_HL_F_PACKAGE_SOVERSION_MAJOR "${H5_HL_F_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
else ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_HL_F_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_HL_F_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
if ( H5_JAVA_SOVERS_EXISTS )
2018-04-10 21:55:17 +08:00
set ( HDF5_JAVA_PACKAGE_SOVERSION "${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}" )
set ( HDF5_JAVA_PACKAGE_SOVERSION_MAJOR "${H5_JAVA_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
else ( )
2018-04-10 21:55:17 +08:00
set ( HDF5_JAVA_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}" )
set ( HDF5_JAVA_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}" )
2017-01-11 07:09:53 +08:00
endif ( )
2014-03-12 05:14:57 +08:00
set ( HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}" )
set ( HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}" )
set ( HDF5_PACKAGE_URL "http://www.hdfgroup.org" )
set ( HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org" )
2010-07-21 22:00:47 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Include some macros for reusable code
#-----------------------------------------------------------------------------
2022-08-19 22:54:42 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDFMacros.cmake )
2010-05-14 00:01:50 +08:00
2018-01-30 00:27:32 +08:00
HDF_DIR_PATHS ( ${ HDF5_PACKAGE_NAME } )
2018-01-09 23:56:28 +08:00
2022-08-19 22:54:42 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDFLibMacros.cmake )
2020-09-26 05:43:57 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDF5PluginMacros.cmake )
2018-01-30 00:27:32 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDF5Macros.cmake )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Targets built within this project are exported at Install time for use
2018-01-30 00:27:32 +08:00
# by other projects.
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
if ( NOT HDF5_EXPORTED_TARGETS )
set ( HDF5_EXPORTED_TARGETS "hdf5-targets" )
2017-01-11 07:09:53 +08:00
endif ( )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# To include a library in the list exported by the project AT BUILD TIME,
# add it to this variable. This is NOT used by Make Install, but for projects
# which include hdf5 as a sub-project within their build tree
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
set_global_variable ( HDF5_LIBRARIES_TO_EXPORT "" )
2016-10-15 00:22:22 +08:00
set_global_variable ( HDF5_UTILS_TO_EXPORT "" )
2014-03-12 05:14:57 +08:00
set ( EXTERNAL_HEADER_LIST "" )
set ( EXTERNAL_LIBRARY_LIST "" )
set ( EXTERNAL_LIBRARYDLL_LIST "" )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Run all the CMake configuration tests for our build environment
#-----------------------------------------------------------------------------
2014-05-15 03:50:28 +08:00
include ( ${ HDF_RESOURCES_DIR } /ConfigureChecks.cmake )
2014-03-12 05:14:57 +08:00
set ( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )
2010-05-14 00:01:50 +08:00
2015-07-10 00:56:16 +08:00
#-----------------------------------------------------------------------------
# Mac OS X Options
#-----------------------------------------------------------------------------
if ( HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS )
2019-06-18 20:46:25 +08:00
set ( BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE )
2017-01-11 07:09:53 +08:00
endif ( )
2015-07-10 00:56:16 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
2017-02-03 03:47:39 +08:00
# Option to Build Shared and Static libs, default is both
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
2020-01-16 01:38:06 +08:00
option ( BUILD_STATIC_LIBS "Build Static Libraries" ON )
set ( H5_ENABLE_STATIC_LIB NO )
2015-08-06 05:01:07 +08:00
option ( BUILD_SHARED_LIBS "Build Shared Libraries" ON )
2014-03-12 05:14:57 +08:00
set ( H5_ENABLE_SHARED_LIB NO )
2020-01-16 01:38:06 +08:00
option ( ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF )
2020-01-29 03:14:59 +08:00
mark_as_advanced ( ONLY_SHARED_LIBS )
2020-01-16 01:38:06 +08:00
if ( BUILD_STATIC_LIBS )
set ( H5_ENABLE_STATIC_LIB YES )
endif ( )
2014-03-12 05:14:57 +08:00
if ( BUILD_SHARED_LIBS )
set ( H5_ENABLE_SHARED_LIB YES )
2017-01-11 07:09:53 +08:00
endif ( )
2020-01-16 01:38:06 +08:00
# Force only shared libraries if all OFF
if ( NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS )
set ( ONLY_SHARED_LIBS ON CACHE BOOL "Only Build Shared Libraries" FORCE )
endif ( )
if ( ONLY_SHARED_LIBS )
set ( H5_ENABLE_STATIC_LIB NO )
set ( BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" )
endif ( )
2015-03-26 06:08:46 +08:00
set ( CMAKE_POSITION_INDEPENDENT_CODE ON )
2010-05-14 00:01:50 +08:00
2020-01-29 03:14:59 +08:00
if ( NOT BUILD_SHARED_LIBS )
set ( tgt_file_ext "" )
else ( )
set ( tgt_file_ext "-shared" )
endif ( )
2021-04-19 20:28:32 +08:00
#-----------------------------------------------------------------------------
# perl is used in some optional src and tests, check availability
find_package ( Perl )
if ( PERL_FOUND )
set ( H5_PERL_FOUND YES )
endif ( )
#-----------------------------------------------------------------------------
2011-02-22 22:55:04 +08:00
#-----------------------------------------------------------------------------
# Option to Build Static executables
#-----------------------------------------------------------------------------
2018-07-31 01:39:28 +08:00
option ( BUILD_STATIC_EXECS "Build Static Executables" OFF )
2014-03-12 05:14:57 +08:00
if ( BUILD_STATIC_EXECS )
if ( NOT WIN32 )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static" )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2011-02-22 22:55:04 +08:00
2021-04-21 06:42:52 +08:00
option ( HDF5_ENABLE_ANALYZER_TOOLS "enable the use of Clang tools" OFF )
mark_as_advanced ( HDF5_ENABLE_ANALYZER_TOOLS )
2019-12-12 06:48:55 +08:00
if ( HDF5_ENABLE_ANALYZER_TOOLS )
include ( ${ HDF5_SOURCE_DIR } /config/sanitizer/tools.cmake )
endif ( )
2021-04-21 06:42:52 +08:00
option ( HDF5_ENABLE_SANITIZERS "execute the Clang sanitizer" OFF )
mark_as_advanced ( HDF5_ENABLE_SANITIZERS )
2019-12-12 06:48:55 +08:00
if ( HDF5_ENABLE_SANITIZERS )
include ( ${ HDF5_SOURCE_DIR } /config/sanitizer/sanitizers.cmake )
endif ( )
2021-04-21 06:42:52 +08:00
option ( HDF5_ENABLE_FORMATTERS "format source files" OFF )
mark_as_advanced ( HDF5_ENABLE_FORMATTERS )
2020-09-05 05:36:52 +08:00
if ( HDF5_ENABLE_FORMATTERS )
include ( ${ HDF5_SOURCE_DIR } /config/sanitizer/formatting.cmake )
endif ( )
2019-12-12 06:48:55 +08:00
2010-06-23 03:04:20 +08:00
#-----------------------------------------------------------------------------
# Option to use code coverage
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
option ( HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF )
if ( HDF5_ENABLE_COVERAGE )
2019-12-12 06:48:55 +08:00
include ( ${ HDF5_SOURCE_DIR } /config/sanitizer/code-coverage.cmake )
if ( CODE_COVERAGE AND CODE_COVERAGE_ADDED )
2020-01-29 03:14:59 +08:00
add_code_coverage ( ) # Adds instrumentation to all targets
2018-08-09 23:59:32 +08:00
else ( )
2019-12-12 06:48:55 +08:00
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage" )
if ( CMAKE_C_COMPILER_ID STREQUAL "GNU" )
set ( LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage" )
link_libraries ( gcov )
else ( )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage" )
endif ( )
2018-08-09 23:59:32 +08:00
endif ( )
2017-01-11 07:09:53 +08:00
endif ( )
2010-06-23 03:04:20 +08:00
2012-06-05 01:05:02 +08:00
#-----------------------------------------------------------------------------
# Option to indicate using dmalloc
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
# option (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF)
# if (HDF5_ENABLE_USING_DMALLOC)
2014-03-19 00:21:46 +08:00
# find_package (DMALLOC)
2015-05-15 00:51:20 +08:00
# set (H5_HAVE_DMALLOC DMALLOC_FOUND)
2017-01-11 07:09:53 +08:00
# endif ()
2012-06-05 01:05:02 +08:00
2010-10-08 00:05:41 +08:00
#-----------------------------------------------------------------------------
# Option to indicate using a memory checker
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
option ( HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF )
if ( HDF5_ENABLE_USING_MEMCHECKER )
2015-05-15 00:51:20 +08:00
set ( H5_USING_MEMCHECKER 1 )
2017-01-11 07:09:53 +08:00
endif ( )
2010-10-08 00:05:41 +08:00
2016-01-04 06:06:52 +08:00
#-----------------------------------------------------------------------------
# Option to indicate internal memory allocation sanity checks are enabled
#-----------------------------------------------------------------------------
option ( HDF5_MEMORY_ALLOC_SANITY_CHECK "Indicate that internal memory allocation sanity checks are enabled" OFF )
if ( HDF5_MEMORY_ALLOC_SANITY_CHECK )
set ( H5_MEMORY_ALLOC_SANITY_CHECK 1 )
2017-01-11 07:09:53 +08:00
endif ( )
2016-01-04 06:06:52 +08:00
2019-01-31 09:32:40 +08:00
#-----------------------------------------------------------------------------
# Option to enable/disable using pread/pwrite for VFDs
#-----------------------------------------------------------------------------
option ( HDF5_ENABLE_PREADWRITE "Use pread/pwrite in sec2/log/core VFDs in place of read/write (when available)" ON )
mark_as_advanced ( HDF5_ENABLE_PREADWRITE )
2019-02-02 05:23:54 +08:00
if ( HDF5_ENABLE_PREADWRITE AND H5_HAVE_PREAD AND H5_HAVE_PWRITE )
2019-01-31 09:32:40 +08:00
set ( H5_HAVE_PREADWRITE 1 )
endif ( )
2010-11-17 00:38:40 +08:00
#-----------------------------------------------------------------------------
# Option to use deprecated public API symbols
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
option ( HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON )
if ( HDF5_ENABLE_DEPRECATED_SYMBOLS )
2015-05-15 00:51:20 +08:00
set ( H5_NO_DEPRECATED_SYMBOLS 0 )
2017-01-11 07:09:53 +08:00
else ( )
2015-05-15 00:51:20 +08:00
set ( H5_NO_DEPRECATED_SYMBOLS 1 )
2017-01-11 07:09:53 +08:00
endif ( )
2010-11-17 00:38:40 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# When building utility executables that generate other (source) files :
# we make use of the following variables defined in the root CMakeLists.
# Certain systems may add /Debug or /Release to output paths
# and we need to call the executable from inside the CMake configuration
#-----------------------------------------------------------------------------
2020-10-30 20:09:23 +08:00
if ( WIN32 )
add_compile_definitions ( _CRT_SECURE_NO_WARNINGS )
if ( MSVC )
add_compile_definitions ( _BIND_TO_CURRENT_VCLIBS_VERSION=1 _CONSOLE )
endif ( )
2017-01-11 07:09:53 +08:00
endif ( )
2014-03-12 05:14:57 +08:00
2020-10-30 17:44:24 +08:00
option ( HDF5_MINGW_STATIC_GCC_LIBS "Statically link libgcc/libstdc++" OFF )
2014-03-12 05:14:57 +08:00
if ( MSVC )
set ( CMAKE_MFC_FLAG 0 )
set ( WIN_COMPILE_FLAGS "" )
set ( WIN_LINK_FLAGS "" )
2017-01-11 07:09:53 +08:00
endif ( )
2014-03-12 05:14:57 +08:00
set ( MAKE_SYSTEM )
2020-11-17 21:53:10 +08:00
if ( CMAKE_MAKE_PROGRAM MATCHES "make" )
2014-03-12 05:14:57 +08:00
set ( MAKE_SYSTEM 1 )
2017-01-11 07:09:53 +08:00
endif ( )
2014-03-12 05:14:57 +08:00
set ( CFG_INIT "/${CMAKE_CFG_INTDIR}" )
if ( MAKE_SYSTEM )
set ( CFG_INIT "" )
2017-01-11 07:09:53 +08:00
endif ( )
2010-05-14 00:01:50 +08:00
2017-09-12 22:24:37 +08:00
# Do not generate test programs by default
option ( HDF5_BUILD_GENERATORS "Build Test Generators" OFF )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Add some definitions for Debug Builds
#-----------------------------------------------------------------------------
2015-03-18 02:59:19 +08:00
option ( HDF5_ENABLE_TRACE "Enable API tracing capability" OFF )
mark_as_advanced ( HDF5_ENABLE_TRACE )
2018-01-20 00:49:17 +08:00
if ( ${ HDF_CFG_NAME } MATCHES "Debug" )
2012-06-05 01:05:02 +08:00
# Enable instrumenting of the library's internal operations
2014-03-12 05:14:57 +08:00
option ( HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF )
if ( HDF5_ENABLE_INSTRUMENT )
set ( H5_HAVE_INSTRUMENTED_LIBRARY 1 )
2017-01-11 07:09:53 +08:00
endif ( )
2015-03-18 02:59:19 +08:00
mark_as_advanced ( HDF5_ENABLE_INSTRUMENT )
2017-01-11 07:09:53 +08:00
endif ( )
2010-05-14 00:01:50 +08:00
2011-08-19 04:59:00 +08:00
#-----------------------------------------------------------------------------
2022-08-20 08:18:30 +08:00
# Add some definitions for Developer Builds
#-----------------------------------------------------------------------------
if ( ${ HDF_CFG_NAME } MATCHES "Developer" )
include ( ${ HDF_RESOURCES_DIR } /HDF5DeveloperBuild.cmake )
endif ( )
#-----------------------------------------------------------------------------
2011-08-19 04:59:00 +08:00
# Option to embed library info into executables
#-----------------------------------------------------------------------------
2018-01-31 06:03:03 +08:00
if ( CMAKE_SYSTEM_NAME STREQUAL "Emscripten" )
set ( H5_HAVE_EMBEDDED_LIBINFO 0 )
else ( )
option ( HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON )
if ( HDF5_ENABLE_EMBEDDED_LIBINFO )
set ( H5_HAVE_EMBEDDED_LIBINFO 1 )
endif ( )
2017-01-11 07:09:53 +08:00
endif ( )
2011-08-19 04:59:00 +08:00
2015-05-15 00:51:20 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDFCompilerFlags.cmake )
2022-08-19 22:54:42 +08:00
set ( CMAKE_MODULE_PATH ${ HDF_RESOURCES_DIR } ${ HDF_RESOURCES_DIR } ${ CMAKE_MODULE_PATH } )
2010-05-14 00:01:50 +08:00
2019-07-26 00:36:37 +08:00
#-----------------------------------------------------------------------------
# Option to Enable HDFS
#-----------------------------------------------------------------------------
option ( HDF5_ENABLE_HDFS "Enable HDFS" OFF )
if ( HDF5_ENABLE_HDFS )
find_package ( JNI REQUIRED )
if ( JNI_FOUND )
set ( H5_HAVE_LIBJVM 1 )
endif ( )
find_package ( HDFS REQUIRED )
if ( HDFS_FOUND )
set ( H5_HAVE_LIBHDFS 1 )
set ( H5_HAVE_HDFS_H 1 )
if ( NOT MSVC )
list ( APPEND LINK_LIBS -pthread )
endif ( )
else ( )
message ( FATAL_ERROR "Set to use libhdfs library, but could not find or use libhdfs. Please verify that the path to HADOOP_HOME is valid, and/or reconfigure without HDF5_ENABLE_HDFS" )
endif ( )
endif ( )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Option to Enable MPI Parallel
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
option ( HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF )
if ( HDF5_ENABLE_PARALLEL )
2017-11-02 01:29:53 +08:00
find_package ( MPI REQUIRED )
2014-03-12 05:14:57 +08:00
if ( MPI_C_FOUND )
set ( H5_HAVE_PARALLEL 1 )
2011-11-03 04:39:31 +08:00
# MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail
2010-05-26 00:00:56 +08:00
# and once set, they are cached as false and not regenerated
2018-08-02 23:22:37 +08:00
set ( CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" )
set ( CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_DIRS}" )
2010-05-26 00:00:56 +08:00
# Used by Fortran + MPI
2018-08-02 23:22:37 +08:00
CHECK_SYMBOL_EXISTS ( MPI_Comm_c2f "mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm )
CHECK_SYMBOL_EXISTS ( MPI_Info_c2f "mpi.h" H5_HAVE_MPI_MULTI_LANG_Info )
2018-07-27 01:50:26 +08:00
# Used by Parallel Compression feature
2018-07-31 23:45:43 +08:00
set ( PARALLEL_FILTERED_WRITES ON )
2022-02-25 00:04:59 +08:00
CHECK_SYMBOL_EXISTS ( MPI_Ibarrier "mpi.h" H5_HAVE_MPI_Ibarrier )
CHECK_SYMBOL_EXISTS ( MPI_Issend "mpi.h" H5_HAVE_MPI_Issend )
CHECK_SYMBOL_EXISTS ( MPI_Iprobe "mpi.h" H5_HAVE_MPI_Iprobe )
CHECK_SYMBOL_EXISTS ( MPI_Irecv "mpi.h" H5_HAVE_MPI_Irecv )
if ( H5_HAVE_MPI_Ibarrier AND H5_HAVE_MPI_Issend AND H5_HAVE_MPI_Iprobe AND H5_HAVE_MPI_Irecv )
set ( H5_HAVE_PARALLEL_FILTERED_WRITES 1 )
else ( )
message ( WARNING " The MPI_Ibarrier/MPI_Issend/MPI_Iprobe/MPI_Irecv functions could not be located.
2018-07-27 01:50:26 +08:00
P a r a l l e l w r i t e s o f f i l t e r e d d a t a w i l l b e d i s a b l e d . " )
2018-07-31 23:45:43 +08:00
set ( PARALLEL_FILTERED_WRITES OFF )
2018-07-27 01:50:26 +08:00
endif ( )
2018-08-01 02:42:19 +08:00
# Used by big I/O feature
set ( LARGE_PARALLEL_IO ON )
2018-08-02 23:22:37 +08:00
CHECK_SYMBOL_EXISTS ( MPI_Get_elements_x "mpi.h" H5_HAVE_MPI_Get_elements_x )
CHECK_SYMBOL_EXISTS ( MPI_Type_size_x "mpi.h" H5_HAVE_MPI_Type_size_x )
2018-08-01 02:42:19 +08:00
if ( NOT H5_HAVE_MPI_Get_elements_x OR NOT H5_HAVE_MPI_Type_size_x )
message ( WARNING " The MPI_Get_elements_x and/or MPI_Type_size_x functions could not be located.
R e a d i n g / W r i t i n g > 2 G B o f d a t a i n a s i n g l e p a r a l l e l I / O o p e r a t i o n w i l l b e d i s a b l e d . " )
set ( LARGE_PARALLEL_IO OFF )
endif ( )
2017-01-11 07:09:53 +08:00
else ( )
2018-09-01 02:29:36 +08:00
message ( FATAL_ERROR "Parallel libraries not found" )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2010-05-14 00:01:50 +08:00
# Parallel IO usage requires MPI to be Linked and Included
2014-03-12 05:14:57 +08:00
if ( H5_HAVE_PARALLEL )
set ( LINK_LIBS ${ LINK_LIBS } ${ MPI_C_LIBRARIES } )
if ( MPI_C_LINK_FLAGS )
set ( CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2010-05-14 00:01:50 +08:00
Subfiling VFD (#1883)
* Added support for vector I/O calls to the VFD layer, and
associated test code. Note that this includes the optimization
to allow shortened sizes and types arrays to allow more space
efficient representations of vectors in which all entries are
of the same size and/or type. See the Selection I/o RFC for
further details.
Tested serial and parallel, debug and production on Charis.
serial and parallel debug only on Jelly.
* ran code formatter
quick serial build and test on jelly
* Add H5FD_read_selection() and H5FD_write_selection(). Currently only
translate to scalar calls. Fix const buf in H5FD_write_vector().
* Format source
* Fix comments
* Add selection I/O to chunk code, used when: not using chunk cache, no
datatype conversion, no I/O filters, no page buffer, not using collective
I/O. Requires global variable H5_use_selection_io_g be set to TRUE.
Implemented selection to vector I/O transaltion at the file driver
layer.
* Fix formatting unrelated to previous change to stop github from
complaining.
* Add full API support for selection I/O. Add tests for this.
* Implement selection I/O for contiguous datasets. Fix bug in selection
I/O translation. Add const qualifiers to some internal selection I/O
routines to maintain const-correctness while avoiding memcpys.
* Added vector read / write support to the MPIO VFD, with associated
test code (see testpar/t_vfd.c).
Note that this implementation does NOT support vector entries of
size greater than 2 GB. This must be repaired before release,
but it should be good enough for correctness testing.
As MPIO requires vector I/O requests to be sorted in increasing
address order, also added a vector sort utility in H5FDint.c This
function is tested in passing by the MPIO vector I/O extension.
In passing, repaired a bug in size / type vector extension management
in H5FD_read/write_vector()
Tested parallel debug and production on charis and Jelly.
* Ran source code formatter
* Add support for independent parallel I/O with selection I/O. Add
HDF5_USE_SELECTION_IO env var to control selection I/O (default off).
* Implement parallel collective support for selection I/O.
* Fix comments and run formatter.
* Update selection IO branch with develop (#1215)
Merged branch 'develop' into selection_io
* Sync with develop (#1262)
Updated the branch with develop changes.
* Implement big I/O support for vector I/O requests in the MPIO file
driver.
* Free arrays in H5FD__mpio_read/write_vector() as soon as they're not
needed, to cut down on memory usage during I/O.
* Address comments from code review. Fix const warnings with
H5S_SEL_ITER_INIT().
* Committing clang-format changes
* Feature/subfiling (#1464)
* Initial checkin of merged sub-filing VFD.
Passes regression tests (debug/shared/paralle) on Jelly.
However, bugs and many compiler warnings remain -- not suitable
for merge to develop.
* Minor mods to src/H5FDsubfile_mpi.c to address errors reported by autogen.sh
* Code formatting run -- no test
* Merged my subfiling code fixes into the new selection_io_branch
* Forgot to add the FindMERCURY.cmake file. This will probably disappear soon
* attempting to make a more reliable subfile file open which doesn't return errors. For some unknown reason, the regular posix open will occasionally fail to create a subfile. Some better error handling for file close has been added.
* added NULL option for H5FD_subfiling_config_t in H5Pset_fapl_subfiling (#1034)
* NULL option automatically stacks IOC VFD for subfiling and returns a valid fapl.
* added doxygen subfiling APIs
* Various fixes which allow the IOR benchmark to run correctly
* Lots of updates including the packaging up of the mercury_util source files to enable easier builds for our Benchmarking
* Interim checkin of selection_io_with_subfiling_vfd branch
Moddified testpar/t_vfd.c to test the subfiling vfd with default configuration.
Must update this code to run with a variety of configurations -- most particularly
multiple IO concentrators, and stripe depth small enough to test the other IO
concentrators.
testpar/t_vfd.c exposed a large number of race condidtions -- symtoms included:
1) Crashes (usually seg faults)
2) Heap corruption
3) Stack corruption
4) Double frees of heap space
5) Hangs
6) Out of order execution of I/O requests / violations of POSIX semantics
7) Swapped write requests
Items 1 - 4 turned out to be primarily caused by file close issues --
specifically, the main I/O concentrator thread and its pool of worker threads
were not being shut down properly on file close. Addressing this issue in
combination with some other minor fixes seems to have addressed these issues.
Items 5 & 6 appear to have been caused by issue of I/O requests to the
thread pool in an order that did not maintain POSIX semantics. A rewrite of
the I/O request dispatch code appears to have solved these issues.
Item 7 seems to have been caused by multiple write requests from a given
rank being read by the wrong worker thread. Code to issue "unique" tags for
each write request via the ACK message appears to have cleaned this up.
Note that the code is still in poor condtition. A partial list of known
defects includes:
a) Race condiditon on file close that allows superblock writes to arrive
at the I/O concentrator after it has been shutdown. This defect is
most evident when testpar/t_subfiling_vfd is run with 8 ranks.
b) No error reporting from I/O concentrators -- must design and implement
this. For now, mostly just asserts, which suggests that it should be
run in debug mode.
c) Much commented out and/or un-used code.
d) Code orgnaization
e) Build system with bits of Mercury is awkward -- think of shifting
to pthreads with our own thread pool code.
f) Need to add native support for vector and selection I/O to the subfiling
VFD.
g) Need to review, and posibly rework configuration code.
h) Need to store subfile configuration data in a superblock extension message,
and add code to use this data on file open.
i) Test code is inadequate -- expect more issues as it is extended.
In particular, there is no unit test code for the I/O request dispatch code.
While I think it is correct at present, we need test code to verify this.
Similarly, we need to test with multiple I/O concentrators and much smaller
stripe depth.
My actual code changes were limited to:
src/H5FDioc.c
src/H5FDioc_threads.c
src/H5FDsubfile_int.c
src/H5FDsubfile_mpi.c
src/H5FDsubfiling.c
src/H5FDsubfiling.h
src/H5FDsubfiling_priv.h
testpar/t_subfiling_vfd.c
testpar/t_vfd.c
I'm not sure what is going on with the deletions in src/mercury/src/util.
Tested parallel/debug on Charis and Jelly
* subfiling with selection IO (#1219)
Merged branch 'selection_io' into subfiling branch.
* Subfile name fixes (#1250)
* fixed subfiling naming convention, and added leading zero to rank names.
* Merge branch 'selection_io' into selection_io_with_subfiling_vfd (#1265)
* Added script to join subfiles into a single HDF5 file (#1350)
* Modified H5FD__subfiling_query() to report that the sub-filing VFD supports MPI
This exposed issues with truncate and get EOF in the sub-filing VFD.
I believe I have addressed these issues (get EOF not as fully tested as it should be), howeer,
it exposed race conditions resulting in hangs. As of this writing, I have not been able
to chase these down.
Note that the tests that expose these race conditions are in testpar/t_subfiling_vfd.c, and
are currently skipped. Unskip these tests to reproduce the race conditions.
tested (to the extent possible) debug/parallel on charis and jelly.
* Committing clang-format changes
* fixed H5MM_free
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Move Subfiling VFD components into H5FDsubfiling source directory
* Update Autotools build and add H5_HAVE_SUBFILING_VFD macro to H5pubconf.h
* Tidy up CMake build of subfiling sources
* Merge branch 'develop' into feature/subfiling (#1539)
Merge branch 'develop' into feature/subfiling
* Add VFD interface version field to Subfiling and IOC VFDs
* Merge branch 'develop' into feature/subfiling (#1557)
Merge branch 'develop' into feature/subfiling
* Merge branch 'develop' into feature/subfiling (#1563)
Merge branch 'develop' into feature/subfiling
* Tidy up merge artifacts after rebase on develop
* Fix incorrect variable in mirror VFD utils CMake
* Ensure VFD values are always defined
* Add subfiling to CMake VFD_LIST if built
* Mark MPI I/O driver self-initialization global as static
* Add Subfiling VFD to predefined VFDs for HDF5_DRIVER env. variable
* Initial progress towards separating private vs. public subfiling code
* include libgen.h in t_vfd tests for correct dirname/basename
* Committing clang-format changes
* removed mercury option, included subfiling header path (#1577)
Added subfiling status to configure output, installed h5fuse.sh to build directory for use in future tests.
* added check for stdatomic.h (#1578)
* added check for stdatomic.h with subfiling
* added H5_HAVE_SUBFILING_VFD for cmake
* fix old-style-definition warning (#1582)
* fix old-style-definition warning
* added test for enable parallel with subfiling VFD (#1586)
Fails if subfiling VFD is not used with parallel support.
* Subfiling/IOC VFD fixes and tidying (#1619)
* Rename CMake option for Subfiling VFD to be consistent with other VFDs
* Miscellaneous Subfiling fixes
Add error message for unset MPI communicator
Support dynamic loading of subfiling VFD with default configuration
* Temporary fix for subfile name issue
* Added subfile checks (#1634)
* added subfile checks
* Feature/subfiling (#1655)
* Subfiling/IOC VFD cleanup
Fix misuse of MPI_COMM_WORLD in IOC VFD
Propagate Subfiling FAPL MPI settings down to IOC FAPL in default
configuration case
Cleanup IOC VFD debugging code
Change sprintf to snprintf in a few places
* Major work on separating Subfiling and IOC VFDs from each other
* Re-write async_completion func to not overuse stack
* Replace usage of MPI_COMM_WORLD with file's actual MPI communicator
* Refactor H5FDsubfile_mpi.c
* Remove empty file H5FDsubfile_mpi.c
* Separate IOC VFD errors to its own error stack
* Committing clang-format changes
* Remove H5TRACE macros from H5FDioc.c
* Integrate H5FDioc_threads.c with IOC error stack
* Fix for subfile name generation
Use number of I/O concentrators from existing subfiling configuration file, if one exists
* Add temporary barrier in "Get EOF" operation to prevent races on EOF
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Fix for retrieval of machine Host ID
* Default to MPI_COMM_WORLD if no MPI params set
* added libs rt and pthreads (#1673)
* added libs rt and pthreads
* Feature/subfiling (#1689)
* More tidying of IOC VFD and subfiling debug code
* Remove old unused log file code
* Clear FID from active file map on failure
* Fix bug in generation of subfile names when truncating file
* Change subfile names to start from 1 instead of 0
* Use long long for user-specified stripe size from environment variable
* Skip 0-sized I/Os in low-level IOC I/O routines
* Don't update EOF on read
* Convert printed warning about data size mismatch to assertion
* Don't add base file address to I/O addresses twice
Base address should already be applied as part of H5FDwrite/read_vector calls
* Account for 0-sized I/O vector entries in subfile write/read functions
* Rewrite init_indep_io for clarity
* Correction for IOC wraparound calculations
* Some corrections to iovec calculations
* Remove temporary barrier on EOF retrieval
* Complete work request queue entry on error instead of skipping over
* Account for stripe size wraparound for sf_col_offset calculation
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Re-write and fix bugs in I/O vector filling routines (#1703)
* Rewrite I/O vector filling routines for clarity
* Fix bug with iovec_fill_last when last I/O size is 0
* added subfiling_dir line read (#1714)
* added subfiling_dir line read and use it
* shellcheck fixes
* I/O request dispatch logic update (#1731)
Short-circuit I/O request dispatch when head of I/O queue is an
in-progress get EOF or truncate operation. This prevents an issue where
a write operation can be dispatched alongside a get EOF/truncate
operation, whereas all I/O requests are supposed to be ineligible for
dispatch until the get EOF/truncate is completed
* h5fuse.sh.in clean-up (#1757)
* Added command-line options
* Committing clang-format changes
* Align with changes from develop
* Mimic MPI I/O VFD for EOF handling
* Initialize context_id field for work request objects
* Use logfile for some debugging information
* Use atomic store to set IOC ready flag
* Use separate communicator for sending file EOF data
Minor IOC cleanup
* Use H5_subfile_fid_to_context to get context ID for file in Subfiling
VFD
* IOVEC calculation fixes
* Updates for debugging code
* Minor fixes for threaded code
* Committing clang-format changes
* Use separate MPI communicator for barrier operations
* Committing clang-format changes
* Rewrite EOF routine to use nonblocking MPI communication
* Committing clang-format changes
* Always dispatch I/O work requests in IOC main loop
* Return distinct MPI communicator to library when requested
* Minor warning cleanup
* Committing clang-format changes
* Generate h5fuse.sh from h5fuse.sh.in in CMake
* Send truncate messages to correct IOC rank
* Committing clang-format changes
* Miscellaneous cleanup
Post some MPI receives before sends
Free some duplicated MPI communicator/Info objects
Remove unnecessary extra MPI_Barrier
* Warning cleanup
* Fix for leaked MPI communicator
* Retrieve file EOF on single rank and bcast it
* Fixes for a few failure paths
* Cleanup of IOC file opens
* Committing clang-format changes
* Use plan MPI_Send for send of EOF messages
* Always check MPI thread support level during Subfiling init
* Committing clang-format changes
* Handle a hang on failure when IOCs can't open subfiles
* Committing clang-format changes
* Refactor file open status consensus check
* Committing clang-format changes
* Fix for MPI_Comm_free being called after MPI_Finalize
* Fix VFD test by setting MPI params before setting subfiling on FAPL
* Update Subfiling VFD error handling and error stack usage
* Improvements for Subfiling logfiles
* Remove prototypes for currently unused routines
* Disable I/O queue stat collecting by default
* Remove unused serialization mutex variable
* Update VFD testing to take subfiling VFD into account
* Fix usage of global subfiling application layout object
* Minor fixes for failure pathways
* Keep track of the number of failures in an IOC I/O queue
* Make sure not to exceed MPI_TAG_UB value for data communication messages
* Committing clang-format changes
* Update for rename of some H5FD 'ctl' opcodes
* Always include Subfiling's public header files in hdf5.h
* Remove old unused code and comments
* Implement support for per-file I/O queues
Allows the subfiling VFD to have multiple HDF5 files open simultaneously
* Use simple MPI_Iprobe over unnecessary MPI_Improbe
* Committing clang-format changes
* Update HDF5 testing to query driver for H5FD_FEAT_DEFAULT_VFD_COMPATIBLE
flag
* Fix a few bugs related to file multi-opens
* Avoid calling MPI routines if subfiling gets reinitialized
* Fix issue when files are closed in a random order
* Update HDF5 testing to query VFD for "using MPI" feature flag
* Register atexit handler in subfiling VFD to call MPI_Finalize after HDF5
closes
* Fail for collective I/O requests until support is implemented
* Correct VOL test function prototypes
* Minor cleanup of old code and comments
* Update mercury dependency
* Cleanup of subfiling configuration structure
* Committing clang-format changes
* Build system updates for Subfiling VFD
* Fix possible hang on failure in t_vfd tests caused by mismatched
MPI_Barrier calls
* Copy subfiling IOC fapl in "fapl get" method
* Mirror subfiling superblock writes to stub file for legacy POSIX-y HDF5
applications
* Allow collective I/O for MPI_BYTE types and rank 0 bcast strategy
* Committing clang-format changes
* Use different scheme for subfiling write message MPI tag calculations
* Committing clang-format changes
* Avoid performing fstat calls on all MPI ranks
* Add MPI_Barrier before finalizing IOC threads
* Use try_lock in I/O queue dispatch to minimize contention from worker threads
* Use simple Waitall for nonblocking I/O waits
* Add configurable IOC main thread delay and try_lock option to I/O queue dispatch
* Fix bug that could cause serialization of non-overlapping I/O requests
* Temporarily treat collective subfiling vector I/O calls as independent
* Removed unused mercury bits
* Add stubs for subfiling and IOC file delete callback
* Update VFD testing for Subfiling VFD
* Work around HDF5 metadata cache bug for Subfiling VFD when MPI Comm size
= 1
* Committing clang-format changes
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
2022-07-23 04:03:12 +08:00
# Determine whether to build the HDF5 Subfiling VFD
set ( H5FD_SUBFILING_DIR ${ HDF5_SRC_DIR } /H5FDsubfiling )
set ( HDF5_SRC_INCLUDE_DIRS
$ { H D F 5 _ S R C _ I N C L U D E _ D I R S }
$ { H 5 F D _ S U B F I L I N G _ D I R }
)
option ( HDF5_ENABLE_SUBFILING_VFD "Build Parallel HDF5 Subfiling VFD" OFF )
if ( HDF5_ENABLE_SUBFILING_VFD )
if ( NOT HDF5_ENABLE_PARALLEL )
message ( FATAL_ERROR "Subfiling VFD requires a parallel HDF5 build" )
2022-09-17 00:17:30 +08:00
else ( )
# Check for MPI_Comm_split_type
CHECK_SYMBOL_EXISTS ( MPI_Comm_split_type "mpi.h" H5_HAVE_MPI_Comm_split_type )
if ( NOT H5_HAVE_MPI_Comm_split_type )
message ( FATAL_ERROR "Subfiling VFD requires MPI-3 support for MPI_Comm_split_type" )
endif ( )
Subfiling VFD (#1883)
* Added support for vector I/O calls to the VFD layer, and
associated test code. Note that this includes the optimization
to allow shortened sizes and types arrays to allow more space
efficient representations of vectors in which all entries are
of the same size and/or type. See the Selection I/o RFC for
further details.
Tested serial and parallel, debug and production on Charis.
serial and parallel debug only on Jelly.
* ran code formatter
quick serial build and test on jelly
* Add H5FD_read_selection() and H5FD_write_selection(). Currently only
translate to scalar calls. Fix const buf in H5FD_write_vector().
* Format source
* Fix comments
* Add selection I/O to chunk code, used when: not using chunk cache, no
datatype conversion, no I/O filters, no page buffer, not using collective
I/O. Requires global variable H5_use_selection_io_g be set to TRUE.
Implemented selection to vector I/O transaltion at the file driver
layer.
* Fix formatting unrelated to previous change to stop github from
complaining.
* Add full API support for selection I/O. Add tests for this.
* Implement selection I/O for contiguous datasets. Fix bug in selection
I/O translation. Add const qualifiers to some internal selection I/O
routines to maintain const-correctness while avoiding memcpys.
* Added vector read / write support to the MPIO VFD, with associated
test code (see testpar/t_vfd.c).
Note that this implementation does NOT support vector entries of
size greater than 2 GB. This must be repaired before release,
but it should be good enough for correctness testing.
As MPIO requires vector I/O requests to be sorted in increasing
address order, also added a vector sort utility in H5FDint.c This
function is tested in passing by the MPIO vector I/O extension.
In passing, repaired a bug in size / type vector extension management
in H5FD_read/write_vector()
Tested parallel debug and production on charis and Jelly.
* Ran source code formatter
* Add support for independent parallel I/O with selection I/O. Add
HDF5_USE_SELECTION_IO env var to control selection I/O (default off).
* Implement parallel collective support for selection I/O.
* Fix comments and run formatter.
* Update selection IO branch with develop (#1215)
Merged branch 'develop' into selection_io
* Sync with develop (#1262)
Updated the branch with develop changes.
* Implement big I/O support for vector I/O requests in the MPIO file
driver.
* Free arrays in H5FD__mpio_read/write_vector() as soon as they're not
needed, to cut down on memory usage during I/O.
* Address comments from code review. Fix const warnings with
H5S_SEL_ITER_INIT().
* Committing clang-format changes
* Feature/subfiling (#1464)
* Initial checkin of merged sub-filing VFD.
Passes regression tests (debug/shared/paralle) on Jelly.
However, bugs and many compiler warnings remain -- not suitable
for merge to develop.
* Minor mods to src/H5FDsubfile_mpi.c to address errors reported by autogen.sh
* Code formatting run -- no test
* Merged my subfiling code fixes into the new selection_io_branch
* Forgot to add the FindMERCURY.cmake file. This will probably disappear soon
* attempting to make a more reliable subfile file open which doesn't return errors. For some unknown reason, the regular posix open will occasionally fail to create a subfile. Some better error handling for file close has been added.
* added NULL option for H5FD_subfiling_config_t in H5Pset_fapl_subfiling (#1034)
* NULL option automatically stacks IOC VFD for subfiling and returns a valid fapl.
* added doxygen subfiling APIs
* Various fixes which allow the IOR benchmark to run correctly
* Lots of updates including the packaging up of the mercury_util source files to enable easier builds for our Benchmarking
* Interim checkin of selection_io_with_subfiling_vfd branch
Moddified testpar/t_vfd.c to test the subfiling vfd with default configuration.
Must update this code to run with a variety of configurations -- most particularly
multiple IO concentrators, and stripe depth small enough to test the other IO
concentrators.
testpar/t_vfd.c exposed a large number of race condidtions -- symtoms included:
1) Crashes (usually seg faults)
2) Heap corruption
3) Stack corruption
4) Double frees of heap space
5) Hangs
6) Out of order execution of I/O requests / violations of POSIX semantics
7) Swapped write requests
Items 1 - 4 turned out to be primarily caused by file close issues --
specifically, the main I/O concentrator thread and its pool of worker threads
were not being shut down properly on file close. Addressing this issue in
combination with some other minor fixes seems to have addressed these issues.
Items 5 & 6 appear to have been caused by issue of I/O requests to the
thread pool in an order that did not maintain POSIX semantics. A rewrite of
the I/O request dispatch code appears to have solved these issues.
Item 7 seems to have been caused by multiple write requests from a given
rank being read by the wrong worker thread. Code to issue "unique" tags for
each write request via the ACK message appears to have cleaned this up.
Note that the code is still in poor condtition. A partial list of known
defects includes:
a) Race condiditon on file close that allows superblock writes to arrive
at the I/O concentrator after it has been shutdown. This defect is
most evident when testpar/t_subfiling_vfd is run with 8 ranks.
b) No error reporting from I/O concentrators -- must design and implement
this. For now, mostly just asserts, which suggests that it should be
run in debug mode.
c) Much commented out and/or un-used code.
d) Code orgnaization
e) Build system with bits of Mercury is awkward -- think of shifting
to pthreads with our own thread pool code.
f) Need to add native support for vector and selection I/O to the subfiling
VFD.
g) Need to review, and posibly rework configuration code.
h) Need to store subfile configuration data in a superblock extension message,
and add code to use this data on file open.
i) Test code is inadequate -- expect more issues as it is extended.
In particular, there is no unit test code for the I/O request dispatch code.
While I think it is correct at present, we need test code to verify this.
Similarly, we need to test with multiple I/O concentrators and much smaller
stripe depth.
My actual code changes were limited to:
src/H5FDioc.c
src/H5FDioc_threads.c
src/H5FDsubfile_int.c
src/H5FDsubfile_mpi.c
src/H5FDsubfiling.c
src/H5FDsubfiling.h
src/H5FDsubfiling_priv.h
testpar/t_subfiling_vfd.c
testpar/t_vfd.c
I'm not sure what is going on with the deletions in src/mercury/src/util.
Tested parallel/debug on Charis and Jelly
* subfiling with selection IO (#1219)
Merged branch 'selection_io' into subfiling branch.
* Subfile name fixes (#1250)
* fixed subfiling naming convention, and added leading zero to rank names.
* Merge branch 'selection_io' into selection_io_with_subfiling_vfd (#1265)
* Added script to join subfiles into a single HDF5 file (#1350)
* Modified H5FD__subfiling_query() to report that the sub-filing VFD supports MPI
This exposed issues with truncate and get EOF in the sub-filing VFD.
I believe I have addressed these issues (get EOF not as fully tested as it should be), howeer,
it exposed race conditions resulting in hangs. As of this writing, I have not been able
to chase these down.
Note that the tests that expose these race conditions are in testpar/t_subfiling_vfd.c, and
are currently skipped. Unskip these tests to reproduce the race conditions.
tested (to the extent possible) debug/parallel on charis and jelly.
* Committing clang-format changes
* fixed H5MM_free
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Move Subfiling VFD components into H5FDsubfiling source directory
* Update Autotools build and add H5_HAVE_SUBFILING_VFD macro to H5pubconf.h
* Tidy up CMake build of subfiling sources
* Merge branch 'develop' into feature/subfiling (#1539)
Merge branch 'develop' into feature/subfiling
* Add VFD interface version field to Subfiling and IOC VFDs
* Merge branch 'develop' into feature/subfiling (#1557)
Merge branch 'develop' into feature/subfiling
* Merge branch 'develop' into feature/subfiling (#1563)
Merge branch 'develop' into feature/subfiling
* Tidy up merge artifacts after rebase on develop
* Fix incorrect variable in mirror VFD utils CMake
* Ensure VFD values are always defined
* Add subfiling to CMake VFD_LIST if built
* Mark MPI I/O driver self-initialization global as static
* Add Subfiling VFD to predefined VFDs for HDF5_DRIVER env. variable
* Initial progress towards separating private vs. public subfiling code
* include libgen.h in t_vfd tests for correct dirname/basename
* Committing clang-format changes
* removed mercury option, included subfiling header path (#1577)
Added subfiling status to configure output, installed h5fuse.sh to build directory for use in future tests.
* added check for stdatomic.h (#1578)
* added check for stdatomic.h with subfiling
* added H5_HAVE_SUBFILING_VFD for cmake
* fix old-style-definition warning (#1582)
* fix old-style-definition warning
* added test for enable parallel with subfiling VFD (#1586)
Fails if subfiling VFD is not used with parallel support.
* Subfiling/IOC VFD fixes and tidying (#1619)
* Rename CMake option for Subfiling VFD to be consistent with other VFDs
* Miscellaneous Subfiling fixes
Add error message for unset MPI communicator
Support dynamic loading of subfiling VFD with default configuration
* Temporary fix for subfile name issue
* Added subfile checks (#1634)
* added subfile checks
* Feature/subfiling (#1655)
* Subfiling/IOC VFD cleanup
Fix misuse of MPI_COMM_WORLD in IOC VFD
Propagate Subfiling FAPL MPI settings down to IOC FAPL in default
configuration case
Cleanup IOC VFD debugging code
Change sprintf to snprintf in a few places
* Major work on separating Subfiling and IOC VFDs from each other
* Re-write async_completion func to not overuse stack
* Replace usage of MPI_COMM_WORLD with file's actual MPI communicator
* Refactor H5FDsubfile_mpi.c
* Remove empty file H5FDsubfile_mpi.c
* Separate IOC VFD errors to its own error stack
* Committing clang-format changes
* Remove H5TRACE macros from H5FDioc.c
* Integrate H5FDioc_threads.c with IOC error stack
* Fix for subfile name generation
Use number of I/O concentrators from existing subfiling configuration file, if one exists
* Add temporary barrier in "Get EOF" operation to prevent races on EOF
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Fix for retrieval of machine Host ID
* Default to MPI_COMM_WORLD if no MPI params set
* added libs rt and pthreads (#1673)
* added libs rt and pthreads
* Feature/subfiling (#1689)
* More tidying of IOC VFD and subfiling debug code
* Remove old unused log file code
* Clear FID from active file map on failure
* Fix bug in generation of subfile names when truncating file
* Change subfile names to start from 1 instead of 0
* Use long long for user-specified stripe size from environment variable
* Skip 0-sized I/Os in low-level IOC I/O routines
* Don't update EOF on read
* Convert printed warning about data size mismatch to assertion
* Don't add base file address to I/O addresses twice
Base address should already be applied as part of H5FDwrite/read_vector calls
* Account for 0-sized I/O vector entries in subfile write/read functions
* Rewrite init_indep_io for clarity
* Correction for IOC wraparound calculations
* Some corrections to iovec calculations
* Remove temporary barrier on EOF retrieval
* Complete work request queue entry on error instead of skipping over
* Account for stripe size wraparound for sf_col_offset calculation
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Re-write and fix bugs in I/O vector filling routines (#1703)
* Rewrite I/O vector filling routines for clarity
* Fix bug with iovec_fill_last when last I/O size is 0
* added subfiling_dir line read (#1714)
* added subfiling_dir line read and use it
* shellcheck fixes
* I/O request dispatch logic update (#1731)
Short-circuit I/O request dispatch when head of I/O queue is an
in-progress get EOF or truncate operation. This prevents an issue where
a write operation can be dispatched alongside a get EOF/truncate
operation, whereas all I/O requests are supposed to be ineligible for
dispatch until the get EOF/truncate is completed
* h5fuse.sh.in clean-up (#1757)
* Added command-line options
* Committing clang-format changes
* Align with changes from develop
* Mimic MPI I/O VFD for EOF handling
* Initialize context_id field for work request objects
* Use logfile for some debugging information
* Use atomic store to set IOC ready flag
* Use separate communicator for sending file EOF data
Minor IOC cleanup
* Use H5_subfile_fid_to_context to get context ID for file in Subfiling
VFD
* IOVEC calculation fixes
* Updates for debugging code
* Minor fixes for threaded code
* Committing clang-format changes
* Use separate MPI communicator for barrier operations
* Committing clang-format changes
* Rewrite EOF routine to use nonblocking MPI communication
* Committing clang-format changes
* Always dispatch I/O work requests in IOC main loop
* Return distinct MPI communicator to library when requested
* Minor warning cleanup
* Committing clang-format changes
* Generate h5fuse.sh from h5fuse.sh.in in CMake
* Send truncate messages to correct IOC rank
* Committing clang-format changes
* Miscellaneous cleanup
Post some MPI receives before sends
Free some duplicated MPI communicator/Info objects
Remove unnecessary extra MPI_Barrier
* Warning cleanup
* Fix for leaked MPI communicator
* Retrieve file EOF on single rank and bcast it
* Fixes for a few failure paths
* Cleanup of IOC file opens
* Committing clang-format changes
* Use plan MPI_Send for send of EOF messages
* Always check MPI thread support level during Subfiling init
* Committing clang-format changes
* Handle a hang on failure when IOCs can't open subfiles
* Committing clang-format changes
* Refactor file open status consensus check
* Committing clang-format changes
* Fix for MPI_Comm_free being called after MPI_Finalize
* Fix VFD test by setting MPI params before setting subfiling on FAPL
* Update Subfiling VFD error handling and error stack usage
* Improvements for Subfiling logfiles
* Remove prototypes for currently unused routines
* Disable I/O queue stat collecting by default
* Remove unused serialization mutex variable
* Update VFD testing to take subfiling VFD into account
* Fix usage of global subfiling application layout object
* Minor fixes for failure pathways
* Keep track of the number of failures in an IOC I/O queue
* Make sure not to exceed MPI_TAG_UB value for data communication messages
* Committing clang-format changes
* Update for rename of some H5FD 'ctl' opcodes
* Always include Subfiling's public header files in hdf5.h
* Remove old unused code and comments
* Implement support for per-file I/O queues
Allows the subfiling VFD to have multiple HDF5 files open simultaneously
* Use simple MPI_Iprobe over unnecessary MPI_Improbe
* Committing clang-format changes
* Update HDF5 testing to query driver for H5FD_FEAT_DEFAULT_VFD_COMPATIBLE
flag
* Fix a few bugs related to file multi-opens
* Avoid calling MPI routines if subfiling gets reinitialized
* Fix issue when files are closed in a random order
* Update HDF5 testing to query VFD for "using MPI" feature flag
* Register atexit handler in subfiling VFD to call MPI_Finalize after HDF5
closes
* Fail for collective I/O requests until support is implemented
* Correct VOL test function prototypes
* Minor cleanup of old code and comments
* Update mercury dependency
* Cleanup of subfiling configuration structure
* Committing clang-format changes
* Build system updates for Subfiling VFD
* Fix possible hang on failure in t_vfd tests caused by mismatched
MPI_Barrier calls
* Copy subfiling IOC fapl in "fapl get" method
* Mirror subfiling superblock writes to stub file for legacy POSIX-y HDF5
applications
* Allow collective I/O for MPI_BYTE types and rank 0 bcast strategy
* Committing clang-format changes
* Use different scheme for subfiling write message MPI tag calculations
* Committing clang-format changes
* Avoid performing fstat calls on all MPI ranks
* Add MPI_Barrier before finalizing IOC threads
* Use try_lock in I/O queue dispatch to minimize contention from worker threads
* Use simple Waitall for nonblocking I/O waits
* Add configurable IOC main thread delay and try_lock option to I/O queue dispatch
* Fix bug that could cause serialization of non-overlapping I/O requests
* Temporarily treat collective subfiling vector I/O calls as independent
* Removed unused mercury bits
* Add stubs for subfiling and IOC file delete callback
* Update VFD testing for Subfiling VFD
* Work around HDF5 metadata cache bug for Subfiling VFD when MPI Comm size
= 1
* Committing clang-format changes
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
2022-07-23 04:03:12 +08:00
endif ( )
2022-07-27 05:20:16 +08:00
if ( NOT DEFINED Threads_FOUND )
set ( THREADS_PREFER_PTHREAD_FLAG ON )
find_package ( Threads REQUIRED )
endif ( )
# For now, make sure we're using pthreads. Once Subfiling can be
# supported on Windows, we should allow Win32 threads as well
if ( NOT ${ Threads_FOUND } OR NOT ${ CMAKE_USE_PTHREADS_INIT } )
message ( FATAL_ERROR "Subfiling requires pthreads for system thread library" )
endif ( )
Subfiling VFD (#1883)
* Added support for vector I/O calls to the VFD layer, and
associated test code. Note that this includes the optimization
to allow shortened sizes and types arrays to allow more space
efficient representations of vectors in which all entries are
of the same size and/or type. See the Selection I/o RFC for
further details.
Tested serial and parallel, debug and production on Charis.
serial and parallel debug only on Jelly.
* ran code formatter
quick serial build and test on jelly
* Add H5FD_read_selection() and H5FD_write_selection(). Currently only
translate to scalar calls. Fix const buf in H5FD_write_vector().
* Format source
* Fix comments
* Add selection I/O to chunk code, used when: not using chunk cache, no
datatype conversion, no I/O filters, no page buffer, not using collective
I/O. Requires global variable H5_use_selection_io_g be set to TRUE.
Implemented selection to vector I/O transaltion at the file driver
layer.
* Fix formatting unrelated to previous change to stop github from
complaining.
* Add full API support for selection I/O. Add tests for this.
* Implement selection I/O for contiguous datasets. Fix bug in selection
I/O translation. Add const qualifiers to some internal selection I/O
routines to maintain const-correctness while avoiding memcpys.
* Added vector read / write support to the MPIO VFD, with associated
test code (see testpar/t_vfd.c).
Note that this implementation does NOT support vector entries of
size greater than 2 GB. This must be repaired before release,
but it should be good enough for correctness testing.
As MPIO requires vector I/O requests to be sorted in increasing
address order, also added a vector sort utility in H5FDint.c This
function is tested in passing by the MPIO vector I/O extension.
In passing, repaired a bug in size / type vector extension management
in H5FD_read/write_vector()
Tested parallel debug and production on charis and Jelly.
* Ran source code formatter
* Add support for independent parallel I/O with selection I/O. Add
HDF5_USE_SELECTION_IO env var to control selection I/O (default off).
* Implement parallel collective support for selection I/O.
* Fix comments and run formatter.
* Update selection IO branch with develop (#1215)
Merged branch 'develop' into selection_io
* Sync with develop (#1262)
Updated the branch with develop changes.
* Implement big I/O support for vector I/O requests in the MPIO file
driver.
* Free arrays in H5FD__mpio_read/write_vector() as soon as they're not
needed, to cut down on memory usage during I/O.
* Address comments from code review. Fix const warnings with
H5S_SEL_ITER_INIT().
* Committing clang-format changes
* Feature/subfiling (#1464)
* Initial checkin of merged sub-filing VFD.
Passes regression tests (debug/shared/paralle) on Jelly.
However, bugs and many compiler warnings remain -- not suitable
for merge to develop.
* Minor mods to src/H5FDsubfile_mpi.c to address errors reported by autogen.sh
* Code formatting run -- no test
* Merged my subfiling code fixes into the new selection_io_branch
* Forgot to add the FindMERCURY.cmake file. This will probably disappear soon
* attempting to make a more reliable subfile file open which doesn't return errors. For some unknown reason, the regular posix open will occasionally fail to create a subfile. Some better error handling for file close has been added.
* added NULL option for H5FD_subfiling_config_t in H5Pset_fapl_subfiling (#1034)
* NULL option automatically stacks IOC VFD for subfiling and returns a valid fapl.
* added doxygen subfiling APIs
* Various fixes which allow the IOR benchmark to run correctly
* Lots of updates including the packaging up of the mercury_util source files to enable easier builds for our Benchmarking
* Interim checkin of selection_io_with_subfiling_vfd branch
Moddified testpar/t_vfd.c to test the subfiling vfd with default configuration.
Must update this code to run with a variety of configurations -- most particularly
multiple IO concentrators, and stripe depth small enough to test the other IO
concentrators.
testpar/t_vfd.c exposed a large number of race condidtions -- symtoms included:
1) Crashes (usually seg faults)
2) Heap corruption
3) Stack corruption
4) Double frees of heap space
5) Hangs
6) Out of order execution of I/O requests / violations of POSIX semantics
7) Swapped write requests
Items 1 - 4 turned out to be primarily caused by file close issues --
specifically, the main I/O concentrator thread and its pool of worker threads
were not being shut down properly on file close. Addressing this issue in
combination with some other minor fixes seems to have addressed these issues.
Items 5 & 6 appear to have been caused by issue of I/O requests to the
thread pool in an order that did not maintain POSIX semantics. A rewrite of
the I/O request dispatch code appears to have solved these issues.
Item 7 seems to have been caused by multiple write requests from a given
rank being read by the wrong worker thread. Code to issue "unique" tags for
each write request via the ACK message appears to have cleaned this up.
Note that the code is still in poor condtition. A partial list of known
defects includes:
a) Race condiditon on file close that allows superblock writes to arrive
at the I/O concentrator after it has been shutdown. This defect is
most evident when testpar/t_subfiling_vfd is run with 8 ranks.
b) No error reporting from I/O concentrators -- must design and implement
this. For now, mostly just asserts, which suggests that it should be
run in debug mode.
c) Much commented out and/or un-used code.
d) Code orgnaization
e) Build system with bits of Mercury is awkward -- think of shifting
to pthreads with our own thread pool code.
f) Need to add native support for vector and selection I/O to the subfiling
VFD.
g) Need to review, and posibly rework configuration code.
h) Need to store subfile configuration data in a superblock extension message,
and add code to use this data on file open.
i) Test code is inadequate -- expect more issues as it is extended.
In particular, there is no unit test code for the I/O request dispatch code.
While I think it is correct at present, we need test code to verify this.
Similarly, we need to test with multiple I/O concentrators and much smaller
stripe depth.
My actual code changes were limited to:
src/H5FDioc.c
src/H5FDioc_threads.c
src/H5FDsubfile_int.c
src/H5FDsubfile_mpi.c
src/H5FDsubfiling.c
src/H5FDsubfiling.h
src/H5FDsubfiling_priv.h
testpar/t_subfiling_vfd.c
testpar/t_vfd.c
I'm not sure what is going on with the deletions in src/mercury/src/util.
Tested parallel/debug on Charis and Jelly
* subfiling with selection IO (#1219)
Merged branch 'selection_io' into subfiling branch.
* Subfile name fixes (#1250)
* fixed subfiling naming convention, and added leading zero to rank names.
* Merge branch 'selection_io' into selection_io_with_subfiling_vfd (#1265)
* Added script to join subfiles into a single HDF5 file (#1350)
* Modified H5FD__subfiling_query() to report that the sub-filing VFD supports MPI
This exposed issues with truncate and get EOF in the sub-filing VFD.
I believe I have addressed these issues (get EOF not as fully tested as it should be), howeer,
it exposed race conditions resulting in hangs. As of this writing, I have not been able
to chase these down.
Note that the tests that expose these race conditions are in testpar/t_subfiling_vfd.c, and
are currently skipped. Unskip these tests to reproduce the race conditions.
tested (to the extent possible) debug/parallel on charis and jelly.
* Committing clang-format changes
* fixed H5MM_free
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Move Subfiling VFD components into H5FDsubfiling source directory
* Update Autotools build and add H5_HAVE_SUBFILING_VFD macro to H5pubconf.h
* Tidy up CMake build of subfiling sources
* Merge branch 'develop' into feature/subfiling (#1539)
Merge branch 'develop' into feature/subfiling
* Add VFD interface version field to Subfiling and IOC VFDs
* Merge branch 'develop' into feature/subfiling (#1557)
Merge branch 'develop' into feature/subfiling
* Merge branch 'develop' into feature/subfiling (#1563)
Merge branch 'develop' into feature/subfiling
* Tidy up merge artifacts after rebase on develop
* Fix incorrect variable in mirror VFD utils CMake
* Ensure VFD values are always defined
* Add subfiling to CMake VFD_LIST if built
* Mark MPI I/O driver self-initialization global as static
* Add Subfiling VFD to predefined VFDs for HDF5_DRIVER env. variable
* Initial progress towards separating private vs. public subfiling code
* include libgen.h in t_vfd tests for correct dirname/basename
* Committing clang-format changes
* removed mercury option, included subfiling header path (#1577)
Added subfiling status to configure output, installed h5fuse.sh to build directory for use in future tests.
* added check for stdatomic.h (#1578)
* added check for stdatomic.h with subfiling
* added H5_HAVE_SUBFILING_VFD for cmake
* fix old-style-definition warning (#1582)
* fix old-style-definition warning
* added test for enable parallel with subfiling VFD (#1586)
Fails if subfiling VFD is not used with parallel support.
* Subfiling/IOC VFD fixes and tidying (#1619)
* Rename CMake option for Subfiling VFD to be consistent with other VFDs
* Miscellaneous Subfiling fixes
Add error message for unset MPI communicator
Support dynamic loading of subfiling VFD with default configuration
* Temporary fix for subfile name issue
* Added subfile checks (#1634)
* added subfile checks
* Feature/subfiling (#1655)
* Subfiling/IOC VFD cleanup
Fix misuse of MPI_COMM_WORLD in IOC VFD
Propagate Subfiling FAPL MPI settings down to IOC FAPL in default
configuration case
Cleanup IOC VFD debugging code
Change sprintf to snprintf in a few places
* Major work on separating Subfiling and IOC VFDs from each other
* Re-write async_completion func to not overuse stack
* Replace usage of MPI_COMM_WORLD with file's actual MPI communicator
* Refactor H5FDsubfile_mpi.c
* Remove empty file H5FDsubfile_mpi.c
* Separate IOC VFD errors to its own error stack
* Committing clang-format changes
* Remove H5TRACE macros from H5FDioc.c
* Integrate H5FDioc_threads.c with IOC error stack
* Fix for subfile name generation
Use number of I/O concentrators from existing subfiling configuration file, if one exists
* Add temporary barrier in "Get EOF" operation to prevent races on EOF
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Fix for retrieval of machine Host ID
* Default to MPI_COMM_WORLD if no MPI params set
* added libs rt and pthreads (#1673)
* added libs rt and pthreads
* Feature/subfiling (#1689)
* More tidying of IOC VFD and subfiling debug code
* Remove old unused log file code
* Clear FID from active file map on failure
* Fix bug in generation of subfile names when truncating file
* Change subfile names to start from 1 instead of 0
* Use long long for user-specified stripe size from environment variable
* Skip 0-sized I/Os in low-level IOC I/O routines
* Don't update EOF on read
* Convert printed warning about data size mismatch to assertion
* Don't add base file address to I/O addresses twice
Base address should already be applied as part of H5FDwrite/read_vector calls
* Account for 0-sized I/O vector entries in subfile write/read functions
* Rewrite init_indep_io for clarity
* Correction for IOC wraparound calculations
* Some corrections to iovec calculations
* Remove temporary barrier on EOF retrieval
* Complete work request queue entry on error instead of skipping over
* Account for stripe size wraparound for sf_col_offset calculation
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Re-write and fix bugs in I/O vector filling routines (#1703)
* Rewrite I/O vector filling routines for clarity
* Fix bug with iovec_fill_last when last I/O size is 0
* added subfiling_dir line read (#1714)
* added subfiling_dir line read and use it
* shellcheck fixes
* I/O request dispatch logic update (#1731)
Short-circuit I/O request dispatch when head of I/O queue is an
in-progress get EOF or truncate operation. This prevents an issue where
a write operation can be dispatched alongside a get EOF/truncate
operation, whereas all I/O requests are supposed to be ineligible for
dispatch until the get EOF/truncate is completed
* h5fuse.sh.in clean-up (#1757)
* Added command-line options
* Committing clang-format changes
* Align with changes from develop
* Mimic MPI I/O VFD for EOF handling
* Initialize context_id field for work request objects
* Use logfile for some debugging information
* Use atomic store to set IOC ready flag
* Use separate communicator for sending file EOF data
Minor IOC cleanup
* Use H5_subfile_fid_to_context to get context ID for file in Subfiling
VFD
* IOVEC calculation fixes
* Updates for debugging code
* Minor fixes for threaded code
* Committing clang-format changes
* Use separate MPI communicator for barrier operations
* Committing clang-format changes
* Rewrite EOF routine to use nonblocking MPI communication
* Committing clang-format changes
* Always dispatch I/O work requests in IOC main loop
* Return distinct MPI communicator to library when requested
* Minor warning cleanup
* Committing clang-format changes
* Generate h5fuse.sh from h5fuse.sh.in in CMake
* Send truncate messages to correct IOC rank
* Committing clang-format changes
* Miscellaneous cleanup
Post some MPI receives before sends
Free some duplicated MPI communicator/Info objects
Remove unnecessary extra MPI_Barrier
* Warning cleanup
* Fix for leaked MPI communicator
* Retrieve file EOF on single rank and bcast it
* Fixes for a few failure paths
* Cleanup of IOC file opens
* Committing clang-format changes
* Use plan MPI_Send for send of EOF messages
* Always check MPI thread support level during Subfiling init
* Committing clang-format changes
* Handle a hang on failure when IOCs can't open subfiles
* Committing clang-format changes
* Refactor file open status consensus check
* Committing clang-format changes
* Fix for MPI_Comm_free being called after MPI_Finalize
* Fix VFD test by setting MPI params before setting subfiling on FAPL
* Update Subfiling VFD error handling and error stack usage
* Improvements for Subfiling logfiles
* Remove prototypes for currently unused routines
* Disable I/O queue stat collecting by default
* Remove unused serialization mutex variable
* Update VFD testing to take subfiling VFD into account
* Fix usage of global subfiling application layout object
* Minor fixes for failure pathways
* Keep track of the number of failures in an IOC I/O queue
* Make sure not to exceed MPI_TAG_UB value for data communication messages
* Committing clang-format changes
* Update for rename of some H5FD 'ctl' opcodes
* Always include Subfiling's public header files in hdf5.h
* Remove old unused code and comments
* Implement support for per-file I/O queues
Allows the subfiling VFD to have multiple HDF5 files open simultaneously
* Use simple MPI_Iprobe over unnecessary MPI_Improbe
* Committing clang-format changes
* Update HDF5 testing to query driver for H5FD_FEAT_DEFAULT_VFD_COMPATIBLE
flag
* Fix a few bugs related to file multi-opens
* Avoid calling MPI routines if subfiling gets reinitialized
* Fix issue when files are closed in a random order
* Update HDF5 testing to query VFD for "using MPI" feature flag
* Register atexit handler in subfiling VFD to call MPI_Finalize after HDF5
closes
* Fail for collective I/O requests until support is implemented
* Correct VOL test function prototypes
* Minor cleanup of old code and comments
* Update mercury dependency
* Cleanup of subfiling configuration structure
* Committing clang-format changes
* Build system updates for Subfiling VFD
* Fix possible hang on failure in t_vfd tests caused by mismatched
MPI_Barrier calls
* Copy subfiling IOC fapl in "fapl get" method
* Mirror subfiling superblock writes to stub file for legacy POSIX-y HDF5
applications
* Allow collective I/O for MPI_BYTE types and rank 0 bcast strategy
* Committing clang-format changes
* Use different scheme for subfiling write message MPI tag calculations
* Committing clang-format changes
* Avoid performing fstat calls on all MPI ranks
* Add MPI_Barrier before finalizing IOC threads
* Use try_lock in I/O queue dispatch to minimize contention from worker threads
* Use simple Waitall for nonblocking I/O waits
* Add configurable IOC main thread delay and try_lock option to I/O queue dispatch
* Fix bug that could cause serialization of non-overlapping I/O requests
* Temporarily treat collective subfiling vector I/O calls as independent
* Removed unused mercury bits
* Add stubs for subfiling and IOC file delete callback
* Update VFD testing for Subfiling VFD
* Work around HDF5 metadata cache bug for Subfiling VFD when MPI Comm size
= 1
* Committing clang-format changes
Co-authored-by: mainzer <mainzer#hdfgroup.org>
Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com>
Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org>
Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
2022-07-23 04:03:12 +08:00
CHECK_INCLUDE_FILE ( "stdatomic.h" HAVE_STDATOMIC_H )
if ( NOT HAVE_STDATOMIC_H )
message ( FATAL_ERROR "Subfiling VFD requires atomic operations support. C11 stdatomic.h NOT available." )
else ( )
set ( H5_HAVE_STDATOMIC_H 1 )
endif ( )
set ( H5_HAVE_SUBFILING_VFD 1 )
# IOC VFD is currently only built when subfiling is enabled
set ( H5_HAVE_IOC_VFD 1 )
message ( STATUS "Setting up to use Mercury components" )
set ( H5FD_SUBFILING_MERCURY_DIR ${ H5FD_SUBFILING_DIR } /mercury/src/util )
set ( HDF5_SRC_INCLUDE_DIRS
$ { H D F 5 _ S R C _ I N C L U D E _ D I R S }
$ { H 5 F D _ S U B F I L I N G _ M E R C U R Y _ D I R }
)
set ( H5_HAVE_MERCURY_H 1 )
set ( CMAKE_REQUIRED_INCLUDES "${H5FD_SUBFILING_MERCURY_DIR}" )
endif ( )
2019-09-26 06:28:17 +08:00
#option (DEFAULT_API_VERSION "Enable v1.14 API (v16, v18, v110, v112, v114)" "v114")
set ( DEFAULT_API_VERSION "v114" CACHE STRING "Enable v1.14 API (v16, v18, v110, v112, v114)" )
set_property ( CACHE DEFAULT_API_VERSION PROPERTY STRINGS v16 v18 v110 v112 v114 )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Option to use 1.6.x API
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
set ( H5_USE_16_API_DEFAULT 0 )
2019-08-13 01:45:29 +08:00
if ( DEFAULT_API_VERSION MATCHES "v16" )
2014-03-12 05:14:57 +08:00
set ( H5_USE_16_API_DEFAULT 1 )
2017-01-11 07:09:53 +08:00
endif ( )
2010-05-14 00:01:50 +08:00
2011-08-04 23:21:15 +08:00
#-----------------------------------------------------------------------------
# Option to use 1.8.x API
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
set ( H5_USE_18_API_DEFAULT 0 )
2019-08-13 01:45:29 +08:00
if ( DEFAULT_API_VERSION MATCHES "v18" )
2014-03-12 05:14:57 +08:00
set ( H5_USE_18_API_DEFAULT 1 )
2017-01-11 07:09:53 +08:00
endif ( )
2011-08-04 23:21:15 +08:00
2018-08-18 03:48:43 +08:00
#-----------------------------------------------------------------------------
# Option to use 1.10.x API
#-----------------------------------------------------------------------------
set ( H5_USE_110_API_DEFAULT 0 )
2019-08-13 01:45:29 +08:00
if ( DEFAULT_API_VERSION MATCHES "v110" )
2018-08-18 03:48:43 +08:00
set ( H5_USE_110_API_DEFAULT 1 )
endif ( )
#-----------------------------------------------------------------------------
# Option to use 1.12.x API
#-----------------------------------------------------------------------------
2019-08-13 01:45:29 +08:00
if ( NOT DEFAULT_API_VERSION )
set ( DEFAULT_API_VERSION "v112" )
2019-08-13 00:24:36 +08:00
endif ( )
2018-08-18 03:48:43 +08:00
set ( H5_USE_112_API_DEFAULT 0 )
2019-08-13 01:45:29 +08:00
if ( DEFAULT_API_VERSION MATCHES "v112" )
2018-08-18 03:48:43 +08:00
set ( H5_USE_112_API_DEFAULT 1 )
endif ( )
2013-06-11 01:46:48 +08:00
#-----------------------------------------------------------------------------
2019-09-26 06:28:17 +08:00
# Option to use 1.14.x API
#-----------------------------------------------------------------------------
if ( NOT DEFAULT_API_VERSION )
set ( DEFAULT_API_VERSION "v114" )
endif ( )
set ( H5_USE_114_API_DEFAULT 0 )
if ( DEFAULT_API_VERSION MATCHES "v114" )
set ( H5_USE_114_API_DEFAULT 1 )
endif ( )
#-----------------------------------------------------------------------------
2013-06-11 01:46:48 +08:00
# Include user macros
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
include ( UserMacros.cmake )
2013-06-11 01:46:48 +08:00
2015-03-18 02:59:19 +08:00
#-----------------------------------------------------------------------------
# Include filter (zlib, szip, etc.) macros
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
include ( CMakeFilters.cmake )
2010-05-14 00:01:50 +08:00
2010-09-03 05:00:43 +08:00
#-----------------------------------------------------------------------------
# Option for external libraries on windows
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
option ( HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF )
if ( NOT HDF5_EXTERNALLY_CONFIGURED )
if ( HDF5_PACKAGE_EXTLIBS )
set ( HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE )
if ( HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND )
2011-12-21 00:11:07 +08:00
PACKAGE_ZLIB_LIBRARY ( ${ HDF5_ALLOW_EXTERNAL_SUPPORT } )
2017-01-11 07:09:53 +08:00
endif ( )
2015-05-15 00:51:20 +08:00
2014-03-12 05:14:57 +08:00
if ( HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND )
2011-12-21 00:11:07 +08:00
PACKAGE_SZIP_LIBRARY ( ${ HDF5_ALLOW_EXTERNAL_SUPPORT } )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
endif ( )
2019-08-13 16:36:42 +08:00
2010-09-11 00:15:34 +08:00
#-----------------------------------------------------------------------------
# Option to use threadsafe
#-----------------------------------------------------------------------------
2015-10-27 04:09:22 +08:00
option ( HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF )
if ( HDF5_ENABLE_THREADSAFE )
# check for unsupported options
2020-10-30 20:09:23 +08:00
if ( WIN32 )
2022-09-03 08:31:29 +08:00
message ( VERBOSE " **** thread-safety option not supported with static library **** " )
message ( VERBOSE " **** thread-safety option will not be used building static library **** " )
2019-02-22 06:39:37 +08:00
endif ( )
2015-10-27 04:09:22 +08:00
if ( HDF5_BUILD_FORTRAN )
if ( NOT ALLOW_UNSUPPORTED )
2020-04-25 05:23:28 +08:00
message ( FATAL_ERROR " **** Fortran and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** " )
2017-01-11 07:09:53 +08:00
else ( )
2022-09-03 08:31:29 +08:00
message ( VERBOSE " **** Allowing unsupported Fortran and thread-safety options **** " )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2015-10-27 04:09:22 +08:00
if ( HDF5_BUILD_CPP_LIB )
if ( NOT ALLOW_UNSUPPORTED )
2020-04-25 05:23:28 +08:00
message ( FATAL_ERROR " **** C++ and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** " )
2017-01-11 07:09:53 +08:00
else ( )
2022-09-03 08:31:29 +08:00
message ( VERBOSE " **** Allowing unsupported C++ and thread-safety options **** " )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2015-10-27 04:09:22 +08:00
if ( HDF5_BUILD_HL_LIB )
if ( NOT ALLOW_UNSUPPORTED )
2020-04-25 05:23:28 +08:00
message ( FATAL_ERROR " **** HL and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** " )
2017-01-11 07:09:53 +08:00
else ( )
2022-09-03 08:31:29 +08:00
message ( VERBOSE " **** Allowing unsupported HL and thread-safety options **** " )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2015-10-27 04:09:22 +08:00
if ( H5_HAVE_IOEO )
2022-09-03 08:31:29 +08:00
message ( VERBOSE " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** " )
2015-10-27 04:09:22 +08:00
set ( H5_HAVE_WIN_THREADS 1 )
2017-01-11 07:09:53 +08:00
else ( )
2015-10-27 04:09:22 +08:00
if ( NOT H5_HAVE_PTHREAD_H )
message ( FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** " )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2020-01-29 03:14:59 +08:00
set ( THREADS_PREFER_PTHREAD_FLAG ON )
find_package ( Threads REQUIRED )
2019-02-22 06:39:37 +08:00
if ( Threads_FOUND )
set ( H5_HAVE_THREADSAFE 1 )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2010-09-11 00:15:34 +08:00
2019-08-13 16:36:42 +08:00
#-----------------------------------------------------------------------------
# Option to build the map API
#-----------------------------------------------------------------------------
option ( HDF5_ENABLE_MAP_API "Build the map API" OFF )
2019-08-13 23:53:09 +08:00
if ( HDF5_ENABLE_MAP_API )
set ( H5_HAVE_MAP_API 1 )
endif ( )
2019-08-13 16:36:42 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Add the HDF5 Library Target to the build
#-----------------------------------------------------------------------------
2018-01-31 02:21:01 +08:00
add_subdirectory ( src )
2010-05-14 00:01:50 +08:00
2017-09-14 03:57:55 +08:00
if ( HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ" )
2014-03-12 05:14:57 +08:00
if ( ZLIB_FOUND AND ZLIB_USE_EXTERNAL )
2019-06-18 20:46:25 +08:00
if ( NOT ONLY_SHARED_LIBS )
2022-02-18 00:05:08 +08:00
add_dependencies ( ${ HDF5_LIB_TARGET } HDF5_ZLIB )
2019-06-18 20:46:25 +08:00
endif ( )
2015-08-06 05:01:07 +08:00
if ( BUILD_SHARED_LIBS )
2022-02-18 00:05:08 +08:00
add_dependencies ( ${ HDF5_LIBSH_TARGET } HDF5_ZLIB )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2014-03-12 05:14:57 +08:00
if ( SZIP_FOUND AND SZIP_USE_EXTERNAL )
2019-06-18 20:46:25 +08:00
if ( NOT ONLY_SHARED_LIBS )
add_dependencies ( ${ HDF5_LIB_TARGET } SZIP )
endif ( )
2015-08-06 05:01:07 +08:00
if ( BUILD_SHARED_LIBS )
add_dependencies ( ${ HDF5_LIBSH_TARGET } SZIP )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
endif ( )
2010-09-29 03:02:51 +08:00
2021-09-10 20:40:27 +08:00
#-----------------------------------------------------------------------------
# Option to build documentation
#-----------------------------------------------------------------------------
option ( HDF5_BUILD_DOC "Build documentation" OFF )
if ( HDF5_BUILD_DOC AND EXISTS "${HDF5_DOXYGEN_DIR}" AND IS_DIRECTORY "${HDF5_DOXYGEN_DIR}" )
# check if Doxygen is installed
find_package ( Doxygen )
if ( DOXYGEN_FOUND )
message ( STATUS "Doxygen version: ${DOXYGEN_VERSION}" )
add_subdirectory ( doxygen )
else ( )
message ( STATUS "Doxygen needs to be installed to generate the doxygen documentation" )
endif ( )
endif ( )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
#-----------------------------------------------------------------------------
2015-04-16 00:59:11 +08:00
option ( BUILD_TESTING "Build HDF5 Unit Testing" ON )
2014-03-12 05:14:57 +08:00
if ( BUILD_TESTING )
set ( DART_TESTING_TIMEOUT 1200
2019-04-03 01:30:16 +08:00
C A C H E S T R I N G
2010-08-10 01:20:38 +08:00
" T i m e o u t i n s e c o n d s f o r e a c h test ( default 1200=20minutes ) "
)
2015-09-01 04:08:56 +08:00
2019-02-07 06:41:58 +08:00
# Generate a list of timeouts based on DART_TESTING_TIMEOUT
math ( EXPR CTEST_SHORT_TIMEOUT "${DART_TESTING_TIMEOUT} / 2" )
math ( EXPR CTEST_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 2" )
math ( EXPR CTEST_VERY_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 3" )
2015-09-01 04:08:56 +08:00
option ( HDF5_TEST_VFD "Execute tests with different VFDs" OFF )
mark_as_advanced ( HDF5_TEST_VFD )
if ( HDF5_TEST_VFD )
option ( HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON )
mark_as_advanced ( HDF5_TEST_FHEAP_VFD )
2021-10-26 10:17:23 +08:00
# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
H5_SET_VFD_LIST ( )
2017-01-11 07:09:53 +08:00
endif ( )
2015-09-01 04:08:56 +08:00
2019-04-12 02:27:12 +08:00
option ( HDF5_TEST_PASSTHROUGH_VOL "Execute tests with different passthrough VOL connectors" OFF )
mark_as_advanced ( HDF5_TEST_PASSTHROUGH_VOL )
if ( HDF5_TEST_PASSTHROUGH_VOL )
option ( HDF5_TEST_FHEAP_PASSTHROUGH_VOL "Execute fheap test with different passthrough VOL connectors" ON )
mark_as_advanced ( HDF5_TEST_FHEAP_PASSTHROUGH VOL )
2018-12-21 05:11:17 +08:00
endif ( )
2022-05-18 00:54:05 +08:00
set ( H5_TEST_EXPRESS_LEVEL_DEFAULT "3" )
set ( HDF_TEST_EXPRESS "${H5_TEST_EXPRESS_LEVEL_DEFAULT}"
C A C H E S T R I N G " C o n t r o l t e s t i n g framework ( 0-3 ) ( 0 = e x h a u s t i v e t e s t i n g ; 3 = q u i c k e r t e s t i n g ) " )
2015-09-01 04:08:56 +08:00
mark_as_advanced ( HDF_TEST_EXPRESS )
2022-05-18 00:54:05 +08:00
if ( NOT "${HDF_TEST_EXPRESS}" STREQUAL "" )
set ( H5_TEST_EXPRESS_LEVEL_DEFAULT "${HDF_TEST_EXPRESS}" )
endif ( )
2015-09-01 04:08:56 +08:00
2014-03-19 00:21:46 +08:00
enable_testing ( )
2014-03-12 05:14:57 +08:00
include ( CTest )
2015-09-01 04:08:56 +08:00
2015-09-04 02:28:47 +08:00
include ( ${ HDF5_SOURCE_DIR } /CTestConfig.cmake )
configure_file ( ${ HDF_RESOURCES_DIR } /CTestCustom.cmake ${ HDF5_BINARY_DIR } /CTestCustom.ctest @ONLY )
2020-01-16 01:38:06 +08:00
option ( HDF5_TEST_SERIAL "Execute non-parallel tests" ON )
mark_as_advanced ( HDF5_TEST_SERIAL )
option ( HDF5_TEST_TOOLS "Execute tools tests" ON )
mark_as_advanced ( HDF5_TEST_TOOLS )
option ( HDF5_TEST_EXAMPLES "Execute tests on examples" ON )
mark_as_advanced ( HDF5_TEST_EXAMPLES )
option ( HDF5_TEST_SWMR "Execute SWMR tests" ON )
mark_as_advanced ( HDF5_TEST_SWMR )
option ( HDF5_TEST_PARALLEL "Execute parallel tests" ON )
mark_as_advanced ( HDF5_TEST_PARALLEL )
option ( HDF5_TEST_FORTRAN "Execute fortran tests" ON )
mark_as_advanced ( HDF5_TEST_FORTRAN )
option ( HDF5_TEST_CPP "Execute cpp tests" ON )
mark_as_advanced ( HDF5_TEST_CPP )
option ( HDF5_TEST_JAVA "Execute java tests" ON )
mark_as_advanced ( HDF5_TEST_JAVA )
2014-03-12 05:14:57 +08:00
if ( NOT HDF5_EXTERNALLY_CONFIGURED )
if ( EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test" )
2018-01-31 02:21:01 +08:00
add_subdirectory ( test )
2017-01-11 07:09:53 +08:00
endif ( )
2014-03-12 05:14:57 +08:00
if ( H5_HAVE_PARALLEL )
if ( EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar" )
2018-01-31 02:21:01 +08:00
add_subdirectory ( testpar )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
endif ( )
endif ( )
2010-05-14 00:01:50 +08:00
2020-03-14 06:13:17 +08:00
#-----------------------------------------------------------------------------
# Option to build HDF5 Utilities
#-----------------------------------------------------------------------------
if ( EXISTS "${HDF5_SOURCE_DIR}/utils" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/utils" )
2021-11-30 05:25:23 +08:00
option ( HDF5_BUILD_PARALLEL_TOOLS "Build Parallel HDF5 Tools" OFF )
if ( HDF5_BUILD_PARALLEL_TOOLS AND HDF5_ENABLE_PARALLEL )
set ( CMAKE_PREFIX_PATH "$HDF_RESOURCES_DIR" )
find_package ( MFU REQUIRED )
if ( MFU_FOUND )
message ( STATUS "LL_PATH=${LL_PATH}" )
set ( H5_HAVE_LIBMFU 1 )
set ( H5_HAVE_MFU_H 1 )
set ( CMAKE_REQUIRED_INCLUDES "${MFU_INCLUDE_DIR}" )
set ( MFU_LIBRARY_DEBUG "$MFU_LIBRARY" )
set ( MFU_LIBRARY_RELEASE "$MFU_LIBRARY" )
endif ( )
find_package ( CIRCLE REQUIRED )
if ( CIRCLE_FOUND )
set ( H5_HAVE_LIBCIRCLE 1 )
set ( H5_HAVE_CIRCLE_H 1 )
set ( CMAKE_REQUIRED_INCLUDES "${CIRCLE_INCLUDE_DIR}" )
endif ( )
find_package ( DTCMP REQUIRED )
if ( DTCMP_FOUND )
set ( H5_HAVE_LIBDTCMP 1 )
set ( H5_HAVE_DTCMP_H 1 )
set ( CMAKE_REQUIRED_INCLUDES "${DTCMP_INCLUDE_DIR}" )
endif ( )
endif ( )
2021-10-20 21:25:06 +08:00
add_subdirectory ( utils )
2020-03-14 06:13:17 +08:00
endif ( )
2015-04-29 05:32:17 +08:00
#-----------------------------------------------------------------------------
# Option to build HDF5 Tools
#-----------------------------------------------------------------------------
if ( EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools" )
option ( HDF5_BUILD_TOOLS "Build HDF5 Tools" ON )
if ( HDF5_BUILD_TOOLS )
2018-01-31 02:21:01 +08:00
add_subdirectory ( tools )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2015-04-29 05:32:17 +08:00
2015-03-18 02:59:19 +08:00
#-----------------------------------------------------------------------------
2020-12-17 01:59:51 +08:00
# Include filter plugins
#-----------------------------------------------------------------------------
include ( CMakePlugins.cmake )
if ( HDF5_PACKAGE_EXTLIBS AND NOT HDF5_NO_PACKAGES )
if ( HDF5_ENABLE_PLUGIN_SUPPORT AND PLUGIN_FOUND )
PACKAGE_PLUGIN_LIBRARY ( ${ HDF5_ALLOW_EXTERNAL_SUPPORT } )
# option (HDF5_TEST_PLUGIN "Execute plugin tests" ON)
# mark_as_advanced (HDF5_TEST_PLUGIN)
# TEST_PLUGIN_LIBRARY ()
endif ( )
endif ( )
#-----------------------------------------------------------------------------
2015-03-18 02:59:19 +08:00
# Option to build examples
#-----------------------------------------------------------------------------
if ( EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples" )
option ( HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON )
if ( HDF5_BUILD_EXAMPLES )
2018-01-31 02:21:01 +08:00
add_subdirectory ( examples )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2015-03-18 02:59:19 +08:00
#-----------------------------------------------------------------------------
# Option to build High Level API's
#-----------------------------------------------------------------------------
if ( EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl" )
option ( HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON )
if ( HDF5_BUILD_HL_LIB )
set ( H5_INCLUDE_HL 1 )
2018-01-31 02:21:01 +08:00
add_subdirectory ( hl )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2015-03-18 02:59:19 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Option to build Fortran bindings/tests/examples
# Make sure this appears before the CONFIGURE_FILE step
# so that fortran name mangling is detected before writing H5pubconf.h
#-----------------------------------------------------------------------------
2010-08-11 23:06:50 +08:00
# Set default name mangling : overridden by Fortran detection in fortran dir
2014-03-12 05:14:57 +08:00
set ( H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _" )
set ( H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _" )
if ( EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran" )
option ( HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF )
if ( HDF5_BUILD_FORTRAN )
2022-08-19 22:54:42 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDFUseFortran.cmake )
2015-09-04 02:28:47 +08:00
2022-09-03 08:31:29 +08:00
message ( VERBOSE "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}" )
2020-04-06 02:38:04 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDFFortranCompilerFlags.cmake )
2015-08-11 22:35:30 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDF5UseFortran.cmake )
2017-11-02 23:25:22 +08:00
set ( LINK_Fortran_LIBS ${ LINK_LIBS } )
2015-09-04 02:28:47 +08:00
2019-02-07 01:02:16 +08:00
if ( NOT H5_FORTRAN_HAVE_ISO_C_BINDING )
2019-02-07 00:10:46 +08:00
message ( FATAL_ERROR " **** Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, disable HDF5_BUILD_FORTRAN **** " )
2017-02-18 02:43:47 +08:00
endif ( )
# Parallel IO usage requires MPI to be Linked and Included
if ( H5_HAVE_PARALLEL )
2022-10-07 00:08:56 +08:00
find_package ( MPI REQUIRED COMPONENTS Fortran )
2017-11-02 23:25:22 +08:00
set ( LINK_Fortran_LIBS ${ LINK_Fortran_LIBS } ${ MPI_Fortran_LIBRARIES } )
2017-02-18 02:43:47 +08:00
if ( MPI_Fortran_LINK_FLAGS )
set ( CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
endif ( )
2017-01-11 07:09:53 +08:00
endif ( )
2012-06-14 04:59:24 +08:00
2020-07-10 02:03:58 +08:00
#option (HDF5_INSTALL_MOD_FORTRAN "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" "NO")
set ( HDF5_INSTALL_MOD_FORTRAN "SHARED" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" )
set_property ( CACHE HDF5_INSTALL_MOD_FORTRAN PROPERTY STRINGS NO SHARED STATIC )
if ( NOT HDF5_INSTALL_MOD_FORTRAN MATCHES "NO" )
if ( NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS )
set ( HDF5_INSTALL_MOD_FORTRAN "STATIC" )
elseif ( BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS )
set ( HDF5_INSTALL_MOD_FORTRAN "SHARED" )
endif ( )
endif ( )
2018-01-31 02:21:01 +08:00
add_subdirectory ( fortran )
2014-03-12 05:14:57 +08:00
if ( HDF5_BUILD_HL_LIB )
if ( EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran" )
2010-08-11 23:06:50 +08:00
#-- Build the High Level Fortran source codes
2018-01-31 02:21:01 +08:00
add_subdirectory ( hl/fortran )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
endif ( )
endif ( )
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Option to build HDF5 C++ Library
#-----------------------------------------------------------------------------
2014-03-12 05:14:57 +08:00
if ( EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++" )
2021-04-20 19:55:05 +08:00
option ( HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF )
2014-03-12 05:14:57 +08:00
if ( HDF5_BUILD_CPP_LIB )
2010-11-16 00:35:29 +08:00
# check for unsupported options
2014-03-12 05:14:57 +08:00
if ( HDF5_ENABLE_PARALLEL )
2015-08-27 00:48:42 +08:00
if ( NOT ALLOW_UNSUPPORTED )
2020-04-25 05:23:28 +08:00
message ( FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, override with ALLOW_UNSUPPORTED option **** " )
2017-01-11 07:09:53 +08:00
else ( )
2022-09-03 08:31:29 +08:00
message ( VERBOSE " **** Allowing unsupported Parallel and C++ options **** " )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2018-04-25 06:22:55 +08:00
2020-04-06 02:38:04 +08:00
include ( ${ HDF_RESOURCES_DIR } /HDFCXXCompilerFlags.cmake )
2018-04-25 06:22:55 +08:00
2018-01-31 02:21:01 +08:00
add_subdirectory ( c++ )
2015-03-18 02:59:19 +08:00
if ( HDF5_BUILD_HL_LIB )
if ( EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++" )
#-- Build the High Level Fortran source codes
2018-01-31 02:21:01 +08:00
add_subdirectory ( hl/c++ )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
endif ( )
endif ( )
2010-05-14 00:01:50 +08:00
2014-07-25 01:07:08 +08:00
#-----------------------------------------------------------------------------
2015-05-15 00:51:20 +08:00
# Check if Fortran's default real is double precision. If it is and HL is
2014-07-25 01:07:08 +08:00
# being built then configure should fail due to bug HDFFV-889.
#-----------------------------------------------------------------------------
2016-02-29 10:43:00 +08:00
if ( HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB )
2018-04-25 06:22:55 +08:00
if ( NOT H5_FORTRAN_DEFAULT_REAL_NOT_DOUBLE )
2016-02-29 10:43:00 +08:00
message ( FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** " )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2016-02-29 10:43:00 +08:00
#-----------------------------------------------------------------------------
# Option to build HDF5 Java Library
#-----------------------------------------------------------------------------
if ( EXISTS "${HDF5_SOURCE_DIR}/java" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/java" )
2016-03-01 01:25:27 +08:00
option ( HDF5_BUILD_JAVA "Build Java HDF5 Library" OFF )
2016-02-29 10:43:00 +08:00
if ( HDF5_BUILD_JAVA )
2018-01-31 02:21:01 +08:00
add_subdirectory ( java )
2017-01-11 07:09:53 +08:00
endif ( )
endif ( )
2014-07-25 01:07:08 +08:00
2010-05-14 00:01:50 +08:00
#-----------------------------------------------------------------------------
# Generate the H5pubconf.h file containing user settings needed by compilation
#-----------------------------------------------------------------------------
2020-09-26 05:43:57 +08:00
configure_file ( ${ HDF_RESOURCES_DIR } /H5pubconf.h.in ${ HDF5_SRC_BINARY_DIR } /H5pubconf.h @ONLY )
2010-05-14 00:01:50 +08:00
2018-10-20 02:34:31 +08:00
#-----------------------------------------------------------------------------
# Options for use by cross compiling and toolchains
#-----------------------------------------------------------------------------
option ( HDF5_USE_PREGEN "Use pre-generated Files" OFF )
option ( HDF5_BATCH_H5DETECT "Use a batch command for running h5detect" OFF )
2014-03-12 05:14:57 +08:00
include ( CMakeInstallation.cmake )