Skip to content
Snippets Groups Projects
Commit 56c6ff08 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Compiles checkpoint and restore if HDF5 is detected only

parent 41deef32
No related branches found
No related tags found
1 merge request!199Integrate checkpointing
......@@ -2,6 +2,8 @@
CheckpointResumeRepository* CheckpointResumeRepository::m_instance = nullptr;
#ifdef PUGS_HAS_HDF5
void
CheckpointResumeRepository::checkpoint(const ASTNodeDataType& data_type,
const std::string& symbol_name,
......@@ -44,6 +46,8 @@ CheckpointResumeRepository::resume(const ASTNodeDataType& data_type,
}
}
#endif // PUGS_HAS_HDF5
void
CheckpointResumeRepository::create()
{
......
......@@ -6,6 +6,7 @@
#include <utils/HighFivePugsUtils.hpp>
#include <utils/PugsAssert.hpp>
#include <utils/PugsUtils.hpp>
#include <utils/pugs_build_info.hpp>
#include <string>
#include <unordered_map>
......@@ -37,10 +38,12 @@ class CheckpointResumeRepository
const auto [i, inserted] =
m_data_type_checkpointing.insert({data_type_name, std::forward<CheckpointFunction>(checkpoint_function)});
if (not(inserted)) {
// LCOV_EXCL_START
std::ostringstream error_msg;
error_msg << "checkpointing for type '" << rang::fgB::yellow << data_type_name << rang::fg::reset
<< "' has already be defined";
throw UnexpectedError(error_msg.str());
// LCOV_EXCL_STOP
}
}
{
......@@ -50,6 +53,7 @@ class CheckpointResumeRepository
}
}
#ifdef PUGS_HAS_HDF5
void checkpoint(const ASTNodeDataType& data_type,
const std::string& symbol_name,
const EmbeddedData& embedded_data,
......@@ -60,6 +64,7 @@ class CheckpointResumeRepository
EmbeddedData resume(const ASTNodeDataType& data_type,
const std::string& symbol_name,
const HighFive::Group& symbol_table_group) const;
#endif // PUGS_HAS_HDF5
static void create();
......
......@@ -94,6 +94,7 @@ add_executable (unit_tests
test_EscapedString.cpp
test_Exceptions.cpp
test_ExecutionPolicy.cpp
test_Exit.cpp
test_FaceIntegrator.cpp
test_FakeProcessor.cpp
test_ForProcessor.cpp
......
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_all.hpp>
#include <language/utils/Exit.hpp>
// clazy:excludeall=non-pod-global-static
TEST_CASE("Exit", "[language/utils]")
{
language::Exit exit0 = language::Exit{0};
REQUIRE(exit0.code() == 0);
language::Exit exit1{1};
REQUIRE(exit1.code() == 1);
language::Exit exit_move = std::move(exit1);
REQUIRE(exit_move.code() == 1);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment