Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
[simgrid.git] / src / mc / remote / AppSide.cpp
index 7fb6628..2d4dfbe 100644 (file)
@@ -30,8 +30,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_client, mc, "MC client logic");
 
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
 
 std::unique_ptr<AppSide> AppSide::instance_;
 
@@ -75,7 +74,7 @@ AppSide* AppSide::initialize(xbt_dynar_t actors_addr)
              strerror(errno));
 
   s_mc_message_initial_addresses_t message{MessageType::INITIAL_ADDRESSES, mmalloc_preinit(),
-                                           kernel::actor::get_maxpid_addr(), actors_addr};
+                                           kernel::actor::ActorImpl::get_maxpid_addr(), actors_addr};
   xbt_assert(instance_->channel_.send(message) == 0, "Could not send the initial message with addresses.");
 
   instance_->handle_messages();
@@ -95,7 +94,7 @@ void AppSide::handle_deadlock_check(const s_mc_message_t*) const
 }
 void AppSide::handle_simcall_execute(const s_mc_message_simcall_execute_t* message) const
 {
-  kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(message->aid_);
+  kernel::actor::ActorImpl* actor = kernel::EngineImpl::get_instance()->get_actor_by_pid(message->aid_);
   xbt_assert(actor != nullptr, "Invalid pid %ld", message->aid_);
 
   // The client may send some messages to the server while processing the transition
@@ -125,7 +124,7 @@ void AppSide::handle_simcall_execute(const s_mc_message_simcall_execute_t* messa
 
 void AppSide::handle_actor_enabled(const s_mc_message_actor_enabled_t* msg) const
 {
-  bool res = mc::actor_is_enabled(kernel::actor::ActorImpl::by_pid(msg->aid));
+  bool res = mc::actor_is_enabled(kernel::EngineImpl::get_instance()->get_actor_by_pid(msg->aid));
   s_mc_message_int_t answer{MessageType::ACTOR_ENABLED_REPLY, res};
   xbt_assert(channel_.send(answer) == 0, "Could not send ACTOR_ENABLED_REPLY");
 }
@@ -138,8 +137,8 @@ void AppSide::handle_finalize(const s_mc_message_int_t* msg) const
     if (XBT_LOG_ISENABLED(mc_client, xbt_log_priority_debug))
       kernel::EngineImpl::get_instance()->display_all_actor_status();
 #if HAVE_SMPI
-    XBT_DEBUG("Smpi_enabled: %d", (int)smpi_enabled());
-    if (smpi_enabled())
+    XBT_DEBUG("Smpi_enabled: %d", SMPI_is_inited());
+    if (SMPI_is_inited())
       SMPI_finalize();
 #endif
   }
@@ -200,7 +199,7 @@ void AppSide::handle_messages() const
 
 void AppSide::main_loop() const
 {
-  simgrid::mc::processes_time.resize(simgrid::kernel::actor::get_maxpid());
+  simgrid::mc::processes_time.resize(simgrid::kernel::actor::ActorImpl::get_maxpid());
   MC_ignore_heap(simgrid::mc::processes_time.data(),
                  simgrid::mc::processes_time.size() * sizeof(simgrid::mc::processes_time[0]));
 
@@ -284,5 +283,4 @@ void AppSide::declare_stack(void* stack, size_t size, ucontext_t* context) const
   message.stack_region = region;
   xbt_assert(channel_.send(message) == 0, "Could not send STACK_REGION to model-checker");
 }
-} // namespace mc
-} // namespace simgrid
+} // namespace simgrid::mc