Commit 125c90d1 authored by David Anderson's avatar David Anderson

- 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.

svn path=/trunk/boinc/; revision=17338
parent f257101d
......@@ -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
......@@ -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) {
......
......@@ -90,6 +90,7 @@ void WORK_FETCH::rr_init() {
for (unsigned int i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
p->pwf.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);
}
......
......@@ -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));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment