- client: update LTD correctly

svn path=/trunk/boinc/; revision=17074
This commit is contained in:
David Anderson 2009-01-29 22:00:55 +00:00
parent 592bf5c17b
commit ca7b1cd8e4
2 changed files with 13 additions and 1 deletions

View File

@ -910,3 +910,9 @@ David 29 Jan 2009
sched/
sched_send.cpp
server_types.h
David 29 Jan 2009
- client: update LTD correctly
client/
work_fetch.cpp

View File

@ -410,11 +410,16 @@ void RSC_WORK_FETCH::update_debts() {
double max_debt = 0;
for (i=0; i<gstate.projects.size(); i++) {
p = gstate.projects[i];
if (p->non_cpu_intensive) continue;
RSC_PROJECT_WORK_FETCH& w = project_state(p);
if (w.debt_eligible(p)) {
w.debt -= offset;
}
if (w.debt > max_debt) max_debt = w.debt;
if (i) {
if (w.debt > max_debt) max_debt = w.debt;
} else {
max_debt = w.debt;
}
}
// Add an offset so max debt is zero across all projects.
@ -425,6 +430,7 @@ void RSC_WORK_FETCH::update_debts() {
}
for (i=0; i<gstate.projects.size(); i++) {
p = gstate.projects[i];
if (p->non_cpu_intensive) continue;
RSC_PROJECT_WORK_FETCH& w = project_state(p);
w.debt -= max_debt;
}