Commit 7001c6f7 authored by David Anderson's avatar David Anderson

- client: tweak the LTD calculation so that the largest debt

    always tends towards zero

svn path=/trunk/boinc/; revision=17333
parent 16ca7cd3
......@@ -1870,3 +1870,10 @@ David 20 Feb 2009
lib/
coproc.h
boinc_fcgi.cpp,h
David 21 Feb 2009
- client: tweak the LTD calculation so that the largest debt
always tends towards zero
client/
work_fetch.cpp
......@@ -527,12 +527,19 @@ void RSC_WORK_FETCH::update_debts() {
// also, if all the debts are large negative we need to gradually
// shift them towards zero.
// To do this, we add an offset as follows:
// delta_limit is the largest rate at which any project's debt
// could increase or decrease.
// If the largest debt is close to zero (relative to delta_limit)
// than add an offset that will bring it exactly to zero.
// Otherwise add an offset of 2*delta_limit,
// which will gradually bring all the debts towards zero
//
double offset;
if (-max_debt < secs_this_debt_interval) {
double delta_limit = secs_this_debt_interval*ninstances;
if (-max_debt < 2*delta_limit) {
offset = -max_debt;
} else {
offset = secs_this_debt_interval;
offset = 2*delta_limit;
}
if (log_flags.debt_debug) {
msg_printf(0, MSG_INFO, "[debt] %s debt: adding offset %.2f",
......
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