- smx_context_t self_context = (smx_context_t) xbt_os_thread_get_extra_data();
- return self_context ? self_context : (smx_context_t) maestro_raw_context;
+ if (xbt_dynar_length(processes) >= SIMIX_context_get_parallel_threshold()) {
+ DEBUG1("Runall // %lu", xbt_dynar_length(processes));
+ raw_factory->self = smx_ctx_raw_self_parallel;
+ raw_factory->get_thread_id = smx_ctx_raw_get_thread_id;
+ smx_ctx_raw_runall_parallel(processes);
+ } else {
+ DEBUG1("Runall serial %lu", xbt_dynar_length(processes));
+ raw_factory->self = smx_ctx_base_self;
+ raw_factory->get_thread_id = smx_ctx_base_get_thread_id;
+ smx_ctx_raw_runall_serial(processes);
+ }