Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc_api::restore_state() is defined, it is used in SafetyChecker::restore_state()...
[simgrid.git] / src / mc / checker / SafetyChecker.cpp
index 3a9711444f0ca076e0ae17da4ecab1ca416cc36d..9ba128fedbc5f2d68a82dffdcaf69cc728db7cf0 100644 (file)
@@ -67,8 +67,7 @@ std::vector<std::string> SafetyChecker::get_textual_trace() // override
   for (auto const& state : stack_) {
     int value         = state->transition_.argument_;
     smx_simcall_t req = &state->executed_req_;
-    if (req)
-      trace.push_back(mcapi::get().request_to_string(req, value, RequestType::executed));
+    trace.push_back(mcapi::get().request_to_string(req, value, RequestType::executed));
   }
   return trace;
 }
@@ -152,7 +151,7 @@ void SafetyChecker::run()
     /* If this is a new state (or if we don't care about state-equality reduction) */
     if (visited_state_ == nullptr) {
       /* Get an enabled process and insert it in the interleave set of the next state */
-      auto actors = mcapi::get().mc_get_remote_simulation().actors();
+      auto actors = mcapi::get().get_actors(); 
       for (auto& remoteActor : actors) {
         auto actor = remoteActor.copy.get_buffer();
         if (mcapi::get().actor_is_enabled(actor->get_pid())) {
@@ -197,7 +196,7 @@ void SafetyChecker::backtrack()
     stack_.pop_back();
     if (reductionMode_ == ReductionMode::dpor) {
       smx_simcall_t req = &state->internal_req_;
-      if (req->call_ == SIMCALL_MUTEX_LOCK || req->call_ == SIMCALL_MUTEX_TRYLOCK)
+      if (req->call_ == simix::Simcall::MUTEX_LOCK || req->call_ == simix::Simcall::MUTEX_TRYLOCK)
         xbt_die("Mutex is currently not supported with DPOR,  use --cfg=model-check/reduction:none");
 
       const kernel::actor::ActorImpl* issuer = mcapi::get().mc_smx_simcall_get_issuer(req);
@@ -252,7 +251,7 @@ void SafetyChecker::restore_state()
   /* Intermediate backtracking */
   const State* last_state = stack_.back().get();
   if (last_state->system_state_) {
-    last_state->system_state_->restore(&mcapi::get().mc_get_remote_simulation());
+    mc_api::get().restore_state(last_state->system_state_);
     return;
   }