From 5b39ce7f39e032d31512985799cd5af58ce594cf Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 5 Apr 2006 05:50:34 +0000 Subject: [PATCH] cpu sched svn path=/trunk/boinc/; revision=9798 --- checkin_notes | 15 +++++++++++++++ client/client_types.C | 14 ++++++++++++++ client/client_types.h | 1 + client/cpu_sched.C | 2 +- client/cs_scheduler.C | 8 ++++++-- 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 5c1376b11a..2e5e832b5f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -3548,3 +3548,18 @@ David 4 Apr 2006 html/ops/ db_cleanse.php + +David 4 Apr 2006 + - core client: define a result's "computation deadline": + it's report deadline minus network connect period + and minus cpu scheduling period. + Use this, rather than report deadline, in CPU scheduling. + - take network connect period into account in deciding + when results have to be reported + + (from John McLeod) + + client/ + client_types.C,h + cpu_sched.C + cs_scheduler.C diff --git a/client/client_types.C b/client/client_types.C index 58d4b90009..b241186d29 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -1230,6 +1230,20 @@ void RESULT::clear() { project = NULL; } +// Results must be complete early enough to report before the report deadline. +// Not all hosts are connected all of the time. +// +double RESULT::computation_deadline() { + return report_deadline - ( + gstate.global_prefs.work_buf_min_days * SECONDS_PER_DAY + // Seconds that the host will not be connected to the Internet + + gstate.global_prefs.cpu_scheduling_period_minutes * 60 + // Seconds that the CPU may be busy with some other result + + SECONDS_PER_DAY + // Deadline cusion + ); +} + // parse a element from scheduling server. // int RESULT::parse_server(MIOFILE& in) { diff --git a/client/client_types.h b/client/client_types.h index 16bae38f24..0372889685 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -464,6 +464,7 @@ struct RESULT { bool already_selected; // used to keep cpu scheduler from scheduling a result twice // transient; used only within schedule_cpus() + double computation_deadline(); }; #endif diff --git a/client/cpu_sched.C b/client/cpu_sched.C index 8234dfa795..966e00ad20 100644 --- a/client/cpu_sched.C +++ b/client/cpu_sched.C @@ -530,7 +530,7 @@ bool CLIENT_STATE::rr_misses_deadline(double per_cpu_proc_rate, double rrs) { // "rpbest" is first result to finish. Does it miss its deadline? // - double diff = sim_now + rpbest->rrsim_finish_delay - rpbest->report_deadline; + double diff = sim_now + rpbest->rrsim_finish_delay - rpbest->computation_deadline(); if (diff > 0) { scope_messages.printf( "rr_sim: result %s misses deadline by %f\n", rpbest->name, diff diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 472b6da186..9ba3518918 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -447,13 +447,17 @@ PROJECT* CLIENT_STATE::find_project_with_overdue_results() { if (have_sporadic_connection) { return p; } - if (gstate.now > r->report_deadline - REPORT_DEADLINE_CUSHION) { + double cushion = std::max( + (double)REPORT_DEADLINE_CUSHION, + global_prefs.work_buf_min_days * SECONDS_PER_DAY + ); + if (gstate.now > r->report_deadline - cushion) { return p; } if (gstate.now > r->completed_time + global_prefs.work_buf_min_days*SECONDS_PER_DAY) { return p; } - } +} return 0; }