Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "got a "might be clobbered by ‘longjmp’ or ‘vfork’" error when compiled"
[simgrid.git] / src / simix / smx_global.c
index c18f9ec..0de13d2 100644 (file)
@@ -12,6 +12,7 @@
 #include "xbt/ex.h"             /* ex_backtrace_display */
 #include "mc/mc.h"
 
+XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix,
                                 "Logging specific to SIMIX (kernel)");
 
@@ -164,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;
@@ -184,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);