- client: work fetch fix: try to maintain GPU work all projects,

since we now do round-robin for GPUs as well as CPU.
    NOTE: this bug was found using the client simulator!
- client simulator: generate REC graph

svn path=/trunk/boinc/; revision=22746
This commit is contained in:
David Anderson 2010-11-24 20:51:25 +00:00
parent 650ede61c5
commit b39615d461
5 changed files with 83 additions and 27 deletions

View File

@ -8391,3 +8391,14 @@ Rom 24 Nov 2010
win_build/
boinc.sln
vboxwrapper.vcproj
David 24 Nov 2010
- client: work fetch fix: try to maintain GPU work all projects,
since we now do round-robin for GPUs as well as CPU.
NOTE: this bug was found using the client simulator!
- client simulator: generate REC graph
client/
work_fetch.cpp,h
cpu_sched.cpp
sim.cpp

View File

@ -535,8 +535,6 @@ void CLIENT_STATE::reset_debt_accounting() {
#ifdef USE_REC
#define REC_HALF_LIFE (30*86400)
// update REC (recent estimated credit)
//
static void update_rec() {
@ -572,7 +570,8 @@ static void update_rec() {
if (log_flags.debt_debug) {
double dt = gstate.now - gstate.debt_interval_start;
msg_printf(p, MSG_INFO,
"[debt] recent est credit: %.2fG in %.2f sec, %f->%f", x, dt, old, p->pwf.rec
"[debt] recent est credit: %.2fG in %.2f sec, %f + %f ->%f",
x, dt, old, p->pwf.rec-old, p->pwf.rec
);
}
}
@ -631,7 +630,7 @@ double project_priority(PROJECT* p) {
//
void adjust_rec_temp(RESULT* rp) {
PROJECT* p = rp->project;
p->pwf.rec_temp += peak_flops(rp->avp) * gstate.global_prefs.cpu_scheduling_period() / 86400;
p->pwf.rec_temp += peak_flops(rp->avp);
}
#endif

View File

@ -720,6 +720,9 @@ const char* colors[] = {
};
#define NCOLORS 12
#define WIDTH1 100
#define WIDTH2 400
int njobs_in_progress(PROJECT* p, int rsc_type) {
int n = 0;
@ -737,7 +740,7 @@ int njobs_in_progress(PROJECT* p, int rsc_type) {
void show_resource(int rsc_type) {
unsigned int i;
fprintf(html_out, "<td valign=top>");
fprintf(html_out, "<td width=%d valign=top>", WIDTH2);
bool found = false;
for (i=0; i<gstate.active_tasks.active_tasks.size(); i++) {
ACTIVE_TASK* atp = gstate.active_tasks.active_tasks[i];
@ -790,43 +793,44 @@ void html_start() {
fprintf(index_file, "<br><a href=%s>Timeline</a>\n", buf);
fprintf(html_out, "<h2>BOINC client simulator</h2>\n");
fprintf(html_out,
"<table border=1 cellpadding=4><tr><th>Time</th>\n"
"<table border=1 cellpadding=4><tr><th width=%d>Time</th>\n", WIDTH1
);
fprintf(html_out,
"<th>CPU<br><font size=-2>Job name and estimated time left<br>color denotes project<br>* means EDF mode</font></th>"
"<th width=%d>CPU<br><font size=-2>Job name and estimated time left<br>color denotes project<br>* means EDF mode</font></th>", WIDTH2
);
if (gstate.host_info.have_cuda()) {
fprintf(html_out, "<th>NVIDIA GPU</th>");
fprintf(html_out, "<th width=%d>NVIDIA GPU</th>", WIDTH2);
nproc_types++;
}
if (gstate.host_info.have_ati()) {
fprintf(html_out, "<th>ATI GPU</th>");
fprintf(html_out, "<th width=%d>ATI GPU</th>", WIDTH2);
nproc_types++;
}
fprintf(html_out, "</tr>\n");
fprintf(html_out, "</tr></table>\n");
}
void html_rec() {
if (html_msg.size()) {
//fprintf(html_out, "<tr><td>%s</td>", time_to_string(gstate.now));
fprintf(html_out, "<tr><td valign=top>%.0f</td>", gstate.now);
fprintf(html_out,
"<td colspan=%d valign=top><font size=-2>%s</font></td></tr>\n",
nproc_types,
"<table border=1><tr><td width=%d valign=top>%.0f</td>",
WIDTH1, gstate.now
);
fprintf(html_out,
"<td width=%d valign=top><font size=-2>%s</font></td></tr></table>\n",
nproc_types*WIDTH2,
html_msg.c_str()
);
html_msg = "";
}
//fprintf(html_out, "<tr><td>%s</td>", time_to_string(gstate.now));
fprintf(html_out, "<tr><td valign=top>%.0f</td>", gstate.now);
fprintf(html_out, "<table border=1><tr><td width=%d valign=top>%.0f</td>", WIDTH1, gstate.now);
if (!running) {
fprintf(html_out, "<td valign=top bgcolor=#aaaaaa>OFF</td>");
fprintf(html_out, "<td width=%d valign=top bgcolor=#aaaaaa>OFF</td>", WIDTH2);
if (gstate.host_info.have_cuda()) {
fprintf(html_out, "<td valign=top bgcolor=#aaaaaa>OFF</td>");
fprintf(html_out, "<td width=%d valign=top bgcolor=#aaaaaa>OFF</td>", WIDTH2);
}
if (gstate.host_info.have_ati()) {
fprintf(html_out, "<td valign=top bgcolor=#aaaaaa>OFF</td>");
fprintf(html_out, "<td width=%d valign=top bgcolor=#aaaaaa>OFF</td>", WIDTH2);
}
} else {
show_resource(RSC_TYPE_CPU);
@ -837,10 +841,10 @@ void html_rec() {
show_resource(RSC_TYPE_ATI);
}
}
fprintf(html_out, "</tr></table>\n");
}
void html_end() {
fprintf(html_out, "</table>");
fprintf(html_out, "<pre>\n");
sim_results.compute();
sim_results.print(html_out);
@ -849,7 +853,42 @@ void html_end() {
fclose(html_out);
}
#ifndef USE_REC
#ifdef USE_REC
void write_recs() {
fprintf(debt_file, "%f ", gstate.now);
for (unsigned int i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
fprintf(debt_file, "%f ", p->pwf.rec);
}
fprintf(debt_file, "\n");
}
void make_graph(const char* title, const char* fname, int field) {
char gp_fname[256], cmd[256], png_fname[256];
sprintf(gp_fname, "%s%s.gp", file_prefix, fname);
FILE* f = fopen(gp_fname, "w");
fprintf(f,
"set terminal png small size 1024, 768\n"
"set title \"%s\"\n"
"plot ",
title
);
for (unsigned int i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
fprintf(f, "\"%sdebt.dat\" using 1:%d title \"%s\" with lines%s",
file_prefix, 2+i+field, p->project_name,
(i==gstate.projects.size()-1)?"\n":", \\\n"
);
}
fclose(f);
sprintf(png_fname, "%s%s.png", file_prefix, fname);
sprintf(cmd, "gnuplot < %s > %s", gp_fname, png_fname);
fprintf(index_file, "<br><a href=%s>Graph of %s</a>\n", png_fname, title);
system(cmd);
}
#else
// lines in the debt file have these fields:
// time
@ -962,7 +1001,9 @@ void simulate() {
}
}
html_rec();
#ifndef USE_REC
#ifdef USE_REC
write_recs();
#else
write_debts();
#endif
gstate.now += delta;
@ -1159,7 +1200,9 @@ void do_client_simulation() {
// then other
print_project_results(stdout);
#ifndef USE_REC
#ifdef USE_REC
make_graph("REC", "rec", 0);
#else
debt_graphs();
#endif
}

View File

@ -448,9 +448,9 @@ void RSC_WORK_FETCH::print_state(const char* name) {
double bt = pwf.backoff_time>gstate.now?pwf.backoff_time-gstate.now:0;
#ifdef USE_REC
msg_printf(p, MSG_INFO,
"[work_fetch] %s: fetch share %.2f backoff dt %.2f int %.2f%s%s%s%s%s%s%s",
"[work_fetch] %s: fetch share %.2f rec %.5f prio %.5f backoff dt %.2f int %.2f%s%s%s%s%s%s%s",
name,
pwf.fetchable_share, bt, pwf.backoff_interval,
pwf.fetchable_share, p->pwf.rec, project_priority(p), bt, pwf.backoff_interval,
p->suspended_via_gui?" (susp via GUI)":"",
p->master_url_fetch_pending?" (master fetch pending)":"",
p->min_rpc_time > gstate.now?" (comm deferred)":"",
@ -923,7 +923,7 @@ PROJECT* WORK_FETCH::choose_project() {
if (!p) {
p = cpu_work_fetch.choose_project(FETCH_IF_MINOR_SHORTFALL);
}
#if 0
#if 1
// don't try to maintain GPU work for all projects,
// since we don't use round-robin scheduling for GPUs
//

View File

@ -23,7 +23,10 @@
#include <vector>
//#define USE_REC
#define USE_REC
//#define REC_HALF_LIFE (30*86400)
#define REC_HALF_LIFE (1*86400)
#define RSC_TYPE_ANY 0
#define RSC_TYPE_CPU 1