diff --git a/source/ADIOS.cpp b/source/ADIOS.cpp index 30aac797cd4d6533626106baef0dcab3eeed529b..ac6eb562639c56fd3b43fc904a026e00ce6ca4f8 100644 --- a/source/ADIOS.cpp +++ b/source/ADIOS.cpp @@ -36,12 +36,10 @@ #include "engine/adios1/ADIOS1Writer.h" #endif -#ifdef ADIOS_HAVE_PHDF5 // external dependencies -#ifdef ADIOS_HAVE_MPI +#ifdef ADIOS_HAVE_HDF5 // external dependencies #include "engine/hdf5/HDF5ReaderP.h" #include "engine/hdf5/HDF5WriterP.h" #endif -#endif namespace adios { @@ -194,7 +192,7 @@ std::shared_ptr<Engine> ADIOS::Open(const std::string &name, } else if (type == "HDF5Writer") // -junmin { -#if defined(ADIOS_HAVE_PHDF5) && defined(ADIOS_HAVE_MPI) +#ifdef ADIOS_HAVE_HDF5 return std::make_shared<HDF5Writer>(*this, name, accessMode, mpiComm, method); #else diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index fb4e9725225604ab835ab32e719f5a6797418d08..c3ec1b7e191c563d625d86f80c6276c13f656254 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -90,8 +90,10 @@ endif() if(ADIOS_USE_HDF5) find_package(HDF5 REQUIRED) - if(ADIOS_USE_MPI AND NOT HDF5_IS_PARALLEL) - message(FATAL_ERROR "A sequential version of HDF5 was detected but the parallel version of ADIOS requires a parallel HDF5.") + if(ADIOS_USE_MPI AND (NOT HDF5_IS_PARALLEL)) + message(FATAL_ERROR "A sequential version of HDF5 was detected but the parallel version of ADIOS is being built, which requires a parallel HDF5.") + elseif((NOT ADIOS_USE_MPI) AND HDF5_IS_PARALLEL) + message(FATAL_ERROR "A parallel version of HDF5 was detected but the sequential version of ADIOS is being built, which requires a sequential HDF5.") endif() target_include_directories(adios2 PRIVATE ${HDF5_INCLUDE_DIRS}) diff --git a/source/engine/hdf5/HDF5WriterP.cpp b/source/engine/hdf5/HDF5WriterP.cpp index 05656e2babf1170f368702b2cd0d309d47800a8c..b75a447b4b9383575f58e0e36d9275f2a494bef7 100644 --- a/source/engine/hdf5/HDF5WriterP.cpp +++ b/source/engine/hdf5/HDF5WriterP.cpp @@ -78,7 +78,9 @@ void HDF5Writer::Init() _plist_id = H5Pcreate(H5P_FILE_ACCESS); +#ifdef ADIOS_HAVE_MPI H5Pset_fapl_mpio(_plist_id, m_MPIComm, MPI_INFO_NULL); +#endif /* * Create a new file collectively and release property list identifier. @@ -340,8 +342,9 @@ void HDF5Writer::UseHDFWrite(Variable<T> &variable, const T *values, // Create property list for collective dataset write. _plist_id = H5Pcreate(H5P_DATASET_XFER); +#ifdef ADIOS_HAVE_MPI H5Pset_dxpl_mpio(_plist_id, H5FD_MPIO_COLLECTIVE); - +#endif herr_t status; status =