diff --git a/checkin_notes b/checkin_notes index 4004a3725b..bb4e1d4bda 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8006,3 +8006,20 @@ Charlie 18 June 2005 config.h (added) version.h version.h.in + +David 18 June 2005 + - CLIENT_STATE::set_scheduler_modes(): + Remove EDF simulation. + Instead, simulate weighted round-robin, + and if a deadline is missed, use EDF + - Remove PROJECT::exp_avg_cpu, PROJECT::exp_avg_mod_time. + This was an attempt, introduced a while back but never used, + to improve estimates of result CPU time. + It's fatally flawed because it assumes all results + from a project are the same #FLOPs. + It will soon be replaced by a better mechanism. + + client/ + client_types.C,h + cs_apps.C + cs_scheduler.C diff --git a/client/client_state.h b/client/client_state.h index d25b174acd..e6184dd11c 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -68,8 +68,6 @@ enum SUSPEND_REASON { SUSPEND_REASON_DISK_SIZE = 32 }; -#define CPU_HALF_LIFE (86400*7) - // CLIENT_STATE encapsulates the global variables of the core client. // If you add anything here, initialize it in the constructor // diff --git a/client/client_types.C b/client/client_types.C index 531a4857fa..092f1cf845 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -74,8 +74,6 @@ void PROJECT::init() { host_total_credit = 0; host_expavg_credit = 0; host_create_time = 0; - exp_avg_cpu = 0; - exp_avg_mod_time = 0; nrpc_failures = 0; master_fetch_failures = 0; min_rpc_time = 0; @@ -147,11 +145,6 @@ int PROJECT::parse_state(MIOFILE& in) { validate_time(user_create_time); continue; } - else if (parse_double(buf, "", exp_avg_cpu)) continue; - else if (parse_double(buf, "", exp_avg_mod_time)) { - validate_time(exp_avg_mod_time); - continue; - } else if (match_tag(buf, "")) { retval = copy_element_contents( in, @@ -218,8 +211,6 @@ int PROJECT::write_state(MIOFILE& out, bool gui_rpc) { " %f\n" " %f\n" " %f\n" - " %f\n" - " %f\n" " %d\n" " %d\n" " %f\n" @@ -245,8 +236,6 @@ int PROJECT::write_state(MIOFILE& out, bool gui_rpc) { host_total_credit, host_expavg_credit, host_create_time, - exp_avg_cpu, - exp_avg_mod_time, nrpc_failures, master_fetch_failures, min_rpc_time, @@ -310,8 +299,6 @@ void PROJECT::copy_state_fields(PROJECT& p) { host_total_credit = p.host_total_credit; host_expavg_credit = p.host_expavg_credit; host_create_time = p.host_create_time; - exp_avg_cpu = p.exp_avg_cpu; - exp_avg_mod_time = p.exp_avg_mod_time; nrpc_failures = p.nrpc_failures; master_fetch_failures = p.master_fetch_failures; min_rpc_time = p.min_rpc_time; diff --git a/client/client_types.h b/client/client_types.h index 7b0f19eb06..fe3c8cccdd 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -201,8 +201,6 @@ public: double host_total_credit; // as reported by server double host_expavg_credit; // as reported by server double host_create_time; // as reported by server - double exp_avg_cpu; // exponentially weighted CPU time - double exp_avg_mod_time; // last time average was changed int nrpc_failures; // # of consecutive times we've failed to // contact all scheduling servers int master_fetch_failures; diff --git a/client/cs_apps.C b/client/cs_apps.C index 4cc87b3273..2de63ed039 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -143,17 +143,7 @@ int CLIENT_STATE::app_finished(ACTIVE_TASK& at) { } else { rp->state = RESULT_FILES_UPLOADING; - // if success, update average CPU time per result for project - // - PROJECT* p = rp->project; - update_average( - gstate.now - rp->final_cpu_time, - // KLUDGE - should be result start time - rp->final_cpu_time, - CPU_HALF_LIFE, - p->exp_avg_cpu, - p->exp_avg_mod_time - ); + // HANDLE SUCCESS RESULTS HERE } double wall_cpu_time = now - cpu_sched_last_time; diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index d7b52dccdf..d8b233abdc 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -1005,7 +1005,7 @@ bool CLIENT_STATE::no_work_for_a_cpu() { void CLIENT_STATE::set_scheduler_modes() { std::map results_by_deadline; RESULT* rp; - unsigned int i; + unsigned int i, j; bool should_not_fetch_work = false; bool use_earliest_deadline_first = false; double frac_booked = 0; @@ -1016,8 +1016,38 @@ void CLIENT_STATE::set_scheduler_modes() { SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_SCHED_CPU); + // simulate weighted round-robin scheduling, + // and see if any result misses its deadline + // + bool round_robin_misses_deadline = false; + double rrs = runnable_resource_share(); + for (i=0; irunnable()) continue; + double proc_rate = total_proc_rate * (p->resource_share/rrs); + double start_time = now; + for (j=0; jproject != p) continue; + if (!rp->runnable()) continue; + start_time += rp->estimated_cpu_time_remaining()/proc_rate; + msg_printf(p, MSG_INFO, "result %s: est %f, deadline %f\n", + rp->name, start_time, rp->report_deadline + ); + if (start_time > rp->report_deadline) { + round_robin_misses_deadline = true; + break; + } + } + if (round_robin_misses_deadline) break; + } + if (round_robin_misses_deadline) { + use_earliest_deadline_first = true; + if (!no_work_for_a_cpu()) { + should_not_fetch_work = true; + } + } - std::vector::iterator it_u; for (i=0; icomputing_done()) continue; @@ -1041,9 +1071,12 @@ void CLIENT_STATE::set_scheduler_modes() { ); } +#if 0 results_by_deadline[rp->report_deadline] = rp; +#endif } +#if 0 for (i=0; i