X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9c916cb125de2f1050a588d972fd67ff9aac5e29..e51ea751d20f2437b9b350a3bab1db3c257fb54f:/src/simix/smx_global.c diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index c18f9ecdbd..0de13d2811 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -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);