From: Martin Quinson Date: Sat, 9 Dec 2017 09:29:32 +0000 (+0100) Subject: new signal: s4u::onDeadlock() X-Git-Tag: v3.18~85 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c9dd5647a7d7e6404fdbf2828f331ee4c35611e3 new signal: s4u::onDeadlock() (fix #239) --- diff --git a/ChangeLog b/ChangeLog index 8b46c70b80..08363a5cd1 100644 --- 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 diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index 805a309301..4b39af125d 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -126,6 +126,9 @@ extern XBT_PRIVATE xbt::signal onSimulationEnd; /** Callback fired when the time jumps into the future */ extern XBT_PRIVATE xbt::signal onTimeAdvance; + +/** Callback fired when the time cannot jump because of inter-actors deadlock */ +extern XBT_PRIVATE xbt::signal onDeadlock; } } // namespace simgrid::s4u diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index 886cc33a91..97f2d89bb7 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -26,6 +26,7 @@ namespace s4u { xbt::signal onPlatformCreated; xbt::signal onSimulationEnd; xbt::signal onTimeAdvance; +xbt::signal onDeadlock; Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */ diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 80653b045b..37a4e4ae52 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -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();