- if (nb_processes >= SIMIX_context_get_parallel_threshold()) {
- XBT_DEBUG("Runall // %lu", nb_processes);
- simix_global->context_factory->suspend = smx_ctx_raw_suspend_parallel;
- smx_ctx_raw_runall_parallel();
- } else {
- XBT_DEBUG("Runall serial %lu", nb_processes);
- simix_global->context_factory->suspend = smx_ctx_raw_suspend_serial;
- #ifdef TIME_BENCH_PER_SR
- smx_ctx_raw_runall_serial(simix_global->process_to_run);
- #else
- smx_ctx_raw_runall_serial();
- #endif
- }
+ if (SIMIX_context_is_parallel() && SIMIX_context_get_parallel_threshold()<nb_processes) {
+ XBT_DEBUG("Runall // %lu", nb_processes);
+ simix_global->context_factory->suspend = smx_ctx_raw_suspend_parallel;
+
+ #ifdef TIME_BENCH_ENTIRE_SRS
+ xbt_os_walltimer_start(timer);
+ #endif
+
+ smx_ctx_raw_runall_parallel();
+
+ #ifdef TIME_BENCH_ENTIRE_SRS
+ xbt_os_walltimer_stop(timer);
+ elapsed = xbt_os_timer_elapsed(timer);
+ #endif
+ } else {
+ XBT_DEBUG("Runall serial %lu", nb_processes);
+ simix_global->context_factory->suspend = smx_ctx_raw_suspend_serial;
+
+ #ifdef TIME_BENCH_PER_SR
+ smx_ctx_raw_runall_serial(simix_global->process_to_run);
+ #else
+
+ #ifdef TIME_BENCH_ENTIRE_SRS
+ xbt_os_walltimer_start(timer);
+ #endif
+
+ smx_ctx_raw_runall_serial();
+
+ #ifdef TIME_BENCH_ENTIRE_SRS
+ xbt_os_walltimer_stop(timer);
+ elapsed = xbt_os_timer_elapsed(timer);
+ #endif
+ #endif
+ }
+
+#ifdef TIME_BENCH_ENTIRE_SRS
+ XBT_CRITICAL("Total time SR %u = %f, %d", sr_count, elapsed, nb_processes);
+#endif