From 9aa2eaeb9ed9c94f63973cb55f13de256558497c Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 31 Jul 2018 13:42:19 -0500 Subject: Add Autotools and CMake checks for big I/O MPI-3 functions --- CMakeLists.txt | 10 ++++++++++ config/cmake/libhdf5.settings.cmake.in | 1 + configure.ac | 32 ++++++++++++++++++++++++++++++++ src/libhdf5.settings.in | 1 + 4 files changed, 44 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0302f4f..40f8eb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -569,6 +569,16 @@ if (HDF5_ENABLE_PARALLEL) Parallel writes of filtered data will be disabled.") set (PARALLEL_FILTERED_WRITES OFF) endif () + + # Used by big I/O feature + set (LARGE_PARALLEL_IO ON) + CHECK_SYMBOL_EXISTS (MPI_Get_elements_x "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_Get_elements_x) + CHECK_SYMBOL_EXISTS (MPI_Type_size_x "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_Type_size_x) + 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. + Reading/Writing >2GB of data in a single parallel I/O operation will be disabled.") + set (LARGE_PARALLEL_IO OFF) + endif () else () message (STATUS "Parallel libraries not found") endif () diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 8c0de97..6a489e7 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -66,6 +66,7 @@ Features: --------- Parallel HDF5: @HDF5_ENABLE_PARALLEL@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ + Large Parallel I/O: @LARGE_PARALLEL_IO@ High-level library: @HDF5_BUILD_HL_LIB@ Threadsafety: @HDF5_ENABLE_THREADSAFE@ Default API mapping: @DEFAULT_API_VERSION@ diff --git a/configure.ac b/configure.ac index 5dc965e..f7262f5 100644 --- a/configure.ac +++ b/configure.ac @@ -2533,6 +2533,7 @@ AC_SUBST([ADD_PARALLEL_FILES]) ADD_PARALLEL_FILES="no" AC_SUBST([MPE]) MPE=no AC_SUBST([INSTRUMENT_LIBRARY]) INSTRUMENT_LIBRARY=no AC_SUBST([PARALLEL_FILTERED_WRITES]) +AC_SUBST([LARGE_PARALLEL_IO]) if test -n "$PARALLEL"; then ## The 'testpar' directory should participate in the build @@ -2715,6 +2716,34 @@ if test -n "$PARALLEL"; then Parallel writes of filtered data will be disabled.]) PARALLEL_FILTERED_WRITES=no] ) + + ## ---------------------------------------------------------------------- + ## Check for the MPI-3 functions necessary for the big I/O feature. + ## If these are not present, issue a warning that the big I/O feature + ## will be disabled. + ## + AC_MSG_CHECKING([for MPI_Get_elements_x and MPI_Type_size_x functions]) + + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + ]], + [[ + MPI_Count count; + MPI_Init(0, (void *) 0); + MPI_Get_elements_x(0, 0, &count); + MPI_Type_size_x(0, &count); + ]] + )], + [AC_MSG_RESULT([yes]) + LARGE_PARALLEL_IO=yes], + [AC_MSG_RESULT([no]) + AC_MSG_WARN([A simple MPI program using the MPI_Get_elements_x and MPI_Type_size_x functions could not be compiled and linked. + Reading/Writing >2GB of data in a single parallel I/O operation will be disabled.]) + LARGE_PARALLEL_IO=no] + ) + fi ## ---------------------------------------------------------------------- @@ -3008,6 +3037,9 @@ PARALLEL=${PARALLEL:-no} ## Parallel writes to filtered datasets support? PARALLEL_FILTERED_WRITES=${PARALLEL_FILTERED_WRITES:-no} +## >2GB writes in parallel support? +LARGE_PARALLEL_IO=${LARGE_PARALLEL_IO:-no} + ## Compiler with version information. This consists of the full path ## name of the compiler and the reported version number. AC_SUBST([CC_VERSION]) diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index 61fa1eb..531cd00 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -69,6 +69,7 @@ Features: --------- Parallel HDF5: @PARALLEL@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ + Large Parallel I/O: @LARGE_PARALLEL_IO@ High-level library: @HDF5_HL@ Threadsafety: @THREADSAFE@ Default API mapping: @DEFAULT_API_VERSION@ -- cgit v0.12