diff --git a/checkin_notes b/checkin_notes index e9ee541255..9b1e6d1d88 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7325,3 +7325,12 @@ Rom 14 Oct 2010 clientgui/ BOINCGUIApp.cpp, .h + +David 14 Oct 2010 + - client: when an app exits, adjust debts before erasing ACTIVE_TASK. + Otherwise the last episode won't get accounted + - client simulator: add output file for debt info + + client/ + cs_apps.cpp + cs_scheduler.cpp diff --git a/client/cs_apps.cpp b/client/cs_apps.cpp index 7d01d5d391..58fbbff779 100644 --- a/client/cs_apps.cpp +++ b/client/cs_apps.cpp @@ -67,6 +67,9 @@ bool CLIENT_STATE::handle_finished_apps() { ); } app_finished(*atp); + if (!action) { + adjust_debts(); // update debts before erasing ACTIVE_TASK + } iter = active_tasks.active_tasks.erase(iter); delete atp; set_client_state_dirty("handle_finished_apps"); diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index f2b22cc564..f5f5b9fc9e 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -237,7 +237,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { host_info.coprocs.write_xml(mf, true); } - // report results + // report completed jobs // unsigned int last_reported_index = 0; p->nresults_returned = 0; @@ -301,7 +301,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { } fprintf(f, "\n"); - // send descriptions of results in progress for this project + // send descriptions of jobs in progress for this project // fprintf(f, "\n"); for (i=0; iavp->ncudas) continue; if (atp->task_state() != PROCESS_EXECUTING) continue; PROJECT* p = rp->project; - fprintf(html_out, "%.2f: %s%s: %.2f
", + fprintf(html_out, "%.2f: %s%s: %.2f
", rp->avp->ncudas, colors[p->index], atp->result->rr_sim_misses_deadline?"*":"", @@ -646,7 +642,7 @@ void show_ati() { if (!rp->avp->natis) continue; if (atp->task_state() != PROCESS_EXECUTING) continue; PROJECT* p = rp->project; - fprintf(html_out, "%.2f: %s%s: %.2f
", + fprintf(html_out, "%.2f: %s%s: %.2f
", rp->avp->natis, colors[p->index], atp->result->rr_sim_misses_deadline?"*":"", @@ -664,9 +660,10 @@ int nproc_types = 1; void html_start() { char buf[256]; - html_out = fopen(timeline_fname, "w"); + sprintf(buf, "%s%s", output_file_prefix, TIMELINE_FNAME); + html_out = fopen(buf, "w"); if (!html_out) { - fprintf(stderr, "can't open %s for writing\n", timeline_fname); + fprintf(stderr, "can't open %s for writing\n", buf); exit(1); } setbuf(html_out, 0); @@ -706,7 +703,7 @@ void html_rec() { ACTIVE_TASK* atp = gstate.active_tasks.active_tasks[i]; if (atp->task_state() == PROCESS_EXECUTING) { PROJECT* p = atp->result->project; - fprintf(html_out, "(%.2f) %s%s: %.2f
", + fprintf(html_out, "(%.2f) %s%s: %.2f
", atp->result->avp->avg_ncpus, colors[p->index], atp->result->rr_sim_misses_deadline?"*":"", @@ -747,6 +744,42 @@ void html_end() { fclose(html_out); } +// lines in the debt file have these fields: +// time +// per project: +// overall LTD +// CPU LTD +// [NVIDIA LTD] +// [ATI LTD] +// CPU STD +// [NVIDIA STD] +// [ATI STD] +// +void write_debts() { + fprintf(debt_file, "%f ", gstate.now); + for (unsigned int i=0; ipwf.overall_debt, + p->cpu_pwf.long_term_debt, + p->cpu_pwf.short_term_debt + ); + if (gstate.host_info.coprocs.cuda.count) { + fprintf(debt_file, "%f %f ", + p->cuda_pwf.long_term_debt, + p->cuda_pwf.short_term_debt + ); + } + if (gstate.host_info.coprocs.ati.count) { + fprintf(debt_file, "%f %f", + p->ati_pwf.long_term_debt, + p->ati_pwf.short_term_debt + ); + } + } + fprintf(debt_file, "\n"); +} + void simulate() { bool action; double start = START_TIME; @@ -768,7 +801,6 @@ void simulate() { msg_printf(0, MSG_INFO, action?"did action":"did no action"); if (!action) break; } - gstate.now += delta; msg_printf(0, MSG_INFO, "took time step"); for (unsigned int i=0; i start + duration) break; } html_end(); @@ -878,13 +912,18 @@ void cull_projects() { } void do_client_simulation() { + char buf[256]; msg_printf(0, MSG_INFO, "SIMULATION START"); - read_config_file(true, config_fname); + + sprintf(buf, "%s%s", input_file_prefix, CONFIG_FILE); + read_config_file(true, buf); config.show(); gstate.add_platform("client simulator"); - gstate.parse_state_file_aux(state_fname); - gstate.read_global_prefs(prefs_fname); + sprintf(buf, "%s%s", input_file_prefix, STATE_FILE_NAME); + gstate.parse_state_file_aux(buf); + sprintf(buf, "%s%s", input_file_prefix, GLOBAL_PREFS_FILE_NAME); + gstate.read_global_prefs(buf); cull_projects(); int j=0; for (unsigned int i=0; i diff --git a/doc/help_vol.php b/doc/help_vol.php index 32aec65618..5571e43780 100644 --- a/doc/help_vol.php +++ b/doc/help_vol.php @@ -1,6 +1,7 @@ Country: $vol->country\n"; if ($vol->availability) {