Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new signal: s4u::onDeadlock()
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 9 Dec 2017 09:29:32 +0000 (10:29 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 9 Dec 2017 09:29:35 +0000 (10:29 +0100)
(fix #239)

ChangeLog
include/simgrid/s4u/Engine.hpp
src/s4u/s4u_engine.cpp
src/simix/smx_global.cpp

index 8b46c70..08363a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 SimGrid (3.18) NOT RELEASED YET (target: December 24 2017)
 
- S4U
+ S4U New features
+ - s4u::onDeadlock() signal, run before stopping the simulation.
+
+ S4U API changes
  - Link::name() is deprecated and will be removed in v3.21, use
    Link::getCname() instead.
  - Mailbox::getName() changed to return a std::string, use
@@ -54,6 +57,7 @@ SimGrid (3.18) NOT RELEASED YET (target: December 24 2017)
  Fixed bugs:
  - #248: Kill of finished processes leads to segfault
  - #240: xbt_cond_wait_timeout should gracefully return for C apps
+ - #239: please implement signal s4u::onDeadlock()
  - #230: segfaults when exit() without run() 
  - #225: s4u::Actor::kill() doesn not really kill victims in a join()
  - #223: MSG_task_get_flops_amount() not working with parallel tasks
index 805a309..4b39af1 100644 (file)
@@ -126,6 +126,9 @@ extern XBT_PRIVATE xbt::signal<void()> onSimulationEnd;
 
 /** Callback fired when the time jumps into the future */
 extern XBT_PRIVATE xbt::signal<void(double)> onTimeAdvance;
+
+/** Callback fired when the time cannot jump because of inter-actors deadlock */
+extern XBT_PRIVATE xbt::signal<void(void)> onDeadlock;
 }
 } // namespace simgrid::s4u
 
index 886cc33..97f2d89 100644 (file)
@@ -26,6 +26,7 @@ namespace s4u {
 xbt::signal<void()> onPlatformCreated;
 xbt::signal<void()> onSimulationEnd;
 xbt::signal<void(double)> onTimeAdvance;
+xbt::signal<void(void)> onDeadlock;
 
 Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */
 
index 80653b0..37a4e4a 100644 (file)
@@ -554,6 +554,7 @@ void SIMIX_run()
 
     XBT_CRITICAL("Oops ! Deadlock or code not perfectly clean.");
     SIMIX_display_process_status();
+    simgrid::s4u::onDeadlock();
     xbt_abort();
   }
   simgrid::s4u::onSimulationEnd();