Commit 3b31a9d8 authored by David Anderson's avatar David Anderson

- client: remove the "debt repair" mechanism added earlier today.

    There are situations where multiple projects can legitimately
    have large negative LTD on a uniprocessor.
    Instead...
- client: add <zero_debts> option to cc_config.xml

svn path=/trunk/boinc/; revision=17328
parent 6241fff2
......@@ -1809,3 +1809,14 @@ David 20 Feb 2009
client/
work_fetch.cpp,h
David 20 Feb 2009
- client: remove the "debt repair" mechanism added earlier today.
There are situations where multiple projects can legitimately
have large negative LTD on a uniprocessor.
Instead...
- client: add <zero_debts> option to cc_config.xml
client/
log_flags.cpp,h
work_fetch.cpp,h
......@@ -191,6 +191,7 @@ void CONFIG::defaults() {
client_download_url = "http://boinc.berkeley.edu/download.php";
network_test_url = "http://www.google.com/";
no_gpus = false;
zero_debts = false;
}
int CONFIG::parse_options(XML_PARSER& xp) {
......@@ -260,6 +261,7 @@ int CONFIG::parse_options(XML_PARSER& xp) {
continue;
}
if (xp.parse_bool(tag, "no_gpus", no_gpus)) continue;
if (xp.parse_bool(tag, "zero_debts", zero_debts)) continue;
if (xp.parse_bool(tag, "abort_jobs_on_exit", btemp)) {
gstate.abort_jobs_on_exit = true;
continue;
......
......@@ -131,6 +131,7 @@ struct CONFIG {
std::string client_download_url;
std::string network_test_url;
bool no_gpus;
bool zero_debts;
CONFIG();
void defaults();
......
......@@ -181,6 +181,16 @@ void WORK_FETCH::set_overall_debts() {
}
}
void WORK_FETCH::zero_debts() {
for (unsigned i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
p->cpu_pwf.debt = 0;
if (coproc_cuda) {
p->cuda_pwf.debt = 0;
}
}
}
void RSC_WORK_FETCH::print_state(char* name) {
msg_printf(0, MSG_INFO,
"[wfd] %s: shortfall %.2f nidle %.2f est. delay %.2f RS fetchable %.2f runnable %.2f",
......@@ -443,44 +453,6 @@ void WORK_FETCH::accumulate_inst_sec(ACTIVE_TASK* atp, double dt) {
}
}
// Running buggy versions may lead to a situation where
// most projects are overworked.
// If there are more overworked projects than device instances,
// this must have happened.
// Set all debts back to zero.
//
void RSC_WORK_FETCH::repair_debts() {
unsigned int i;
int noverworked = 0;
PROJECT* p;
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.overworked()) {
noverworked++;
}
}
if (noverworked <= ninstances) {
return;
}
if (log_flags.debt_debug) {
msg_printf(0, MSG_INFO,
"[debt] %s: %d projects overworked; setting debts to zero",
rsc_name(rsc_type), noverworked
);
}
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 = 0;
}
}
// update long-term debts for a resource.
//
void RSC_WORK_FETCH::update_debts() {
......@@ -489,11 +461,6 @@ void RSC_WORK_FETCH::update_debts() {
double ders = 0;
PROJECT* p;
if (!repair_done) {
repair_debts();
repair_done = true;
}
// find the total resource share of eligible projects
//
for (i=0; i<gstate.projects.size(); i++) {
......@@ -707,6 +674,10 @@ void WORK_FETCH::init() {
cuda_work_fetch.ninstances = coproc_cuda->count;
cuda_work_fetch.speed = coproc_cuda->flops_estimate()/gstate.host_info.p_fpops;
}
if (config.zero_debts) {
zero_debts();
}
}
void RSC_PROJECT_WORK_FETCH::backoff(PROJECT* p, char* name) {
......
......@@ -112,8 +112,6 @@ struct RSC_WORK_FETCH {
inline void reset_debt_accounting() {
secs_this_debt_interval = 0;
}
void repair_debts();
bool repair_done;
void rr_init();
void accumulate_shortfall(double d_time);
......@@ -163,6 +161,7 @@ struct WORK_FETCH {
void rr_init();
void clear_request();
void compute_shares();
void zero_debts();
};
extern RSC_WORK_FETCH cuda_work_fetch;
......
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