From 77a3b7226f27b14761e8aed669bf82a03177cd24 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Fri, 7 Apr 2017 14:20:18 +0200 Subject: [PATCH] [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. --- src/simix/smx_global.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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()) -- 2.20.1