diff --git a/checkin_notes b/checkin_notes index 59264e59c3..861a87d527 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1945,3 +1945,14 @@ David 22 Feb 2009 client/ work_fetch.cpp,h + +David 22 Feb 2009 + - client: work-fetch bug fix: if we're fetching work for a starved + project, it most have no runnable jobs for ANY resource. + - client: work-fetch bug fix: when setting requests in the + shortfall case, don't request anything if project is backed off + or overworked for the resource. + + client/ + rr_sim.cpp + work_fetch.cpp,h diff --git a/client/rr_sim.cpp b/client/rr_sim.cpp index 6ec29c0875..b0461d0684 100644 --- a/client/rr_sim.cpp +++ b/client/rr_sim.cpp @@ -227,6 +227,7 @@ void CLIENT_STATE::rr_simulation() { // job may have fraction_done=1 but not be done; // if it's past its deadline, we need to mark it as such p = rp->project; + p->pwf.has_runnable_jobs = true; if (rp->uses_cuda()) { p->cuda_pwf.has_runnable_jobs = true; if (cuda_work_fetch.sim_nused < coproc_cuda->count) { diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 2c3cf31e40..581661024a 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -90,6 +90,7 @@ void WORK_FETCH::rr_init() { for (unsigned int i=0; ipwf.can_fetch_work = p->pwf.compute_can_fetch_work(p); + p->pwf.has_runnable_jobs = false; p->cpu_pwf.rr_init(); if (coproc_cuda) { p->cuda_pwf.rr_init(); @@ -147,7 +148,8 @@ bool RSC_PROJECT_WORK_FETCH::overworked() { // If a resource has a shortfall, // get work for it from the non-overworked project with greatest LTD. #define FETCH_IF_PROJECT_STARVED 3 - // If any project is not overworked and has no runnable jobs for the rsc, + // If any project is not overworked and has no runnable jobs + // (for any resource, not just this one) // get work from the one with greatest LTD. // Choose the best project to ask for work for this resource, @@ -177,7 +179,7 @@ PROJECT* RSC_WORK_FETCH::choose_project(int criterion) { break; case FETCH_IF_PROJECT_STARVED: if (rpwf.overworked()) continue; - if (rpwf.has_runnable_jobs) continue; + if (p->pwf.has_runnable_jobs) continue; break; } if (pbest) { @@ -234,6 +236,9 @@ void WORK_FETCH::set_shortfall_requests(PROJECT* p) { void RSC_WORK_FETCH::set_shortfall_request(PROJECT* p) { if (!shortfall) return; + RSC_PROJECT_WORK_FETCH& w = project_state(p); + if (!w.may_have_work) return; + if (w.overworked()) return; set_request(p, shortfall); } diff --git a/client/work_fetch.h b/client/work_fetch.h index 15b74af7ce..0e09d216a6 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -138,6 +138,7 @@ struct PROJECT_WORK_FETCH { double overall_debt; bool can_fetch_work; bool compute_can_fetch_work(PROJECT*); + bool has_runnable_jobs; PROJECT_WORK_FETCH() { memset(this, 0, sizeof(*this)); }