- 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
This commit is contained in:
David Anderson 2008-12-03 19:50:06 +00:00
parent e6a87070f3
commit 79fb6e969e
15 changed files with 33 additions and 62 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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;
}

View File

@ -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;

View File

@ -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) {
"<time_stats>\n"
" <on_frac>%f</on_frac>\n"
" <connected_frac>%f</connected_frac>\n"
" <active_frac>%f</active_frac>\n"
" <cpu_efficiency>%f</cpu_efficiency>\n",
" <active_frac>%f</active_frac>\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>", on_frac)) continue;
else if (parse_double(buf, "<connected_frac>", connected_frac)) continue;
else if (parse_double(buf, "<active_frac>", active_frac)) continue;
else if (parse_double(buf, "<cpu_efficiency>", 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

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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));

View File

@ -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
);
}

View File

@ -1045,7 +1045,6 @@ int HOST::parse_time_stats(FILE* fin) {
if (parse_double(buf, "<on_frac>", on_frac)) continue;
if (parse_double(buf, "<connected_frac>", connected_frac)) continue;
if (parse_double(buf, "<active_frac>", active_frac)) continue;
if (parse_double(buf, "<cpu_efficiency>", cpu_efficiency)) continue;
if (match_tag(buf, "<outages>")) continue;
if (match_tag(buf, "<outage>")) continue;
if (match_tag(buf, "<start>")) continue;