- client simulator: added '--work_fetch_old' option.

If set, the simulator uses an approximation of the old
    work fetch policy, where the client tries to maintain
    an amount of work for each project equal to
    the buffer size times its relative resource share

svn path=/trunk/boinc/; revision=13144
This commit is contained in:
David Anderson 2007-07-11 20:13:53 +00:00
parent 7451c3c62b
commit 4760e6d960
6 changed files with 55 additions and 6 deletions

View File

@ -7196,5 +7196,16 @@ Eric K. 11 July 2007
- Web: result display: Changed text for display of results cancelled by
server (exit_status=-221).
html/inc/result.inc
html/inc/
result.inc
David 11 July 2007
- client simulator: added '--work_fetch_old' option.
If set, the simulator uses an approximation of the old
work fetch policy, where the client tries to maintain
an amount of work for each project equal to
the buffer size times its relative resource share
client/
sim.C,h
work_fetch.C

View File

@ -59,6 +59,7 @@ bool dcf_dont_use;
bool dcf_stats;
bool dual_dcf;
bool cpu_sched_rr_only;
bool work_fetch_old;
SIM_RESULTS sim_results;
@ -601,6 +602,8 @@ int main(int argc, char** argv) {
dcf_stats = true;
} else if (!strcmp(opt, "--cpu_sched_rr_only")) {
cpu_sched_rr_only = true;
} else if (!strcmp(opt, "--work_fetch_old")) {
work_fetch_old = true;
} else {
help(argv[0]);
}

View File

@ -280,3 +280,4 @@ extern bool dcf_dont_use;
extern bool dcf_stats;
extern bool cpu_sched_rr_only;
extern bool dual_dcf;
extern bool work_fetch_old;

View File

@ -370,6 +370,38 @@ bool CLIENT_STATE::compute_work_requests() {
compute_nuploading_results();
adjust_debts();
#ifdef SIM
if (work_fetch_old) {
// "dumb" version for simulator only.
// for each project, compute extra work needed to bring it up to
// total_buf/relative resource share.
//
overall_work_fetch_urgency = WORK_FETCH_DONT_NEED;
double trs = total_resource_share();
double total_buf = ncpus*(work_buf_min() + work_buf_additional());
for (i=0; i<projects.size(); i++) {
PROJECT* p = projects[i];
double d = 0;
for (unsigned int j=0; j<results.size(); j++) {
RESULT* rp = results[j];
if (rp->project != p) continue;
d += rp->estimated_cpu_time_remaining(true);
}
double rrs = p->resource_share/trs;
double minq = total_buf*rrs;
if (d < minq) {
p->work_request = minq-d;
p->work_request_urgency = WORK_FETCH_NEED;
overall_work_fetch_urgency = WORK_FETCH_NEED;
} else {
p->work_request = 0;
p->work_request_urgency = WORK_FETCH_DONT_NEED;
}
}
return false;
}
#endif
rr_simulation();
// compute per-project and overall urgency

View File

@ -46,10 +46,6 @@ function download_link($pname) {
for your particular Linux distribution
(Gentoo, Fedora, Debian, Ubuntu);
check this first before downloading from this page.
<p>
Note: 5.9.1+ requires GLIBC 2.4 or better to run. This
change was required for the benchmarks to be similar
to the other platforms.
";
}
}

View File

@ -110,6 +110,8 @@ function show_form() {
<p>
Client uses RR CPU sched? <input type=checkbox name=rr_only>
<p>
Client uses old work fetch policy? <input type=checkbox name=work_fetch_old>
<p>
DCF: <input type=radio name=dcf value=normal checked> Normal
: <input type=radio name=dcf value=stats> Stats
: <input type=radio name=dcf value=dual> Dual
@ -153,6 +155,10 @@ if ($_POST['submit']) {
if ($_POST['rr_only']) {
$rr_only = '--cpu_sched_rr_only';
}
$work_fetch_old = '';
if ($_POST['work_fetch_old']) {
$work_fetch_old = '--work_fetch_old';
}
$dcfflag = "";
$dcf = ($_POST['dcf']);
@ -165,7 +171,7 @@ if ($_POST['submit']) {
}
Header("Location: sim/sim_out.html");
$cmd = "./sim --duration $duration --delta $delta $suw $dcfflag $rr_only";
$cmd = "./sim --duration $duration --delta $delta $suw $dcfflag $rr_only $work_fetch_old";
system("/bin/rm sim_log.txt sim_out.html");
system($cmd);
} else {