diff --git a/checkin_notes b/checkin_notes index 0d65242a52..919b25ba5b 100755 --- a/checkin_notes +++ b/checkin_notes @@ -1588,3 +1588,11 @@ David 7 Feb 2006 lib/ gui_rpc_client.h gui_rpc_client_ops.C + +David 7 Feb 2006 + - remove the "new CPU scheduler" code I added a couple weeks ago (sigh) + + client/ + client_state.h + client_types.h + cs_apps.C diff --git a/client/client_state.h b/client/client_state.h index bc70c3a9f2..47c744f092 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -20,8 +20,6 @@ #ifndef _CLIENT_STATE_ #define _CLIENT_STATE_ -//#define NEW_CPU_SCHED - #ifndef _WIN32 #include #include @@ -72,15 +70,6 @@ enum SUSPEND_REASON { SUSPEND_REASON_DISK_SIZE = 32 }; -#ifdef NEW_CPU_SCHED -struct CPU_SCHEDULER { - void do_accounting(); - void make_schedule(); - void enforce(); - void clear_tasks(); -}; -#endif - // CLIENT_STATE encapsulates the global variables of the core client. // If you add anything here, initialize it in the constructor // @@ -92,9 +81,6 @@ public: std::vector app_versions; std::vector workunits; std::vector results; -#ifdef NEW_CPU_SCHED - CPU_SCHEDULER cpu_scheduler; -#endif NET_XFER_SET* net_xfers; PERS_FILE_XFER_SET* pers_file_xfers; @@ -315,12 +301,10 @@ private: int choose_version_num(char*, SCHEDULER_REPLY&); int app_finished(ACTIVE_TASK&); -#ifndef NEW_CPU_SCHED void assign_results_to_projects(); bool schedule_largest_debt_project(double expected_pay_off); bool schedule_earliest_deadline_result(); bool schedule_cpus(); -#endif bool start_apps(); bool handle_finished_apps(); void handle_file_xfer_apps(); diff --git a/client/client_types.h b/client/client_types.h index 737de198ee..502830fa18 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -22,8 +22,6 @@ // client_state.C (to cross-link objects) // -//#define NEW_CPU_SCHED - #ifndef _CLIENT_TYPES_ #define _CLIENT_TYPES_ @@ -55,10 +53,6 @@ #define FILE_NOT_PRESENT 0 #define FILE_PRESENT 1 -#ifdef NEW_CPU_SCHED -struct PRESULT; -#endif - class FILE_INFO { public: char name[256]; @@ -301,17 +295,6 @@ public: bool checked; // temporary used when scanning projects -#ifdef NEW_CPU_SCHED - double cpu_share; - double needed_cpu_share; - bool in_emergency; - double emergency_resource_share; - void get_ordered_runnable_results(std::vector&); - void compute_cpu_share_needed(); - bool has_emergency(double); - void allocate(double); -#endif - // vars related to file-transfer backoff // file_xfer_failures_up: count of consecutive upload failures // next_file_xfer_up: when to start trying uploads again @@ -479,19 +462,6 @@ struct RESULT { bool already_selected; // used to keep cpu scheduler from scheduling a result twice // transient; used only within schedule_cpus() -#ifdef NEW_CPU_SCHED - double cpu_share; -#endif }; -#ifdef NEW_CPU_SCHED -struct PRESULT { - RESULT* p; -}; -inline bool operator<(const PRESULT& a, const PRESULT& b) { - return a.p->report_deadline < b.p->report_deadline; -} -#endif - - #endif diff --git a/client/cs_apps.C b/client/cs_apps.C index e473cd53db..20dfc4ae4c 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -225,8 +225,6 @@ bool CLIENT_STATE::input_files_available(RESULT* rp) { } -#ifndef NEW_CPU_SCHED - // Choose a "best" runnable result for each project // // Values are returned in project->next_runnable_result @@ -304,7 +302,6 @@ void CLIENT_STATE::assign_results_to_projects() { } } -#endif // if there's not an active task for the result, make one // @@ -321,7 +318,6 @@ int CLIENT_STATE::schedule_result(RESULT* rp) { return 0; } -#ifndef NEW_CPU_SCHED // Schedule an active task for the project with the largest anticipated debt // among those that have a runnable result. @@ -380,7 +376,6 @@ bool CLIENT_STATE::schedule_earliest_deadline_result() { best_result->already_selected = true; return true; } -#endif // find total resource shares of all projects // @@ -420,7 +415,6 @@ double CLIENT_STATE::potentially_runnable_resource_share() { return x; } -#ifndef NEW_CPU_SCHED // adjust project debts (short, long-term) // NOTE: currently there's the assumption that the only @@ -685,7 +679,6 @@ bool CLIENT_STATE::schedule_cpus() { int CLIENT_STATE::restart_tasks() { return active_tasks.restart_tasks(ncpus); } -#endif void CLIENT_STATE::set_ncpus() { if (host_info.p_ncpus > 0) { @@ -758,211 +751,4 @@ void CLIENT_STATE::request_schedule_cpus(const char* where) { msg_printf(0, MSG_INFO, "Rescheduling CPU: %s", where); } -#ifdef NEW_CPU_SCHED - -void PROJECT::get_ordered_runnable_results(vector& presults) { - presults.clear(); - for (unsigned int i=0; iproject != this) continue; - if (!rp->runnable()) continue; - PRESULT pr; - pr.p = rp; - presults.push_back(pr); - } - sort(presults.begin(), presults.end()); -} - -// compute the immediate CPU shares needed for each result, -// and for the project, to meet all deadlines -// and finish past-due work as quickly as possible -// -void PROJECT::compute_cpu_share_needed() { - cpu_share = 0; - double time = gstate.now, dt, wcn, x; - vector presults; - unsigned int i; - - get_ordered_runnable_results(presults); - for (i=0; ireport_deadline < gstate.now) { - cpu_share += 1; - r->cpu_share = 1; - } else { - dt = r->report_deadline - time; - if (dt) { - wcn = r->estimated_cpu_time_remaining(); - double cs = wcn/dt; - if (cs > cpu_share) { - double x = (wcn + cpu_share*(time-gstate.now))/(r->report_deadline-gstate.now); - r->cpu_share = x - cpu_share; - cpu_share = x; - } else { - r->cpu_share = 0; - } - } else { - x = wcn/(time-gstate.now)-cpu_share; - cpu_share += x; - r->cpu_share = x; - } - } - time = r->report_deadline; - } - needed_cpu_share = cpu_share; -} - -bool PROJECT::has_emergency(double rrs) { - double cpu_share = gstate.ncpus*resource_share/rrs; - return needed_cpu_share > cpu_share; -} - -// given a CPU share, choose results to run, -// and assign their CPU shares -// -void PROJECT::allocate(double cpu_share_left) { - vector presults; - - get_ordered_runnable_results(presults); - for (unsigned i=0; icpu_share) { - gstate.schedule_result(r); - ACTIVE_TASK* atp = gstate.lookup_active_task_by_result(r); - atp->scheduler_state = CPU_SCHED_SCHEDULED; - if (r->cpu_share > cpu_share_left) { - r->cpu_share = cpu_share_left; - } - cpu_share_left -= r->cpu_share; - if (cpu_share_left == 0) break; - } - } -} - -#define EMERGENCY_LIMIT 86400*7 - -void CPU_SCHEDULER::clear_tasks() { - ACTIVE_TASK* atp; - unsigned int i; - for (i=0; inon_cpu_intensive) { - atp->next_scheduler_state = CPU_SCHED_SCHEDULED; - } else { - atp->next_scheduler_state = CPU_SCHED_PREEMPTED; - } - } -} - -void CPU_SCHEDULER::do_accounting() { - unsigned int i; - static double last_time; - double dt = gstate.now - last_time; - last_time = gstate.now; - - for (i=0; iin_emergency) { - p->emergency_budget -= dt*p->emergency_resource_share; - if (p->emergency_budget < 0) { - p->emergency_eligible = false; - } - } else { - p->emergency_budget += dt; - if (p->emergency_budget > EMERGENCY_LIMIT) { - p->emergency_eligible = true; - p->emergency_budget = EMERGENCY_LIMIT; - } - } - } -#endif -} - -// Called whenever something happens that could change the schedule; -// Also called periodically (every few hours) -// in case results in a schedule are going slower or faster -// than expected (which could change the schedule) -// -void CPU_SCHEDULER::make_schedule() { - bool have_emergency=false; - double non_emergency_rs = 0, cs, cpu_share_left; - PROJECT* p; - unsigned int i; - double rrs = gstate.runnable_resource_share(); - - clear_tasks(); - - for (i=0; irunnable()) continue; - p->compute_cpu_share_needed(); - if (p->has_emergency(rrs)) { - have_emergency = true; - } else { - non_emergency_rs += p->resource_share; - } - } - - cpu_share_left = gstate.ncpus; - if (have_emergency) { - for (i=0; irunnable()) continue; - if (p->has_emergency(rrs)) { - p->allocate(cpu_share_left); - if (cpu_share_left <= 0) break; - } - } - if (cpu_share_left) { - for (i=0; irunnable()) continue; - if (!p->has_emergency(rrs)) { - cs = cpu_share_left*p->resource_share/non_emergency_rs; - p->allocate(cs); - } - } - } - } else { - for (i=0; irunnable()) continue; - cs = cpu_share_left*p->resource_share/non_emergency_rs; - p->allocate(cs); - } - } -} - -// called every ~10 seconds to time-slice among results in a schedule -// Handle checkpoint detection here. -// make_schedule() has already been called. -// -void CPU_SCHEDULER::enforce() { - static bool first = true; - - if (first) { - //for results R in schedule by decreasing STD - // start R - first = false; - return; - } - - do_accounting(); - - //for each running task T not in schedule - // T.abort -} - -#endif - const char *BOINC_RCSID_7bf63ad771 = "$Id$"; diff --git a/doc/gui_rpc.php b/doc/gui_rpc.php index 22f6354cfe..7185065edf 100644 --- a/doc/gui_rpc.php +++ b/doc/gui_rpc.php @@ -167,6 +167,11 @@ list_item_func( "Tells the core client that a network connection is available, and that it should do as much network activity as it can." ); +list_item_func( + "read_global_prefs_override()", + "Tells the core client to reread the 'global_prefs_override.xml' file, + modifying the global preferences according to its contents." +); list_end(); echo "

diff --git a/doc/index.php b/doc/index.php index 1715a400da..a14da0ed7b 100644 --- a/doc/index.php +++ b/doc/index.php @@ -105,6 +105,7 @@ resources.

  • Account managers
  • Server status web sites
  • Web RPCs for info about users and hosts +
  • Local editing of preferences