From 5765befdd275dd82c5b5f972b81a62639cecd041 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 12 Apr 2015 13:31:48 -0500 Subject: [PATCH] Client: fix bugs in accounting of elapsed time_stats_log e.g. if you set, and you suspend CPU, NCI tasks continue to run but their elapsed time wouldn't increase. --- client/app_control.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/client/app_control.cpp b/client/app_control.cpp index 73ca70dea2..0add02e73d 100644 --- a/client/app_control.cpp +++ b/client/app_control.cpp @@ -1478,23 +1478,14 @@ void ACTIVE_TASK_SET::get_msgs() { } last_time = gstate.now; - double et_diff, et_diff_throttle; - switch (gstate.suspend_reason) { - case 0: - case SUSPEND_REASON_CPU_THROTTLE: - et_diff = delta_t; - et_diff_throttle = delta_t * gstate.global_prefs.cpu_usage_limit/100; - break; - default: - et_diff = et_diff_throttle = 0; - break; - } + double et_diff = delta_t; + double et_diff_throttle = delta_t * gstate.global_prefs.cpu_usage_limit/100; for (i=0; iprocess_exists()) continue; old_time = atp->checkpoint_cpu_time; - if (atp->scheduler_state == CPU_SCHED_SCHEDULED) { + if (atp->task_state() == PROCESS_EXECUTING) { double x = atp->result->dont_throttle()?et_diff:et_diff_throttle; atp->elapsed_time += x; atp->wup->project->elapsed_time += x;