Skip to content

Commit

Permalink
cmake: Allow building ADIOS with MPI using a serial HDF5
Browse files Browse the repository at this point in the history
The HDF5 IO engine now uses MPI optionally.  Support is enabled at
runtime when the application creates an ADIOS factory with a MPI
communicator.  This option is available only if HDF5 was built with MPI
support.  Therefore we can now optionally build ADIOS with MPI support
using a HDF5 *without* MPI support and adapt functionality accordingly.

Update the build system to support this combination.
  • Loading branch information
bradking committed Feb 11, 2020
1 parent c1eb780 commit 5b2262d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,13 @@ endif()
# HDF5
if(ADIOS2_USE_HDF5 STREQUAL AUTO)
find_package(HDF5 COMPONENTS C)
if(HDF5_FOUND AND
((ADIOS2_HAVE_MPI AND HDF5_IS_PARALLEL) OR
(NOT ADIOS2_HAVE_MPI AND NOT HDF5_IS_PARALLEL)))
if(HDF5_FOUND AND (NOT HDF5_IS_PARALLEL OR ADIOS2_HAVE_MPI))
set(ADIOS2_HAVE_HDF5 TRUE)
endif()
elseif(ADIOS2_USE_HDF5)
find_package(HDF5 REQUIRED COMPONENTS C)
if(ADIOS2_HAVE_MPI)
if(NOT HDF5_IS_PARALLEL)
message(FATAL_ERROR "MPI is enabled but serial HDF5 is detected.")
endif()
else()
if(HDF5_IS_PARALLEL)
message(FATAL_ERROR "MPI is disabled but parallel HDF5 is detected.")
endif()
if(HDF5_IS_PARALLEL AND NOT ADIOS2_HAVE_MPI)
message(FATAL_ERROR "MPI is disabled but parallel HDF5 is detected.")
endif()
set(ADIOS2_HAVE_HDF5 TRUE)
endif()
Expand Down

0 comments on commit 5b2262d

Please sign in to comment.