Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill another mc::api function
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 4 Aug 2022 19:18:33 +0000 (21:18 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 4 Aug 2022 19:18:33 +0000 (21:18 +0200)
src/mc/api.cpp
src/mc/api.hpp
src/mc/explo/DFSExplorer.cpp
src/mc/explo/LivenessChecker.cpp

index b885957..ec477c9 100644 (file)
@@ -81,11 +81,6 @@ std::size_t Api::get_remote_heap_bytes() const
   return heap_bytes_used;
 }
 
-void Api::restore_state(const simgrid::mc::Snapshot* system_state) const
-{
-  system_state->restore(&mc_model_checker->get_remote_process());
-}
-
 bool Api::snapshot_equal(const Snapshot* s1, const Snapshot* s2) const
 {
   return simgrid::mc::snapshot_equal(s1, s2);
index 2a667f7..14ad74a 100644 (file)
@@ -59,9 +59,6 @@ public:
   // REMOTE APIs
   std::size_t get_remote_heap_bytes() const;
 
-  // STATE APIs
-  void restore_state(const Snapshot* system_state) const;
-
   // SNAPSHOT APIs
   bool snapshot_equal(const Snapshot* s1, const Snapshot* s2) const;
   simgrid::mc::Snapshot* take_snapshot(long num_state) const;
index edd9eee..7c55d22 100644 (file)
@@ -246,7 +246,7 @@ void DFSExplorer::restore_state()
   /* If asked to rollback on a state that has a snapshot, restore it */
   State* last_state = stack_.back().get();
   if (const auto* system_state = last_state->get_system_state()) {
-    Api::get().restore_state(system_state);
+    system_state->restore(&get_remote_app().get_remote_process());
     on_restore_system_state_signal(last_state, get_remote_app());
     return;
   }
index 297fd0a..8078fb4 100644 (file)
@@ -101,7 +101,7 @@ void LivenessChecker::replay()
   if (_sg_mc_checkpoint > 0) {
     const Pair* pair = exploration_stack_.back().get();
     if (const auto* system_state = pair->app_state_->get_system_state()) {
-      Api::get().restore_state(system_state);
+      system_state->restore(&get_remote_app().get_remote_process());
       return;
     }
   }