From 79fb6e969e0896c53d2fb53ccdb6290e7dd13565 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 3 Dec 2008 19:50:06 +0000 Subject: [PATCH] - Remove the notion of "CPU efficiency" from both client and server. This wasn't being measured correctly for coproc/multithread apps, and its effect is now subsumed in DCF. svn path=/trunk/boinc/; revision=16610 --- checkin_notes | 21 +++++++++++++++++++++ client/app.cpp | 1 - client/app.h | 13 +++++-------- client/app_start.cpp | 1 - client/client_types.h | 2 +- client/cpu_sched.cpp | 10 ---------- client/cs_apps.cpp | 1 - client/sim_util.cpp | 1 - client/time_stats.cpp | 31 +++---------------------------- client/time_stats.h | 2 -- client/work_fetch.cpp | 2 +- db/boinc_db.h | 2 +- sched/handle_request.cpp | 1 - sched/sched_send.cpp | 6 +----- sched/server_types.cpp | 1 - 15 files changed, 33 insertions(+), 62 deletions(-) diff --git a/checkin_notes b/checkin_notes index a4510bead2..9019d01a8f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9798,3 +9798,24 @@ David 3 Dec 2008 lib/ gui_rpc_client.h gui_rpc_client_ops.cpp + +David 3 Dec 2008 + - Remove the notion of "CPU efficiency" from both client and server. + This wasn't being measured correctly for coproc/multithread apps, + and its effect is now subsumed in DCF. + + client/ + app.h,cpp + app_start.cpp + client_types.h + cpu_sched.cpp + cs_apps.cpp + sim_util.cpp + time_stats.h,cpp + work_fetch.cpp + db/ + boinc_db.h + sched/ + handle_request.cpp + sched_send.cpp + server_types.cpp diff --git a/client/app.cpp b/client/app.cpp index 1c4b0d68ee..5a25e43de3 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -102,7 +102,6 @@ ACTIVE_TASK::ACTIVE_TASK() { fraction_done = 0; episode_start_cpu_time = 0; run_interval_start_wall_time = gstate.now; - debt_interval_start_cpu_time = 0; checkpoint_cpu_time = 0; checkpoint_wall_time = 0; current_cpu_time = 0; diff --git a/client/app.h b/client/app.h index 06c8bf57bc..29735e69ae 100644 --- a/client/app.h +++ b/client/app.h @@ -73,18 +73,15 @@ public: /// Passed from the application via an API call; /// will be zero if the app doesn't use this call double fraction_done; - /// CPU time when adjust_debts() last ran - - /// Note: "CPU time" refers to the sum over all episodes. - /// (not counting the "lost" time after the last checkpoint - /// in episodes before the current one) - /// TODO: debt should be based on FLOPs, not CPU time - double debt_interval_start_cpu_time; - /// CPU time at the start of current episode double episode_start_cpu_time; /// Wall time at the start of the current run interval double run_interval_start_wall_time; /// CPU at the last checkpoint + /// Note: "CPU time" refers to the sum over all episodes. + /// (not counting the "lost" time after the last checkpoint + /// in episodes before the current one) + /// TODO: debt should be based on FLOPs, not CPU time + /// CPU time at the start of current episode double checkpoint_cpu_time; /// wall time at the last checkpoint double checkpoint_wall_time; diff --git a/client/app_start.cpp b/client/app_start.cpp index 8eba2b394a..28723001e6 100644 --- a/client/app_start.cpp +++ b/client/app_start.cpp @@ -400,7 +400,6 @@ int ACTIVE_TASK::start(bool first_time) { } current_cpu_time = checkpoint_cpu_time; episode_start_cpu_time = checkpoint_cpu_time; - debt_interval_start_cpu_time = checkpoint_cpu_time; graphics_request_queue.init(result->name); // reset message queues process_control_queue.init(result->name); diff --git a/client/client_types.h b/client/client_types.h index ab8fbba54f..3985a9e58d 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -348,7 +348,7 @@ public: /// X seconds of wall-clock time to complete, /// taking into account /// 1) this project's fractional resource share - /// 2) on_frac, active_frac, and cpu_effiency + /// 2) on_frac and active_frac /// see doc/sched.php double work_request; int work_request_urgency; diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index 525d36f13d..045376f1aa 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -316,12 +316,7 @@ void CLIENT_STATE::reset_debt_accounting() { PROJECT* p = projects[i]; p->wall_cpu_time_this_debt_interval = 0.0; } - for (i = 0; i < active_tasks.active_tasks.size(); ++i) { - ACTIVE_TASK* atp = active_tasks.active_tasks[i]; - atp->debt_interval_start_cpu_time = atp->current_cpu_time; - } total_wall_cpu_time_this_debt_interval = 0.0; - total_cpu_time_this_debt_interval = 0.0; debt_interval_start = now; } @@ -376,13 +371,8 @@ void CLIENT_STATE::adjust_debts() { atp->result->project->wall_cpu_time_this_debt_interval += wall_cpu_time; total_wall_cpu_time_this_debt_interval += wall_cpu_time; - total_cpu_time_this_debt_interval += atp->current_cpu_time - atp->debt_interval_start_cpu_time; } - time_stats.update_cpu_efficiency( - total_wall_cpu_time_this_debt_interval, total_cpu_time_this_debt_interval - ); - rrs = runnable_resource_share(); prrs = potentially_runnable_resource_share(); diff --git a/client/cs_apps.cpp b/client/cs_apps.cpp index c734507714..6d667903a8 100644 --- a/client/cs_apps.cpp +++ b/client/cs_apps.cpp @@ -205,7 +205,6 @@ int CLIENT_STATE::app_finished(ACTIVE_TASK& at) { double wall_cpu_time = now - debt_interval_start; at.result->project->wall_cpu_time_this_debt_interval += wall_cpu_time; total_wall_cpu_time_this_debt_interval += wall_cpu_time; - total_cpu_time_this_debt_interval += at.current_cpu_time - at.debt_interval_start_cpu_time; return 0; } diff --git a/client/sim_util.cpp b/client/sim_util.cpp index 8edb73454c..5190f8a15e 100644 --- a/client/sim_util.cpp +++ b/client/sim_util.cpp @@ -291,7 +291,6 @@ ACTIVE_TASK::ACTIVE_TASK() { fraction_done = 0; episode_start_cpu_time = 0; run_interval_start_wall_time = gstate.now; - debt_interval_start_cpu_time = 0; checkpoint_cpu_time = 0; checkpoint_wall_time = 0; current_cpu_time = 0; diff --git a/client/time_stats.cpp b/client/time_stats.cpp index acf5c80af8..6c05dc320d 100644 --- a/client/time_stats.cpp +++ b/client/time_stats.cpp @@ -83,7 +83,6 @@ TIME_STATS::TIME_STATS() { on_frac = 1; connected_frac = 1; active_frac = 1; - cpu_efficiency = 1; previous_connected_state = CONNECTED_STATE_UNINITIALIZED; inactive_start = 0; trim_stats_log(); @@ -236,24 +235,6 @@ void TIME_STATS::update(int suspend_reason) { } } -void TIME_STATS::update_cpu_efficiency(double cpu_wall_time, double cpu_time) { - double old_cpu_efficiency = cpu_efficiency; - if (cpu_wall_time < .01) return; - double w = exp(-cpu_wall_time/SECONDS_PER_DAY); - double e = cpu_time/cpu_wall_time; - if (e<0) { - return; - } - cpu_efficiency = w*cpu_efficiency + (1-w)*e; - if (log_flags.cpu_sched_debug){ - msg_printf(0, MSG_INFO, - "[cpu_sched_debug] CPU efficiency old %f new %f wall %f CPU %f w %f e %f", - old_cpu_efficiency, cpu_efficiency, cpu_wall_time, - cpu_time, w, e - ); - } -} - // Write XML based time statistics // int TIME_STATS::write(MIOFILE& out, bool to_server) { @@ -261,12 +242,10 @@ int TIME_STATS::write(MIOFILE& out, bool to_server) { "\n" " %f\n" " %f\n" - " %f\n" - " %f\n", + " %f\n", on_frac, connected_frac, - active_frac, - cpu_efficiency + active_frac ); if (!to_server) { out.printf( @@ -289,11 +268,7 @@ int TIME_STATS::parse(MIOFILE& in) { else if (parse_double(buf, "", on_frac)) continue; else if (parse_double(buf, "", connected_frac)) continue; else if (parse_double(buf, "", active_frac)) continue; - else if (parse_double(buf, "", cpu_efficiency)) { - if (cpu_efficiency < 0) cpu_efficiency = 1; - if (cpu_efficiency > 1) cpu_efficiency = 1; - continue; - } else { + else { if (log_flags.unparsed_xml) { msg_printf(0, MSG_INFO, "[unparsed_xml] TIME_STATS::parse(): unrecognized: %s\n", buf diff --git a/client/time_stats.h b/client/time_stats.h index d198b0118e..764ec51922 100644 --- a/client/time_stats.h +++ b/client/time_stats.h @@ -42,13 +42,11 @@ public: /// May be less than one if /// 1) apps page or do I/O /// 2) other CPU-intensive apps run - double cpu_efficiency; FILE* time_stats_log; double inactive_start; void update(int suspend_reason); - void update_cpu_efficiency(double cpu_wall_time, double cpu_time); TIME_STATS(); int write(MIOFILE&, bool to_server); diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 0f0b2729f5..b5fd43a20a 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -280,7 +280,7 @@ PROJECT* CLIENT_STATE::find_project_with_overdue_results() { // the fraction of time a given CPU is working for BOINC // double CLIENT_STATE::overall_cpu_frac() { - double running_frac = time_stats.on_frac * time_stats.active_frac * time_stats.cpu_efficiency; + double running_frac = time_stats.on_frac * time_stats.active_frac; if (running_frac < 0.01) running_frac = 0.01; if (running_frac > 1) running_frac = 1; return running_frac; diff --git a/db/boinc_db.h b/db/boinc_db.h index 444cbb737a..19f4f12ea3 100644 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -235,7 +235,7 @@ struct HOST { double on_frac; // see client/time_stats.h double connected_frac; double active_frac; - double cpu_efficiency; + double cpu_efficiency; // deprecated as of 6.4 client double duration_correction_factor; int p_ncpus; // Number of CPUs on host diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index ce0b89975b..9cfa6be10a 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -619,7 +619,6 @@ static int modify_host_struct(SCHEDULER_REQUEST& sreq, HOST& host) { host.on_frac = sreq.host.on_frac; host.connected_frac = sreq.host.connected_frac; host.active_frac = sreq.host.active_frac; - host.cpu_efficiency = sreq.host.cpu_efficiency; host.duration_correction_factor = sreq.host.duration_correction_factor; host.p_ncpus = sreq.host.p_ncpus; strncpy(host.p_vendor, sreq.host.p_vendor, sizeof(host.p_vendor)); diff --git a/sched/sched_send.cpp b/sched/sched_send.cpp index ac95032e6a..09b90deebb 100644 --- a/sched/sched_send.cpp +++ b/sched/sched_send.cpp @@ -359,9 +359,6 @@ static double estimate_wallclock_duration( if (reply.host.duration_correction_factor) { ewd *= reply.host.duration_correction_factor; } - if (reply.host.cpu_efficiency) { - ewd /= reply.host.cpu_efficiency; - } if (config.debug_send) { log_messages.printf(MSG_DEBUG, "est cpu dur %f; est wall dur %f\n", ecd, ewd @@ -1399,10 +1396,9 @@ void send_work(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { (int)sreq.global_prefs.work_buf_min() ); log_messages.printf(MSG_DEBUG, - "running frac %f DCF %f CPU effic %f est delay %d\n", + "running frac %f DCF %f est delay %d\n", reply.wreq.running_frac, reply.host.duration_correction_factor, - reply.host.cpu_efficiency, (int)sreq.estimated_delay ); } diff --git a/sched/server_types.cpp b/sched/server_types.cpp index d38bdfc7b5..6d3ec1143d 100644 --- a/sched/server_types.cpp +++ b/sched/server_types.cpp @@ -1045,7 +1045,6 @@ int HOST::parse_time_stats(FILE* fin) { if (parse_double(buf, "", on_frac)) continue; if (parse_double(buf, "", connected_frac)) continue; if (parse_double(buf, "", active_frac)) continue; - if (parse_double(buf, "", cpu_efficiency)) continue; if (match_tag(buf, "")) continue; if (match_tag(buf, "")) continue; if (match_tag(buf, "")) continue;