diff --git a/checkin_notes b/checkin_notes index b5dc572d95..bf5948751d 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8047,3 +8047,14 @@ David 18 June 2005 client/ cs_scheduler.C time_stats.C + +David 18 June 2005 + - Refine the round-robin simulation added earlier today + to model multiple CPUs. + - Fix bug in update of duration_correction_factor + + (both from John McLeod) + + client/ + client_types.C + cs_scheduler.C diff --git a/client/client_types.C b/client/client_types.C index 8d81ae84f9..e5daa3dcff 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -437,9 +437,9 @@ void PROJECT::update_duration_correction_factor(RESULT* rp) { duration_correction_factor = factor; } else { if (factor < 0.1) { - duration_correction_factor *= 0.99; + duration_correction_factor = 0.99 * duration_correction_factor + 0.01 * factor; } else { - duration_correction_factor *= 0.9; + duration_correction_factor = 0.9 * duration_correction_factor + 0.1 * factor; } } } diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 0c8357f7f2..67dc433e0d 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -1008,17 +1008,16 @@ void CLIENT_STATE::set_scheduler_modes() { std::map results_by_deadline; RESULT* rp; unsigned int i, j; + int k; bool should_not_fetch_work = false; bool use_earliest_deadline_first = false; + std::vector booked_to; #if 0 double frac_booked = 0; - std::vector booked_to; std::map::iterator it; #endif double total_proc_rate = avg_proc_rate(); -#if 0 double per_cpu_proc_rate = total_proc_rate/ncpus; -#endif SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_SCHED_CPU); @@ -1027,20 +1026,29 @@ void CLIENT_STATE::set_scheduler_modes() { // bool round_robin_misses_deadline = false; double rrs = runnable_resource_share(); + for (k=0; krunnable()) continue; - double proc_rate = total_proc_rate * (p->resource_share/rrs); - double start_time = now; + double project_proc_rate = per_cpu_proc_rate * (p->resource_share/rrs); for (j=0; jproject != p) continue; if (!rp->runnable()) continue; - start_time += rp->estimated_cpu_time_remaining()/proc_rate; + double first = booked_to[0]; + int ifirst = 0; + for (k=1; kestimated_cpu_time_remaining()/project_proc_rate; scope_messages.printf("set_scheduler_modes() result %s: est %f, deadline %f\n", - rp->name, start_time, rp->report_deadline + rp->name, booked_to[ifirst], rp->report_deadline ); - if (start_time > rp->report_deadline) { + if (booked_to[ifirst] > rp->report_deadline) { round_robin_misses_deadline = true; break; }