diff --git a/checkin_notes b/checkin_notes index 0fe71e4d8f..92b42d8ff7 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9966,3 +9966,10 @@ David 8 Dec 2008 translation.inc user/ workunit.php + +David 8 Dec 2008 + - client: in round-robin simulation, don't count a project in + total resource share if it has coproc jobs and no CPU jobs. + + client/ + rr_sim.cpp,h diff --git a/client/rr_sim.cpp b/client/rr_sim.cpp index 663b638801..d30c2f5231 100644 --- a/client/rr_sim.cpp +++ b/client/rr_sim.cpp @@ -33,12 +33,12 @@ struct RR_SIM_STATUS { inline bool can_run(RESULT* rp) { return coprocs.sufficient_coprocs( - rp->avp->coprocs, log_flags.rr_simulation, "rr_simulation" + rp->avp->coprocs, log_flags.rr_simulation, "rr_sim" ); } inline void activate(RESULT* rp, double when) { coprocs.reserve_coprocs( - rp->avp->coprocs, rp, log_flags.rr_simulation, "rr_simulation" + rp->avp->coprocs, rp, log_flags.rr_simulation, "rr_sim" ); if (log_flags.rr_simulation) { msg_printf(rp->project, MSG_INFO, @@ -52,7 +52,7 @@ struct RR_SIM_STATUS { // and adjust CPU time left for other results // inline void remove_active(RESULT* rpbest) { - coprocs.free_coprocs(rpbest->avp->coprocs, rpbest, log_flags.rr_simulation, "rr_simulation"); + coprocs.free_coprocs(rpbest->avp->coprocs, rpbest, log_flags.rr_simulation, "rr_sim"); vector::iterator it = active.begin(); while (it != active.end()) { RESULT* rp = *it; @@ -186,7 +186,7 @@ void CLIENT_STATE::print_deadline_misses() { // void CLIENT_STATE::rr_simulation() { double rrs = nearly_runnable_resource_share(); - double trs = total_resource_share(); + double trs; PROJECT* p, *pbest; RESULT* rp, *rpbest; RR_SIM_STATUS sim_status; @@ -197,8 +197,8 @@ void CLIENT_STATE::rr_simulation() { if (log_flags.rr_simulation) { msg_printf(0, MSG_INFO, - "[rr_sim] rr_sim start: now %f work_buf_total %f rrs %f trs %f ncpus %d", - now, work_buf_total(), rrs, trs, ncpus + "[rr_sim] rr_sim start: now %f work_buf_total %f rrs %f ncpus %d", + now, work_buf_total(), rrs, ncpus ); } @@ -227,12 +227,21 @@ void CLIENT_STATE::rr_simulation() { } rp->last_rr_sim_missed_deadline = rp->rr_sim_misses_deadline; rp->rr_sim_misses_deadline = false; + if (rp->uses_coprocs()) { + p->rr_sim_status.has_coproc_jobs = true; + } else { + p->rr_sim_status.has_cpu_jobs = true; + } } + trs = 0; for (i=0; inon_cpu_intensive) continue; p->set_rrsim_proc_rate(rrs); + if (!p->rr_sim_status.has_coproc_jobs || p->rr_sim_status.has_cpu_jobs) { + trs += p->resource_share; + } } double buf_end = now + work_buf_total(); diff --git a/client/rr_sim.h b/client/rr_sim.h index 2c4546c678..569b13bf21 100644 --- a/client/rr_sim.h +++ b/client/rr_sim.h @@ -31,6 +31,8 @@ struct RR_SIM_PROJECT_STATUS { double proc_rate; double active_ncpus; double cpu_shortfall; + bool has_coproc_jobs; + bool has_cpu_jobs; inline void clear() { active.clear(); @@ -39,6 +41,8 @@ struct RR_SIM_PROJECT_STATUS { proc_rate = 0; cpu_shortfall = 0; active_ncpus = 0; + has_coproc_jobs = false; + has_cpu_jobs = false; } void activate(RESULT* rp); inline void add_pending(RESULT* rp) {