- client: fix bug in debt calculation

- client: <zero_debts> zeroes STD too

svn path=/trunk/boinc/; revision=19783
This commit is contained in:
David Anderson 2009-12-04 21:21:18 +00:00
parent dc43748b5c
commit 2ef5c5895b
5 changed files with 40 additions and 21 deletions

View File

@ -9719,3 +9719,10 @@ Charlie 4 Dec 2009
project.pbxproj project.pbxproj
mac-installer/ mac-installer/
Installer.cpp Installer.cpp
David 4 Dec 2009
- client: fix bug in debt calculation
- client: <zero_debts> zeroes STD too
client/
work_fetch.cpp,h

View File

@ -324,13 +324,9 @@ void WORK_FETCH::set_overall_debts() {
void WORK_FETCH::zero_debts() { void WORK_FETCH::zero_debts() {
for (unsigned i=0; i<gstate.projects.size(); i++) { for (unsigned i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i]; PROJECT* p = gstate.projects[i];
p->cpu_pwf.long_term_debt = 0; p->cpu_pwf.zero_debt();
if (coproc_cuda) { p->cuda_pwf.zero_debt();
p->cuda_pwf.long_term_debt = 0; p->ati_pwf.zero_debt();
}
if (coproc_ati) {
p->ati_pwf.long_term_debt = 0;
}
} }
} }
@ -706,7 +702,7 @@ void RSC_WORK_FETCH::update_long_term_debts() {
offset = 2*delta_limit; offset = 2*delta_limit;
} }
if (log_flags.debt_debug) { if (log_flags.debt_debug) {
msg_printf(0, MSG_INFO, "[debt] %s debt: adding offset %.2f", msg_printf(0, MSG_INFO, "[debt] %s LTD: adding offset %.2f",
rsc_name(rsc_type), offset rsc_name(rsc_type), offset
); );
} }
@ -714,8 +710,13 @@ void RSC_WORK_FETCH::update_long_term_debts() {
p = gstate.projects[i]; p = gstate.projects[i];
if (p->non_cpu_intensive) continue; if (p->non_cpu_intensive) continue;
RSC_PROJECT_WORK_FETCH& w = project_state(p); RSC_PROJECT_WORK_FETCH& w = project_state(p);
if (w.debt_eligible(p, *this) && offset < 0) continue; if (w.debt_eligible(p, *this)) {
w.long_term_debt += offset; w.long_term_debt += offset;
} else {
if (offset > 0) {
w.long_term_debt += offset;
}
}
if (w.long_term_debt > 0) w.long_term_debt = 0; if (w.long_term_debt > 0) w.long_term_debt = 0;
} }
} }

View File

@ -70,8 +70,15 @@ struct RSC_PROJECT_WORK_FETCH {
memset(this, 0, sizeof(*this)); memset(this, 0, sizeof(*this));
} }
// whether this project is accumulating debt for this resource // whether this project should accumulate debt for this resource
//
bool debt_eligible(PROJECT*, RSC_WORK_FETCH&); bool debt_eligible(PROJECT*, RSC_WORK_FETCH&);
inline void zero_debt() {
long_term_debt = 0;
short_term_debt = 0;
}
inline void reset() { inline void reset() {
backoff_time = 0; backoff_time = 0;
backoff_interval = 0; backoff_interval = 0;

View File

@ -43,9 +43,11 @@ function friendly_name($p) {
// //
function get_platforms(&$url) { function get_platforms(&$url) {
$url .= 'get_project_config.php'; $url .= 'get_project_config.php';
$x = file_get_contents($url); $x = @file_get_contents($url);
if (!$x) return null; if (!$x) return null;
$s = new SimpleXMLElement($x); libxml_use_internal_errors(true);
$s = simplexml_load_string($x);
if (!$s) return null;
if (array_key_exists('rpc_prefix', $s)) { if (array_key_exists('rpc_prefix', $s)) {
$url = $s->rpc_prefix; $url = $s->rpc_prefix;
} }
@ -60,7 +62,6 @@ function get_platforms(&$url) {
} else { } else {
$list = array(); $list = array();
foreach ($p->platform as $r) { foreach ($p->platform as $r) {
print_r($r);
if (array_key_exists('plan_class', $r)) { if (array_key_exists('plan_class', $r)) {
$list[] = (string)$r->platform_name.'['.(string)$r->plan_class.']'; $list[] = (string)$r->platform_name.'['.(string)$r->plan_class.']';
} else { } else {
@ -75,9 +76,10 @@ function get_platforms(&$url) {
// //
function get_platforms2($url) { function get_platforms2($url) {
$url .= 'apps.php?xml=1'; $url .= 'apps.php?xml=1';
$x = file_get_contents($url); $x = @file_get_contents($url);
if (!$x) return null; if (!$x) return null;
$s = new SimpleXMLElement($x); libxml_use_internal_errors(true);
$s = simplexml_load_string($x);
$list = null; $list = null;
foreach($s->application as $a) { foreach($s->application as $a) {
foreach ($a->version as $v) { foreach ($a->version as $v) {
@ -88,10 +90,9 @@ function get_platforms2($url) {
$pc = $v->plan_class[0]; $pc = $v->plan_class[0];
} }
if (strlen($pc)) { if (strlen($pc)) {
$list[] = $p.'['.$pc.']'; $p = $p.'['.$pc.']';
} else {
$list[] = $p;
} }
$list[] = (string)$p;
} }
} }
return array_unique($list); return array_unique($list);

View File

@ -39,8 +39,7 @@ A full list is
<h3>2) Get the latest BOINC software</h3> <h3>2) Get the latest BOINC software</h3>
<ul> <ul>
<li> <a href=download.php>Download and install</a> <li> <a href=download.php>Download and install</a>
version 6.6.36 or later of the BOINC software. the latest version of the BOINC software.
<li>ATI GPUs: you'll need 6.10.3 or later.
</ul> </ul>
<p> <p>
<h3>3) Get the latest driver</h3> <h3>3) Get the latest driver</h3>
@ -59,7 +58,11 @@ Projects with NVIDIA applications:
<ul> <ul>
<li> <a href=http://gpugrid.net>GPUgrid.net</a> <li> <a href=http://gpugrid.net>GPUgrid.net</a>
<li> <a href=http://setiathome.berkeley.edu>SETI@home</a> <li> <a href=http://setiathome.berkeley.edu>SETI@home</a>
<li> <a href=http://milkyway.cs.rpi.edu/milkyway/>Milkyway@home</a>
<li> <a href=http://aqua.dwavesys.com/>AQUA@home</a>
<li> <a href=http://boinc.umiacs.umd.edu/>Lattice</a>
<li> <a href=http://boinc.thesonntags.com/collatz/>Collatz Conjecture</a> <li> <a href=http://boinc.thesonntags.com/collatz/>Collatz Conjecture</a>
<li> <a href=http://hydrogenathome.org/>Hydrogen@home</a>
</ul> </ul>
Projects with ATI applications: Projects with ATI applications: