Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move MC stuff from simix_global to EngineImpl
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Tue, 21 Sep 2021 11:13:17 +0000 (13:13 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Tue, 21 Sep 2021 14:20:51 +0000 (16:20 +0200)
include/simgrid/simix.hpp
src/kernel/EngineImpl.cpp
src/kernel/EngineImpl.hpp
src/mc/remote/AppSide.cpp
src/simix/smx_global.cpp

index 1acd620..49e2d4a 100644 (file)
@@ -93,16 +93,11 @@ auto simcall_blocking(F&& code, Observer* observer) -> decltype(observer->get_re
 }
 } // namespace actor
 } // namespace kernel
-} // namespace simgrid
-namespace simgrid {
+
 namespace simix {
 
 XBT_PUBLIC void unblock(smx_actor_t process);
 
-// In MC mode, the application sends these pointers to the MC
-xbt_dynar_t simix_global_get_actors_addr();
-xbt_dynar_t simix_global_get_dead_actors_addr();
-
 } // namespace simix
 } // namespace simgrid
 
index 3b08ef3..79c89e0 100644 (file)
@@ -38,6 +38,25 @@ EngineImpl* EngineImpl::instance_ = nullptr; /* That singleton is awful too. */
 config::Flag<double> cfg_breakpoint{"debug/breakpoint",
                                     "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0};
 config::Flag<bool> cfg_verbose_exit{"debug/verbose-exit", "Display the actor status at exit", true};
+
+xbt_dynar_t get_actors_addr()
+{
+#if SIMGRID_HAVE_MC
+  return EngineImpl::get_instance()->get_actors_vector();
+#else
+  xbt_die("This function is intended to be used when compiling with MC");
+#endif
+}
+
+xbt_dynar_t get_dead_actors_addr()
+{
+#if SIMGRID_HAVE_MC
+  return EngineImpl::get_instance()->get_dead_actors_vector();
+#else
+  xbt_die("This function is intended to be used when compiling with MC");
+#endif
+}
+
 } // namespace kernel
 } // namespace simgrid
 
index 63d2c44..fc9b8c1 100644 (file)
@@ -31,6 +31,9 @@
 
 namespace simgrid {
 namespace kernel {
+// In MC mode, the application sends these pointers to the MC
+xbt_dynar_t get_actors_addr();
+xbt_dynar_t get_dead_actors_addr();
 
 class EngineImpl {
   std::map<std::string, s4u::Host*, std::less<>> hosts_;
index 2938475..00f6453 100644 (file)
@@ -74,8 +74,8 @@ AppSide* AppSide::initialize()
              strerror(errno));
 
   s_mc_message_initial_addresses_t message{MessageType::INITIAL_ADDRESSES, mmalloc_preinit(),
-                                           kernel::actor::get_maxpid_addr(), simix::simix_global_get_actors_addr(),
-                                           simix::simix_global_get_dead_actors_addr()};
+                                           kernel::actor::get_maxpid_addr(), kernel::get_actors_addr(),
+                                           kernel::get_dead_actors_addr()};
   xbt_assert(instance_->channel_.send(message) == 0, "Could not send the initial message with addresses.");
 
   instance_->handle_messages();
index ab5a52f..2c158ce 100644 (file)
@@ -3,36 +3,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "mc/mc.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "src/kernel/EngineImpl.hpp"
 
 XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix, "Logging specific to SIMIX (kernel)");
 
-namespace simgrid {
-namespace simix {
-
-xbt_dynar_t simix_global_get_actors_addr()
-{
-#if SIMGRID_HAVE_MC
-  return kernel::EngineImpl::get_instance()->get_actors_vector();
-#else
-  xbt_die("This function is intended to be used when compiling with MC");
-#endif
-}
-xbt_dynar_t simix_global_get_dead_actors_addr()
-{
-#if SIMGRID_HAVE_MC
-  return kernel::EngineImpl::get_instance()->get_dead_actors_vector();
-#else
-  xbt_die("This function is intended to be used when compiling with MC");
-#endif
-}
-
-} // namespace simix
-} // namespace simgrid
-
 /**
  * @ingroup SIMIX_API
  * @brief A clock (in second).