From c2097091fe67f6a2a331c2acf0af2aec039bff10 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 2 Jun 2009 22:53:57 +0000 Subject: [PATCH] - client: show "est. delay" correctly in work fetch debug msgs - client: show times correctly in rr_sim debug msgs - client: in "requesting new tasks" msg, say what resources we're requesting (if there's more than CPU) - client: estimated delay was possibly being calculated incorrectly because of roundoff error svn path=/trunk/boinc/; revision=18269 --- checkin_notes | 14 ++++++++++++++ client/cs_scheduler.cpp | 2 +- client/rr_sim.cpp | 3 ++- client/scheduler_op.cpp | 19 +++++++++++++++---- client/work_fetch.cpp | 15 ++++++++++++--- 5 files changed, 44 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index 7f9542a6ac..a5f706e2fd 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4929,3 +4929,17 @@ David 1 June 2009 sched/ assimilator.py testasm.py + +David 2 June 2009 + - client: show "est. delay" correctly in work fetch debug msgs + - client: show times correctly in rr_sim debug msgs + - client: in "requesting new tasks" msg, + say what resources we're requesting (if there's more than CPU) + - client: estimated delay was possibly being calculated incorrectly + because of roundoff error + + client/ + cs_scheduler.cpp + rr_sim.cpp + scheduler_op.cpp + work_fetch.cpp diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index b879bc3b05..00e0a2c4c9 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -230,7 +230,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { if (coproc_cuda) { coproc_cuda->req_secs = cuda_work_fetch.req_secs; coproc_cuda->req_instances = cuda_work_fetch.req_instances; - coproc_cuda->estimated_delay = cuda_work_fetch.estimated_delay; + coproc_cuda->estimated_delay = cuda_work_fetch.req_secs?cuda_work_fetch.estimated_delay:0; } if (coprocs.coprocs.size()) { diff --git a/client/rr_sim.cpp b/client/rr_sim.cpp index 0446b3c2df..2549fbc08c 100644 --- a/client/rr_sim.cpp +++ b/client/rr_sim.cpp @@ -349,6 +349,8 @@ void CLIENT_STATE::rr_simulation() { sim_status.remove_active(rpbest); pbest->rr_sim_status.remove_active(rpbest); + sim_now += rpbest->rrsim_finish_delay; + // start new jobs; may need to start more than one // if this job used multiple resource instances // @@ -370,7 +372,6 @@ void CLIENT_STATE::rr_simulation() { pbest->rr_sim_status.activate(rp); } } - sim_now += rpbest->rrsim_finish_delay; } // if simulation ends before end of buffer, take the tail into account diff --git a/client/scheduler_op.cpp b/client/scheduler_op.cpp index 393cc14b82..0ecac72e93 100644 --- a/client/scheduler_op.cpp +++ b/client/scheduler_op.cpp @@ -209,7 +209,7 @@ void SCHEDULER_OP::rpc_failed(const char* msg) { // int SCHEDULER_OP::start_rpc(PROJECT* p) { int retval; - char request_file[1024], reply_file[1024]; + char request_file[1024], reply_file[1024], buf[256]; safe_strcpy(scheduler_url, p->get_scheduler_url(url_index, url_random)); if (log_flags.sched_ops) { @@ -217,13 +217,24 @@ int SCHEDULER_OP::start_rpc(PROJECT* p) { "Sending scheduler request: %s.", rpc_reason_string(reason) ); if (cpu_work_fetch.req_secs || cuda_work_fetch.req_secs) { + if (coproc_cuda) { + if (cpu_work_fetch.req_secs && cuda_work_fetch.req_secs) { + sprintf(buf, " for CPU and GPU"); + } else if (cpu_work_fetch.req_secs) { + sprintf(buf, " for CPU"); + } else { + sprintf(buf, " for GPU"); + } + } else { + strcpy(buf, ""); + } if (p->nresults_returned) { msg_printf(p, MSG_INFO, - "Reporting %d completed tasks, requesting new tasks", - p->nresults_returned + "Reporting %d completed tasks, requesting new tasks%s", + p->nresults_returned, buf ); } else { - msg_printf(p, MSG_INFO, "Requesting new tasks"); + msg_printf(p, MSG_INFO, "Requesting new tasks%s", buf); } } else { if (p->nresults_returned) { diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 2757f64bb4..9259cb4539 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -124,15 +124,25 @@ void RSC_WORK_FETCH::accumulate_shortfall(double d_time) { if (idle > 0) { shortfall += idle*d_time; } +#if 0 + msg_printf(0, MSG_INFO, "accum shortf (%s): idle %f dt %f sf %f", + rsc_name(rsc_type), idle, d_time, shortfall + ); +#endif } // "estimated delay" is the interval for which we expect the // resource to be saturated. // void RSC_WORK_FETCH::update_estimated_delay(double dt) { - if (sim_nused >= ninstances) { + if (sim_nused+1e-6 >= ninstances) { estimated_delay = dt; } +#if 0 + msg_printf(0, MSG_INFO, "est delay (%s): used %e instances %d dt %f est delay %f", + rsc_name(rsc_type), sim_nused, ninstances, dt, estimated_delay + ); +#endif } // see if the project's debt is beyond what would normally happen; @@ -340,7 +350,6 @@ static void print_req(PROJECT* p) { void RSC_WORK_FETCH::clear_request() { req_secs = 0; req_instances = 0; - estimated_delay = 0; } void WORK_FETCH::clear_request() { @@ -672,7 +681,7 @@ void WORK_FETCH::write_request(FILE* f) { cpu_work_fetch.req_secs, cpu_work_fetch.req_secs, cpu_work_fetch.req_instances, - cpu_work_fetch.estimated_delay + cpu_work_fetch.req_secs?cpu_work_fetch.estimated_delay:0 ); }