diff --git a/checkin_notes b/checkin_notes index 3e8791fd81..6abc6901ee 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index a50cbd8e27..b9d03d32af 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -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 diff --git a/client/sim.cpp b/client/sim.cpp index 09d4801c3b..9da3798211 100644 --- a/client/sim.cpp +++ b/client/sim.cpp @@ -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, ""); + fprintf(html_out, "", WIDTH2); bool found = false; for (i=0; iTimeline\n", buf); fprintf(html_out, "

BOINC client simulator

\n"); fprintf(html_out, - "\n" + "
Time
\n", WIDTH1 ); fprintf(html_out, - "" + "", WIDTH2 ); if (gstate.host_info.have_cuda()) { - fprintf(html_out, ""); + fprintf(html_out, "", WIDTH2); nproc_types++; } if (gstate.host_info.have_ati()) { - fprintf(html_out, ""); + fprintf(html_out, "", WIDTH2); nproc_types++; } - fprintf(html_out, "\n"); + fprintf(html_out, "
TimeCPU
Job name and estimated time left
color denotes project
* means EDF mode
CPU
Job name and estimated time left
color denotes project
* means EDF mode
NVIDIA GPUNVIDIA GPUATI GPUATI GPU
\n"); } void html_rec() { if (html_msg.size()) { - //fprintf(html_out, "%s", time_to_string(gstate.now)); - fprintf(html_out, "%.0f", gstate.now); fprintf(html_out, - "%s\n", - nproc_types, + "", + WIDTH1, gstate.now + ); + fprintf(html_out, + "
%.0f%s
\n", + nproc_types*WIDTH2, html_msg.c_str() ); html_msg = ""; } - //fprintf(html_out, "%s", time_to_string(gstate.now)); - fprintf(html_out, "%.0f", gstate.now); + fprintf(html_out, "", WIDTH1, gstate.now); if (!running) { - fprintf(html_out, ""); + fprintf(html_out, "", WIDTH2); if (gstate.host_info.have_cuda()) { - fprintf(html_out, ""); + fprintf(html_out, "", WIDTH2); } if (gstate.host_info.have_ati()) { - fprintf(html_out, ""); + fprintf(html_out, "", WIDTH2); } } else { show_resource(RSC_TYPE_CPU); @@ -837,10 +841,10 @@ void html_rec() { show_resource(RSC_TYPE_ATI); } } + fprintf(html_out, "
%.0fOFFOFFOFFOFFOFFOFF
\n"); } void html_end() { - fprintf(html_out, ""); fprintf(html_out, "
\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; ipwf.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; iproject_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, "
Graph of %s\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 } diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 5a50cdd584..6c7ed0c571 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -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 // diff --git a/client/work_fetch.h b/client/work_fetch.h index f0f91e08c1..d343c90cd4 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -23,7 +23,10 @@ #include -//#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