Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMX] Fixed wrong termination timing when daemons are present
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 7 Apr 2017 12:20:18 +0000 (14:20 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 7 Apr 2017 12:20:38 +0000 (14:20 +0200)
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

index a8538f4..787d58f 100644 (file)
@@ -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())