- DEBUG2("Schedule item %u of %lu",cursor,xbt_dynar_length(processes));
- smx_ctx_raw_resume(process->context);
+ XBT_DEBUG("Schedule item %u of %lu",cursor,xbt_dynar_length(processes));
+ if(cursor >= t * data_size + data_size){
+ if(time_thread_ssr[t] > tmax)
+ tmax = time_thread_ssr[t];
+ t++;
+ time_thread_ssr[t] = 0;
+ }
+
+ if(new_sr){
+ ((smx_ctx_raw_t)process->context)->thread = t;
+ time_thread_sr[t] = 0;
+ }
+
+ xbt_os_timer_start(timer);
+ smx_ctx_raw_resume(process);
+ xbt_os_timer_stop(timer);
+ elapsed = xbt_os_timer_elapsed(timer);
+ time_thread_ssr[t] += elapsed;
+ time_thread_sr[((smx_ctx_raw_t)process->context)->thread] += elapsed;
+ }
+
+ if(new_sr)
+ new_sr = FALSE;
+
+ if(time_thread_ssr[t] > tmax)
+ tmax = time_thread_ssr[t];
+
+ for(cursor=0; cursor <= t; cursor++){
+ XBT_VERB("Time SSR thread %u = %lf (max %lf)", cursor, time_thread_ssr[cursor], tmax);
+ time_wasted_ssr += tmax - time_thread_ssr[cursor];