Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New callbacks: simgrid::s4u::onSimulationEnd (right after the main simulation loop)
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 1 Feb 2017 19:16:37 +0000 (20:16 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 1 Feb 2017 19:17:02 +0000 (20:17 +0100)
ChangeLog
include/simgrid/s4u/engine.hpp
src/s4u/s4u_engine.cpp
src/simix/smx_global.cpp

index 4adcbf0..bb5a774 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@ SimGrid (3.15) UNRELEASED; urgency=low
  S4U
  - New callbacks:
    - simgrid::s4u::onPlatformCreated: right before the simulation starts
+   - simgrid::s4u::onSimulationEnd: right after the main simulation loop
 
  -- target_date=March 20 2017 -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
index 25fe6e4..c8558b8 100644 (file)
@@ -105,10 +105,13 @@ private:
   static s4u::Engine *instance_;
 };
 
-/* Callback called when the platform is created (ie, the xml file parsed),
+/** Callback called when the platform is created (ie, the xml file parsed),
  * right before the actual simulation starts.
  */
 extern XBT_PRIVATE xbt::signal<void(void)> onPlatformCreated;
+
+/** Callback called when the main simulation loop ends, just before MSG_run (or similar) ends */
+extern XBT_PRIVATE xbt::signal<void(void)> onSimulationEnd;
 }} // namespace simgrid::s4u
 
 #endif /* SIMGRID_S4U_ENGINE_HPP */
index b872ca4..967f077 100644 (file)
@@ -24,6 +24,7 @@ XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
 namespace simgrid {
 namespace s4u {
 xbt::signal<void(void)> onPlatformCreated;
+xbt::signal<void(void)> onSimulationEnd;
 
 Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */
 
index a6e990c..f8e26e0 100644 (file)
@@ -560,6 +560,7 @@ void SIMIX_run()
     SIMIX_display_process_status();
     xbt_abort();
   }
+  simgrid::s4u::onSimulationEnd();
 }
 
 /**