From 240cf6cfffb8ab2882fe6ef00c1f0428c2589eed Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 29 Aug 2006 23:15:47 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=11039 --- checkin_notes | 12 ++++++++++++ client/cpu_sched.C | 36 +++++++++++++++++++++++++++--------- client/log_flags.h | 2 +- client/time_stats.C | 14 +++++++------- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/checkin_notes b/checkin_notes index 49220cfc07..335bf1d580 100755 --- a/checkin_notes +++ b/checkin_notes @@ -9481,3 +9481,15 @@ David 29 Aug 2006 cs_account.C cs_scheduler.C scheduler_op.C + +David 29 Aug 2006 + - lots more debug messages in RR simulator + - fixed small bug in RR sim + (last_active_size => last_project_active_size) + - change meaning of time_debug log flag; + it prints messages related to on_frac etc. + + client/ + cpu_sched.C + log_flags.h + time_stats.C diff --git a/client/cpu_sched.C b/client/cpu_sched.C index 2379691a7e..b02479ff58 100644 --- a/client/cpu_sched.C +++ b/client/cpu_sched.C @@ -773,6 +773,10 @@ bool CLIENT_STATE::rr_simulation() { vector::iterator it; bool rval = false; + if (log_flags.rr_simulation) { + msg_printf(0, MSG_INFO, "rr_sim start: work_buf_min %f rrs %f", work_buf_min(), rrs); + } + // Initialize result lists for each project: // "active" is what's currently running (in the simulation) // "pending" is what's queued @@ -811,8 +815,8 @@ bool CLIENT_STATE::rr_simulation() { double rsf = rrs ? p->resource_share/rrs : 1; p->cpu_shortfall = work_buf_min() * overall_cpu_frac() * ncpus * rsf; if (log_flags.rr_simulation) { - msg_printf(NULL, MSG_INFO, - "no results for %s; shortfall %f wbm %f ocf %f rsf %f", + msg_printf(p, MSG_INFO, + "no results; shortfall %f wbm %f ocf %f rsf %f", p->cpu_shortfall, work_buf_min(), overall_cpu_frac(), rsf ); } @@ -925,8 +929,14 @@ bool CLIENT_STATE::rr_simulation() { double rsf = saved_rrs?pbest->resource_share/saved_rrs:1; double proj_cpu_share = ncpus*rsf; - if (last_active_size < proj_cpu_share) { + if (last_proj_active_size < proj_cpu_share) { pbest->cpu_shortfall += d_time*(proj_cpu_share - last_proj_active_size); + if (log_flags.rr_simulation) { + msg_printf(pbest, MSG_INFO, + "rr_sim: new shortfall %f d_time %f proj_cpu_share %f lpas %d", + pbest->cpu_shortfall, d_time, proj_cpu_share, last_proj_active_size + ); + } } if (end_time < buf_end) { @@ -934,12 +944,21 @@ bool CLIENT_STATE::rr_simulation() { // if this is the last result for this project, account for the tail if (!pbest->active.size()) { pbest->cpu_shortfall += d_time * proj_cpu_share; + if (log_flags.rr_simulation) { + msg_printf(pbest, MSG_INFO, "rr_sim proj out of work; shortfall %f d %f pcs %f", + pbest->cpu_shortfall, d_time, proj_cpu_share + ); + } } } if (log_flags.rr_simulation) { msg_printf(0, MSG_INFO, - "rr_simulation loop: idle %d, last active %d, active %d, shortfall %f: proj %s, last active %d, active %d, shortfall %f", - nidle_cpus, last_active_size, (int)active.size(), cpu_shortfall, + "rr_sim total: idle cpus %d, last active %d, active %d, shortfall %f", + nidle_cpus, last_active_size, (int)active.size(), cpu_shortfall + + ); + msg_printf(0, MSG_INFO, + "rr_sim proj %s: last active %d, active %d, shortfall %f", pbest->get_project_name(), last_proj_active_size, (int)pbest->active.size(), pbest->cpu_shortfall ); @@ -957,14 +976,13 @@ bool CLIENT_STATE::rr_simulation() { for (i=0; icpu_shortfall) { - msg_printf(NULL, MSG_INFO, - "rr_simulation: shortfall for %s is %f\n", - p->project_name, p->cpu_shortfall + msg_printf(p, MSG_INFO, + "rr_sim: shortfall %f\n", p->cpu_shortfall ); } } msg_printf(NULL, MSG_INFO, - "rr_simulation: end; returning %s; cpu_shortfall %f\n", + "rr_simulation: end; returning %s; total shortfall %f\n", rval?"true":"false", cpu_shortfall ); diff --git a/client/log_flags.h b/client/log_flags.h index 167bbdd165..5f9b5ad35b 100644 --- a/client/log_flags.h +++ b/client/log_flags.h @@ -58,7 +58,7 @@ struct LOG_FLAGS { bool sched_op_debug; bool http_debug; bool proxy_debug; - bool time_debug; // print message on sleep + bool time_debug; // changes in on_frac, active_frac, connected_frac bool http_xfer_debug; bool measurement_debug; // host measurement notices bool poll_debug; // show what polls are responding diff --git a/client/time_stats.C b/client/time_stats.C index 4c35811ef4..61af27732f 100644 --- a/client/time_stats.C +++ b/client/time_stats.C @@ -43,10 +43,10 @@ #include "time_stats.h" // exponential decay constant. -// The last 30 days have a weight of 1/e; +// The last 10 days have a weight of 1/e; // everything before that has a weight of (1-1/e) -const float ALPHA = (SECONDS_PER_DAY*30); +const float ALPHA = (SECONDS_PER_DAY*10); //const float ALPHA = 60; // for testing bool BOINC_OUTAGE::is_recent() const { @@ -127,11 +127,11 @@ void TIME_STATS::update(bool is_active) { } last_update = gstate.now; } -#if 0 - msg_printf(0, MSG_INFO, "on %f; active %f; conn %f", - on_frac, active_frac, connected_frac - ); -#endif + if (log_flags.time_debug) { + msg_printf(0, MSG_INFO, "dt %f w2 %f on %f; active %f; conn %f", + dt, w2, on_frac, active_frac, connected_frac + ); + } } void TIME_STATS::update_cpu_efficiency(double cpu_wall_time, double cpu_time) {