From: Christian Heinrich Date: Fri, 7 Apr 2017 12:20:18 +0000 (+0200) Subject: [SMX] Fixed wrong termination timing when daemons are present X-Git-Tag: v3.16~370^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/77a3b7226f27b14761e8aed669bf82a03177cd24 [SMX] Fixed wrong termination timing when daemons are present The check whether daemons need to be killed because no real process is present anymore needs to be performed every time a process could potentially have exited. --- diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index a8538f4ee6..787d58f460 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -513,6 +513,12 @@ void SIMIX_run() SIMIX_wake_processes(); } while (SIMIX_execute_tasks()); + /* If only daemon processes remain, cancel their actions, mark them to die and reschedule them */ + if (simix_global->process_list.size() == simix_global->daemons.size()) + for (const auto& dmon : simix_global->daemons) { + XBT_DEBUG("Kill %s", dmon->cname()); + SIMIX_process_kill(dmon, simix_global->maestro_process); + } } time = SIMIX_timer_next(); @@ -548,12 +554,6 @@ void SIMIX_run() XBT_DEBUG("### time %f, #processes %zu, #to_run %lu", time, simix_global->process_list.size(), xbt_dynar_length(simix_global->process_to_run)); - /* If only daemon processes remain, cancel their actions, mark them to die and reschedule them */ - if (simix_global->process_list.size() == simix_global->daemons.size()) - for (const auto& dmon : simix_global->daemons) { - XBT_DEBUG("Kill %s", dmon->cname()); - SIMIX_process_kill(dmon, simix_global->maestro_process); - } if (xbt_dynar_is_empty(simix_global->process_to_run) && !simix_global->process_list.empty())