Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics in ActorImpl
[simgrid.git] / src / simix / libsmx.cpp
index 79e3cb03c2b9b90444ff56ef33afeec328d8f8cf..402d1886287ad37808d4a1f0ce99b13ce3b72ac2 100644 (file)
 #include "src/kernel/actor/SimcallObserver.hpp"
 #include <simgrid/s4u/Activity.hpp>
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
+#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v335)
+#include <simgrid/simix.h>
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_simcall);
 
 /**
  * @ingroup simix_comm_management
@@ -153,13 +156,13 @@ bool simcall_comm_test(simgrid::kernel::activity::ActivityImpl* comm) // XBT_ATT
   return false;
 }
 
-static void simcall(simgrid::simix::Simcall call, std::function<void()> const& code)
+static void simcall(simgrid::kernel::actor::Simcall::Type call, std::function<void()> const& code)
 {
   auto self = simgrid::kernel::actor::ActorImpl::self();
   self->simcall_.call_ = call;
   self->simcall_.code_ = &code;
   if (not simgrid::kernel::EngineImpl::get_instance()->is_maestro(self)) {
-    XBT_DEBUG("Yield process '%s' on simcall %s", self->get_cname(), SIMIX_simcall_name(self->simcall_));
+    XBT_DEBUG("Yield process '%s' on simcall %s", self->get_cname(), self->simcall_.get_cname());
     self->yield();
   } else {
     self->simcall_handle(0);
@@ -171,7 +174,7 @@ void simcall_run_answered(std::function<void()> const& code, simgrid::kernel::ac
   simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer;
   // The function `code` is called in kernel mode (either because we are already in maestor or after a context switch)
   // and simcall_answer() is called
-  simcall(simgrid::simix::Simcall::RUN_ANSWERED, code);
+  simcall(simgrid::kernel::actor::Simcall::Type::RUN_ANSWERED, code);
   simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = nullptr;
 }
 
@@ -180,6 +183,6 @@ void simcall_run_blocking(std::function<void()> const& code, simgrid::kernel::ac
   simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer;
   // The function `code` is called in kernel mode (either because we are already in maestor or after a context switch)
   // BUT simcall_answer IS NOT CALLED
-  simcall(simgrid::simix::Simcall::RUN_BLOCKING, code);
+  simcall(simgrid::kernel::actor::Simcall::Type::RUN_BLOCKING, code);
   simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = nullptr;
 }