svn path=/trunk/boinc/; revision=9351
This commit is contained in:
David Anderson 2006-01-31 00:02:31 +00:00
parent 4c3ac78924
commit a412f79441
4 changed files with 19 additions and 3 deletions

View File

@ -1174,3 +1174,10 @@ Rom 30 Jan 2006
clientgui/ clientgui/
BOINCBaseView.cpp BOINCBaseView.cpp
BOINCListCtrl.cpp BOINCListCtrl.cpp
David 30 Jan 2006
- fixes for LTD calculation (from James Drews)
client/
client_types.C,h
cs_apps.C

View File

@ -421,6 +421,13 @@ bool PROJECT::potentially_runnable() {
return false; return false;
} }
bool PROJECT::debt_adjust_allowed() {
if (non_cpu_intensive) return false;
if (suspended_via_gui) return false;
if (dont_request_more_work && !runnable()) return false;
return true;
}
double PROJECT::next_file_xfer_time(const bool is_upload) { double PROJECT::next_file_xfer_time(const bool is_upload) {
return (is_upload ? next_file_xfer_up : next_file_xfer_down); return (is_upload ? next_file_xfer_up : next_file_xfer_down);
} }

View File

@ -255,6 +255,8 @@ public:
// has a result in downloading state // has a result in downloading state
bool potentially_runnable(); bool potentially_runnable();
// runnable or contactable or downloading // runnable or contactable or downloading
bool debt_adjust_allowed();
// long term debt adjustment is allowed
// temps used in CLIENT_STATE::rr_misses_deadline(); // temps used in CLIENT_STATE::rr_misses_deadline();
std::vector<RESULT*>active; std::vector<RESULT*>active;

View File

@ -413,7 +413,7 @@ double CLIENT_STATE::potentially_runnable_resource_share() {
double x = 0; double x = 0;
for (unsigned int i=0; i<projects.size(); i++) { for (unsigned int i=0; i<projects.size(); i++) {
PROJECT* p = projects[i]; PROJECT* p = projects[i];
if (p->potentially_runnable()) { if (p->debt_adjust_allowed()) {
x += p->resource_share; x += p->resource_share;
} }
} }
@ -471,7 +471,7 @@ void CLIENT_STATE::adjust_debts() {
// adjust long-term debts // adjust long-term debts
// //
if (p->potentially_runnable()) { if (p->debt_adjust_allowed()) {
nprojects++; nprojects++;
share_frac = p->resource_share/prrs; share_frac = p->resource_share/prrs;
p->long_term_debt += share_frac*total_wall_cpu_time_this_period p->long_term_debt += share_frac*total_wall_cpu_time_this_period
@ -524,7 +524,7 @@ void CLIENT_STATE::adjust_debts() {
p->anticipated_debt = p->short_term_debt; p->anticipated_debt = p->short_term_debt;
//msg_printf(p, MSG_INFO, "debt %f", p->short_term_debt); //msg_printf(p, MSG_INFO, "debt %f", p->short_term_debt);
} }
if (p->potentially_runnable()) { if (p->debt_adjust_allowed()) {
p->long_term_debt -= avg_long_term_debt; p->long_term_debt -= avg_long_term_debt;
} }
} }