Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc_api::s_initialize() renamed to mc_api::session_initialize()
[simgrid.git] / src / mc / checker / SafetyChecker.cpp
index 3a97114..f391d1a 100644 (file)
@@ -46,8 +46,8 @@ void SafetyChecker::check_non_termination(const State* current_state)
       auto checker = mcapi::get().mc_get_checker();
       for (auto const& s : checker->get_textual_trace())
         XBT_INFO("  %s", s.c_str());
-      mcapi::get().mc_dump_record_path();
-      mcapi::get().s_log_state();
+      mcapi::get().dump_record_path();
+      mcapi::get().log_state();
 
       throw TerminationError();
     }
@@ -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())) {
@@ -174,7 +173,7 @@ void SafetyChecker::run()
   }
 
   XBT_INFO("No property violation found.");
-  mcapi::get().s_log_state();
+  mcapi::get().log_state();
 }
 
 void SafetyChecker::backtrack()
@@ -197,10 +196,10 @@ 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);
+      const kernel::actor::ActorImpl* issuer = mcapi::get().simcall_get_issuer(req);
       for (auto i = stack_.rbegin(); i != stack_.rend(); ++i) {
         State* prev_state = i->get();
         if (mcapi::get().request_depend(req, &prev_state->internal_req_)) {
@@ -222,14 +221,14 @@ void SafetyChecker::backtrack()
             XBT_DEBUG("Process %p is in done set", req->issuer_);
           break;
         } else if (req->issuer_ == prev_state->internal_req_.issuer_) {
-          XBT_DEBUG("Simcall %s and %s with same issuer", mcapi::get().simix_simcall_name(req->call_),
-                    mcapi::get().simix_simcall_name(prev_state->internal_req_.call_));
+          XBT_DEBUG("Simcall %s and %s with same issuer", mcapi::get().simcall_get_name(req->call_),
+                    mcapi::get().simcall_get_name(prev_state->internal_req_.call_));
           break;
         } else {
-          const kernel::actor::ActorImpl* previous_issuer = mcapi::get().mc_smx_simcall_get_issuer(&prev_state->internal_req_);
+          const kernel::actor::ActorImpl* previous_issuer = mcapi::get().simcall_get_issuer(&prev_state->internal_req_);
           XBT_DEBUG("Simcall %s, process %ld (state %d) and simcall %s, process %ld (state %d) are independent",
-                    mcapi::get().simix_simcall_name(req->call_), issuer->get_pid(), state->num_,
-                    mcapi::get().simix_simcall_name(prev_state->internal_req_.call_), previous_issuer->get_pid(), prev_state->num_);
+                    mcapi::get().simcall_get_name(req->call_), issuer->get_pid(), state->num_,
+                    mcapi::get().simcall_get_name(prev_state->internal_req_.call_), previous_issuer->get_pid(), prev_state->num_);
         }
       }
     }
@@ -252,12 +251,12 @@ 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;
   }
 
   /* Restore the initial state */
-  mcapi::get().s_restore_initial_state();
+  mcapi::get().restore_initial_state();
 
   /* Traverse the stack from the state at position start and re-execute the transitions */
   for (std::unique_ptr<State> const& state : stack_) {
@@ -285,7 +284,7 @@ SafetyChecker::SafetyChecker(Session& s) : Checker(s)
              (reductionMode_ == ReductionMode::none ? "none"
                                                     : (reductionMode_ == ReductionMode::dpor ? "dpor" : "unknown")));
   
-  mcapi::get().s_initialize();  
+  mcapi::get().session_initialize();  
 
   XBT_DEBUG("Starting the safety algorithm");