Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
typo
[simgrid.git] / src / simix / smx_global.c
index 2c3b8d70d36f22851b239fc1d71538390e07b4f6..0de13d281113ef3c85ddfe45803ce82111dcbf5c 100644 (file)
@@ -165,6 +165,19 @@ XBT_INLINE double SIMIX_get_clock(void)
   }
 }
 
+static int process_syscall_color(void *p)
+{
+  switch ((*(smx_process_t *)p)->simcall.call) {
+  case SIMCALL_NONE:
+  case SIMCALL_PROCESS_KILL:
+    return 2;
+  case SIMCALL_PROCESS_RESUME:
+    return 1;
+  default:
+    return 0;
+  }
+}
+
 void SIMIX_run(void)
 {
   double time = 0;
@@ -185,6 +198,7 @@ void SIMIX_run(void)
       XBT_DEBUG("New Sub-Schedule Round; size(queue)=%lu",
               xbt_dynar_length(simix_global->process_to_run));
       SIMIX_process_runall();
+      xbt_dynar_three_way_partition(simix_global->process_that_ran, process_syscall_color);
       xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
         if (process->simcall.call != SIMCALL_NONE) {
           SIMIX_simcall_pre(&process->simcall, 0);