diff --git a/checkin_notes b/checkin_notes index c6ffdd17ce..0f6da0f54f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -18789,3 +18789,12 @@ Jeff 22 Oct 2004 db/ boinc_db.C +David 22 Oct 2004 + - schedule_cpus(): assume that if a task ran for X seconds, + it got X seconds of CPU time. + This makes the schedule work correctly even when + apps don't report their CPU time. + + client/ + client_state.C + cs_apps.C diff --git a/client/client_state.C b/client/client_state.C index c48bff1576..a367014f59 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -283,7 +283,7 @@ int CLIENT_STATE::init() { // set period start time and reschedule // must_schedule_cpus = true; - cpu_sched_last_time = time(NULL); + cpu_sched_last_time = dtime(); // set up the project and slot directories // diff --git a/client/cs_apps.C b/client/cs_apps.C index c957ae0346..e93fef2aae 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -354,10 +354,10 @@ bool CLIENT_STATE::schedule_cpus(double now) { // or if must_schedule_cpus is set // (meaning a new result is available, or a CPU has been freed). // + elapsed_time = now - cpu_sched_last_time; if (must_schedule_cpus) { must_schedule_cpus = false; } else { - elapsed_time = now - cpu_sched_last_time; if (elapsed_time < (global_prefs.cpu_scheduling_period_minutes*60)) { return false; } @@ -389,7 +389,8 @@ bool CLIENT_STATE::schedule_cpus(double now) { for (i=0; ischeduler_state != CPU_SCHED_SCHEDULED) continue; - double task_cpu_time = atp->current_cpu_time - atp->cpu_time_at_last_sched; + //double task_cpu_time = atp->current_cpu_time - atp->cpu_time_at_last_sched; + double task_cpu_time = elapsed_time; atp->result->project->work_done_this_period += task_cpu_time; cpu_sched_work_done_this_period += task_cpu_time; atp->next_scheduler_state = CPU_SCHED_PREEMPTED;