diff --git a/lib/utils/HDFDatabaseMPIO.cpp b/lib/utils/HDFDatabaseMPIO.cpp index 0ffa906a8..5e2d9bc40 100644 --- a/lib/utils/HDFDatabaseMPIO.cpp +++ b/lib/utils/HDFDatabaseMPIO.cpp @@ -17,11 +17,17 @@ namespace CAROM { HDFDatabaseMPIO::HDFDatabaseMPIO() : +#if HDF5_IS_PARALLEL HDFDatabase(), d_rank(-1), d_comm(MPI_COMM_NULL) +#else + HDFDatabase() +#endif {} +#if HDF5_IS_PARALLEL + bool HDFDatabaseMPIO::create( const std::string& file_name, @@ -627,4 +633,6 @@ HDFDatabaseMPIO::writeAttribute( #endif } +#endif + } diff --git a/lib/utils/HDFDatabaseMPIO.h b/lib/utils/HDFDatabaseMPIO.h index f8cfa914b..6686a95fe 100644 --- a/lib/utils/HDFDatabaseMPIO.h +++ b/lib/utils/HDFDatabaseMPIO.h @@ -34,6 +34,7 @@ class HDFDatabaseMPIO : public HDFDatabase virtual ~HDFDatabaseMPIO() {} +#if HDF5_IS_PARALLEL /** * @brief Creates a new HDF5 database file for distributed data * with the supplied name. @@ -416,6 +417,7 @@ class HDFDatabaseMPIO : public HDFDatabase int block_offset_global, int block_size_global, int stride_global); +#endif }; } diff --git a/unit_tests/test_HDFDatabase.cpp b/unit_tests/test_HDFDatabase.cpp index 1fc774051..68b43beb7 100644 --- a/unit_tests/test_HDFDatabase.cpp +++ b/unit_tests/test_HDFDatabase.cpp @@ -33,6 +33,8 @@ TEST(GoogleTestFramework, GoogleTestFrameworkFound) { SUCCEED(); } +#if HDF5_IS_PARALLEL + TEST(HDF5, Test_parallel_writing) { int nproc, rank; @@ -537,6 +539,8 @@ TEST(HDF5, Test_selective_parallel_reading) EXPECT_TRUE(data[d] == d + offsets[rank] * ncol); } +#endif + TEST(BasisGeneratorIO, HDFDatabase) { // Get the rank of this process, and the number of processors.