Skip to content
Snippets Groups Projects
Commit 00995444 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Allow HDF5 to be build in serial or parallel mode

parent 42a6506d
No related branches found
No related tags found
1 merge request!64Creat single adios target
...@@ -36,12 +36,10 @@ ...@@ -36,12 +36,10 @@
#include "engine/adios1/ADIOS1Writer.h" #include "engine/adios1/ADIOS1Writer.h"
#endif #endif
#ifdef ADIOS_HAVE_PHDF5 // external dependencies #ifdef ADIOS_HAVE_HDF5 // external dependencies
#ifdef ADIOS_HAVE_MPI
#include "engine/hdf5/HDF5ReaderP.h" #include "engine/hdf5/HDF5ReaderP.h"
#include "engine/hdf5/HDF5WriterP.h" #include "engine/hdf5/HDF5WriterP.h"
#endif #endif
#endif
namespace adios namespace adios
{ {
...@@ -194,7 +192,7 @@ std::shared_ptr<Engine> ADIOS::Open(const std::string &name, ...@@ -194,7 +192,7 @@ std::shared_ptr<Engine> ADIOS::Open(const std::string &name,
} }
else if (type == "HDF5Writer") // -junmin 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, return std::make_shared<HDF5Writer>(*this, name, accessMode, mpiComm,
method); method);
#else #else
......
...@@ -90,8 +90,10 @@ endif() ...@@ -90,8 +90,10 @@ endif()
if(ADIOS_USE_HDF5) if(ADIOS_USE_HDF5)
find_package(HDF5 REQUIRED) find_package(HDF5 REQUIRED)
if(ADIOS_USE_MPI AND NOT HDF5_IS_PARALLEL) 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.") 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() endif()
target_include_directories(adios2 PRIVATE ${HDF5_INCLUDE_DIRS}) target_include_directories(adios2 PRIVATE ${HDF5_INCLUDE_DIRS})
......
...@@ -78,7 +78,9 @@ void HDF5Writer::Init() ...@@ -78,7 +78,9 @@ void HDF5Writer::Init()
_plist_id = H5Pcreate(H5P_FILE_ACCESS); _plist_id = H5Pcreate(H5P_FILE_ACCESS);
#ifdef ADIOS_HAVE_MPI
H5Pset_fapl_mpio(_plist_id, m_MPIComm, MPI_INFO_NULL); H5Pset_fapl_mpio(_plist_id, m_MPIComm, MPI_INFO_NULL);
#endif
/* /*
* Create a new file collectively and release property list identifier. * Create a new file collectively and release property list identifier.
...@@ -340,8 +342,9 @@ void HDF5Writer::UseHDFWrite(Variable<T> &variable, const T *values, ...@@ -340,8 +342,9 @@ void HDF5Writer::UseHDFWrite(Variable<T> &variable, const T *values,
// Create property list for collective dataset write. // Create property list for collective dataset write.
_plist_id = H5Pcreate(H5P_DATASET_XFER); _plist_id = H5Pcreate(H5P_DATASET_XFER);
#ifdef ADIOS_HAVE_MPI
H5Pset_dxpl_mpio(_plist_id, H5FD_MPIO_COLLECTIVE); H5Pset_dxpl_mpio(_plist_id, H5FD_MPIO_COLLECTIVE);
#endif
herr_t status; herr_t status;
status = status =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment