From 4b431ad1296d7e520ea9ff5b002e5fb2e6cb0f36 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 24 May 2005 00:33:08 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=6228 --- checkin_notes | 13 ++++++ client/app.C | 5 +-- client/client_types.C | 5 +-- client/cs_apps.C | 95 ++++++++++++++++++++++--------------------- client/cs_scheduler.C | 12 ++---- client/scheduler_op.C | 1 - doc/menubar.php | 7 +++- doc/versions.inc | 12 ++---- 8 files changed, 79 insertions(+), 71 deletions(-) diff --git a/checkin_notes b/checkin_notes index fbf7888a21..b19f693ff1 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6960,3 +6960,16 @@ Rom 23 May 2005 / configure.ac + +David 23 May 2005 + - scheduler fixes (from John McLeod and others) + - estimate remaining CPU correctly if frac done = 0 + - avoid div by zero error + - fix seconds-per-day scaling problem + + client/ + app.C + client_types.C + cs_apps.C + cs_scheduler.C + scheduler_op.C diff --git a/client/app.C b/client/app.C index aebdc93be9..48b46502a3 100644 --- a/client/app.C +++ b/client/app.C @@ -292,11 +292,10 @@ int ACTIVE_TASK::move_trickle_file() { // Returns the estimated CPU time to completion (in seconds) of this task, // based on current reported CPU time and fraction done +// CALL THIS ONLY IF FRACTION_DONE > 0 // double ACTIVE_TASK::est_cpu_time_to_completion() { - if (fraction_done <= 0 || fraction_done > 1) { - return 0; - } + if (fraction_done >= 1) return 0; return (current_cpu_time / fraction_done) - current_cpu_time; } diff --git a/client/client_types.C b/client/client_types.C index a570eb5fe3..15300c73d7 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -1370,9 +1370,8 @@ double RESULT::estimated_cpu_time_remaining() { if (state >= RESULT_COMPUTE_ERROR) return -1; ACTIVE_TASK* atp = gstate.lookup_active_task_by_result(this); - if (atp) { - x = atp->est_cpu_time_to_completion(); - if (x >= 0) return x; + if (atp && atp->fraction_done > 0) { + return atp->est_cpu_time_to_completion(); } return estimated_cpu_time(); } diff --git a/client/cs_apps.C b/client/cs_apps.C index 10ea7dd416..7f6adc0af8 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -366,6 +366,7 @@ bool CLIENT_STATE::schedule_earliest_deadline_result(double expected_pay_off) { if (r->project->suspended_via_gui) continue; if (r->project->non_cpu_intensive) continue; if (r->already_selected) continue; + if (r->suspended_via_gui) continue; if (first || r->report_deadline < earliest_deadline) { first = false; best_project = r->project; @@ -462,58 +463,60 @@ bool CLIENT_STATE::schedule_cpus(double now) { } } - // adjust project debts - // reset debts for projects with no runnable results - // reset temporary fields - // - first = true; - double total_long_term_debt = 0; - int count_cpu_intensive = 0; - for (i=0; inon_cpu_intensive) continue; - count_cpu_intensive++; - double debt_inc = - (p->resource_share/local_total_resource_share) - * cpu_sched_work_done_this_period - - p->work_done_this_period; - p->long_term_debt += debt_inc; - total_long_term_debt += p->long_term_debt; - if (!p->next_runnable_result) { - p->debt = 0; - p->anticipated_debt = 0; - } else { - p->debt += debt_inc; - if (first) { - first = false; - min_debt = p->debt; - } else if (p->debt < min_debt) { - min_debt = p->debt; + if (local_total_resource_share > 0) { + // adjust project debts + // reset debts for projects with no runnable results + // reset temporary fields + // + first = true; + double total_long_term_debt = 0; + int count_cpu_intensive = 0; + for (i=0; inon_cpu_intensive) continue; + count_cpu_intensive++; + double debt_inc = + (p->resource_share/local_total_resource_share) + * cpu_sched_work_done_this_period + - p->work_done_this_period; + p->long_term_debt += debt_inc; + total_long_term_debt += p->long_term_debt; + if (!p->next_runnable_result) { + p->debt = 0; + p->anticipated_debt = 0; + } else { + p->debt += debt_inc; + if (first) { + first = false; + min_debt = p->debt; + } else if (p->debt < min_debt) { + min_debt = p->debt; + } } + scope_messages.printf( + "CLIENT_STATE::schedule_cpus(): overall project debt; project '%s', debt '%f'\n", + p->project_name, p->debt + ); } - scope_messages.printf( - "CLIENT_STATE::schedule_cpus(): overall project debt; project '%s', debt '%f'\n", - p->project_name, p->debt - ); - } - double avg_long_term_debt = total_long_term_debt / count_cpu_intensive; + double avg_long_term_debt = total_long_term_debt / count_cpu_intensive; - // Normalize debts to zero - // - for (i=0; inon_cpu_intensive) continue; - if (p->next_runnable_result) { - p->debt -= min_debt; - if (p->debt > MAX_DEBT) { - p->debt = MAX_DEBT; + // Normalize debts to zero + // + for (i=0; inon_cpu_intensive) continue; + if (p->next_runnable_result) { + p->debt -= min_debt; + if (p->debt > MAX_DEBT) { + p->debt = MAX_DEBT; + } + p->anticipated_debt = p->debt; + //msg_printf(p, MSG_INFO, "debt %f", p->debt); + p->next_runnable_result = NULL; } - p->anticipated_debt = p->debt; - //msg_printf(p, MSG_INFO, "debt %f", p->debt); - p->next_runnable_result = NULL; + p->long_term_debt -= avg_long_term_debt; } - p->long_term_debt -= avg_long_term_debt; } // schedule tasks for projects in order of decreasing anticipated debt diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 6a217c020d..e480418daf 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -434,7 +434,6 @@ double CLIENT_STATE::ettprc(PROJECT *p, int k) { // int CLIENT_STATE::compute_work_requests() { int urgency = WORK_FETCH_DONT_NEED; - int highest_project_urgency = WORK_FETCH_DONT_NEED; unsigned int i; double work_min_period = global_prefs.work_buf_min_days * SECONDS_PER_DAY; double now = dtime(); @@ -512,8 +511,6 @@ int CLIENT_STATE::compute_work_requests() { p->work_request = global_work_need; } - highest_project_urgency = max(highest_project_urgency, p->work_request_urgency); - // determine work requests for each project // NOTE: don't need to divide by active_frac etc.; // the scheduler does that (see sched/sched_send.C) @@ -1079,18 +1076,17 @@ void CLIENT_STATE::set_cpu_scheduler_modes() { cpu_earliest_deadline_first = use_earliest_deadline_first; } -double CLIENT_STATE::work_needed_secs() -{ +double CLIENT_STATE::work_needed_secs() { double total_work = 0; for( unsigned int i = 0; i < results.size(); ++i) { if (results[i]->project->non_cpu_intensive) continue; total_work += results[i]->estimated_cpu_time_remaining(); } - if (total_work > global_prefs.work_buf_min_days) { + double x = global_prefs.work_buf_min_days*SECONDS_PER_DAY - total_work; + if (x < 0) { return 0; - } else { - return global_prefs.work_buf_min_days - total_work; } + return x; } const char *BOINC_RCSID_d35a4a7711 = "$Id$"; diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 5fbf3f6648..7669b8ff14 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -206,7 +206,6 @@ void SCHEDULER_OP::backoff(PROJECT* p, const char *error_msg ) { p->nrpc_failures++; } set_min_rpc_time(p); - p->long_term_debt -= (p->min_rpc_time - dtime()) / gstate.global_prefs.max_projects_on_client; } // low-level routine to initiate an RPC diff --git a/doc/menubar.php b/doc/menubar.php index ff97203b37..d413836c3e 100644 --- a/doc/menubar.php +++ b/doc/menubar.php @@ -1,6 +1,6 @@ Adds ability to manually run benchmarks
  • Improved efficiency
  • +

     

    +

    Version 4.43 (4)

    +
      +
    • Includes improved BOINC client
    + "; page_tail(); diff --git a/doc/versions.inc b/doc/versions.inc index 97799db292..00c67d2022 100644 --- a/doc/versions.inc +++ b/doc/versions.inc @@ -161,18 +161,12 @@ $m419 = array( ); $m437s = array( - "num"=>"4.37 (3)", + "num"=>"4.43 (4)", "status"=>"Development version (simple GUI)", - "file"=>"boinc_menubar_v4.37_(3)_mac.zip", - "date"=>"14 May 2005", + "file"=>"boinc_menubar_v4.43_(4)_mac.zip", + "date"=>"23 May 2005", "type"=>mac_simple(), "bugs"=>"
  • Includes improved BOINC client
  • -
  • Fixes a problem which prevented some users from using proxies
  • -
  • Now displays the current status in the menubar by changing the icon and indicating the amount of work completed
  • -
  • Fixes a bug on dual processor machines where the status of both processes was not always being displayed
  • -
  • Adds a preference to share data between users
  • Improves security by hiding and encrypting proxy password
  • -
  • Adds ability to manually run benchmarks
  • -
  • Improved efficiency
  • " );