8 #include "CheckpointerDataInterface.hpp" 12 Response::Status CheckpointerDataInterface::respond(std::shared_ptr<BaseMessage const> message) {
13 auto status = Response::NO_ACTION;
14 if (message ==
nullptr) {
19 std::dynamic_pointer_cast<RegisterDataMessage<Checkpointer>
const>(message)) {
20 return respondRegisterData(castMessage);
24 std::dynamic_pointer_cast<ReadStateFromCheckpointMessage<Checkpointer>
const>(
26 return respondReadStateFromCheckpoint(castMessage);
30 std::dynamic_pointer_cast<ProcessCheckpointReadMessage const>(message)) {
31 return respondProcessCheckpointRead(castMessage);
35 std::dynamic_pointer_cast<PrepareCheckpointWriteMessage const>(message)) {
36 return respondPrepareCheckpointWrite(castMessage);
43 Response::Status CheckpointerDataInterface::respondRegisterData(
44 std::shared_ptr<RegisterDataMessage<Checkpointer>
const> message) {
45 auto status = registerData(message->mDataRegistry);
47 Fatal() << getDescription() <<
": registerData failed.\n";
52 Response::Status CheckpointerDataInterface::respondReadStateFromCheckpoint(
53 std::shared_ptr<ReadStateFromCheckpointMessage<Checkpointer>
const> message) {
54 return readStateFromCheckpoint(message->mDataRegistry);
57 Response::Status CheckpointerDataInterface::respondProcessCheckpointRead(
58 std::shared_ptr<ProcessCheckpointReadMessage const> message) {
59 return processCheckpointRead();
62 Response::Status CheckpointerDataInterface::respondPrepareCheckpointWrite(
63 std::shared_ptr<PrepareCheckpointWriteMessage const> message) {
64 return prepareCheckpointWrite();
67 Response::Status CheckpointerDataInterface::registerData(Checkpointer *checkpointer) {
69 return Response::NO_ACTION;
72 mMPIBlock = checkpointer->getMPIBlock();
73 checkpointer->addObserver(
this);
74 return Response::SUCCESS;
static bool completed(Status &a)