Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename SIMIX_set_maestro into simgrid_set_maestro
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Fri, 17 Sep 2021 10:51:45 +0000 (12:51 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Fri, 17 Sep 2021 10:51:45 +0000 (12:51 +0200)
examples/cpp/maestro-set/s4u-maestro-set.cpp
include/simgrid/engine.h
include/simgrid/simix.h
src/s4u/s4u_Engine.cpp

index 81779a2..a0c1080 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
 {
   /* Specify which code should be executed by maestro on another thread, once this current thread is affected to an
    * actor by the subsequent sg_actor_attach(). This must be done before the creation of the engine. */
-  SIMIX_set_maestro(maestro, nullptr);
+  simgrid_set_maestro(maestro, nullptr);
 
   simgrid::s4u::Engine e(&argc, argv);
 
index 1ffbe27..35c5be5 100644 (file)
@@ -41,6 +41,12 @@ XBT_PUBLIC void simgrid_register_function(const char* name, void (*code)(int, ch
 XBT_PUBLIC void simgrid_register_default(void (*code)(int, char**));
 /** Retrieve the simulation time (in seconds) */
 XBT_PUBLIC double simgrid_get_clock();
+/* Set some code to execute in the maestro (must be used before the engine creation)
+ *
+ * If no maestro code is registered (the default), the main thread
+ * is assumed to be the maestro. */
+XBT_PUBLIC void simgrid_set_maestro(void (*code)(void*), void* data);
+
 /** Retrieve the number of actors in the simulation */
 XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_count()") XBT_PUBLIC int simgrid_get_actor_count();
 
index 630a064..1b72388 100644 (file)
@@ -39,7 +39,8 @@ XBT_PUBLIC int SIMIX_is_maestro();
  *
  * If no maestro code is registered (the default), the main thread
  * is assumed to be the maestro. */
-XBT_PUBLIC void SIMIX_set_maestro(void (*code)(void*), void* data);
+XBT_ATTRIB_DEPRECATED_v333("Please use simgrid_set_maestro()") XBT_PUBLIC
+    void SIMIX_set_maestro(void (*code)(void*), void* data);
 
 /* Simulation execution */
 XBT_ATTRIB_DEPRECATED_v332("Please use EngineImpl:run()") XBT_PUBLIC void SIMIX_run();
index 80a7997..04f5166 100644 (file)
@@ -497,7 +497,7 @@ int simgrid_get_actor_count() // XBT_ATTRIB_DEPRECATED_v330
   return simgrid::s4u::Engine::get_instance()->get_actor_count();
 }
 
-void SIMIX_set_maestro(void (*code)(void*), void* data)
+void simgrid_set_maestro(void (*code)(void*), void* data)
 {
 #ifdef _WIN32
   XBT_INFO("WARNING, SIMIX_set_maestro is believed to not work on windows. Please help us investigating this issue if "
@@ -505,3 +505,7 @@ void SIMIX_set_maestro(void (*code)(void*), void* data)
 #endif
   maestro_code = std::bind(code, data);
 }
+void SIMIX_set_maestro(void (*code)(void*), void* data) // XBT_ATTRIB_DEPRECATED_v333
+{
+  simgrid_set_maestro(code, data);
+}