From ef6fb9589a2e42793f5c9e4104916bd088ea7a40 Mon Sep 17 00:00:00 2001 From: Lana Alber Date: Fri, 24 Sep 2004 19:54:39 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4236 --- checkin_notes | 9 +++++++++ client/client_state.C | 4 ---- client/client_state.h | 1 - client/cs_apps.C | 2 +- client/cs_statefile.C | 5 ----- client/prefs.C | 4 ++-- client/prefs.h | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8da5f70eea..d5864b80d3 100755 --- a/checkin_notes +++ b/checkin_notes @@ -17673,3 +17673,12 @@ David 23 Sept 2004 client_types.C,h cs_scheduler.C scheduler_op.C,h + +Lana 23 Sept 2004 + - refactored access and storage to cpu_sched_period for the project. + now it is being maintained in global prefs only. + + client/ + cs_statefile.C + cs_apps.C + client_state.C,h diff --git a/client/client_state.C b/client/client_state.C index 66fc3d74a4..ccb88a752e 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -106,7 +106,6 @@ CLIENT_STATE::CLIENT_STATE() { pers_giveup = PERS_GIVEUP; executing_as_windows_service = false; cpu_sched_last_time = 0; - cpu_sched_period = 3600; // 1 hour cpu_sched_work_done_this_period = 0; must_schedule_cpus = false; } @@ -290,9 +289,6 @@ int CLIENT_STATE::init() { // set period start time cpu_sched_last_time = time(NULL); - // set initial work_done_this_period so project debts are non-zero - cpu_sched_work_done_this_period = cpu_sched_period * ncpus; - // set up the project and slot directories // retval = make_project_dirs(); diff --git a/client/client_state.h b/client/client_state.h index c92936b2fa..638647c94f 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -142,7 +142,6 @@ private: // CPU sched state // time_t cpu_sched_last_time; - int cpu_sched_period; double cpu_sched_work_done_this_period; // --------------- client_state.C: diff --git a/client/cs_apps.C b/client/cs_apps.C index a76a25da85..a243e7b7bc 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -350,7 +350,7 @@ bool CLIENT_STATE::schedule_cpus() { must_schedule_cpus = false; } else { elapsed_time = time(0) - cpu_sched_last_time; - if (elapsed_time", old_major_version)) { } else if (parse_int(buf, "", old_minor_version)) { - } else if (parse_int(buf, "", cpu_sched_period)) { } else if (parse_double(buf, "", cpu_sched_work_done_this_period)) { } else if (match_tag(buf, "")) { retval = pi.parse(mf); @@ -383,9 +382,7 @@ int CLIENT_STATE::write_state(MIOFILE& f) { // save CPU scheduling state // f.printf( - "%d\n" "%f\n", - cpu_sched_period, cpu_sched_work_done_this_period ); @@ -538,9 +535,7 @@ int CLIENT_STATE::write_state_gui(MIOFILE& f) { // save CPU scheduling state // f.printf( - "%d\n" "%f\n", - cpu_sched_period, cpu_sched_work_done_this_period ); diff --git a/client/prefs.C b/client/prefs.C index ca8a7851f9..cfc4312b91 100644 --- a/client/prefs.C +++ b/client/prefs.C @@ -56,7 +56,7 @@ void GLOBAL_PREFS::init() { //work_buf_max_days = 0.2; work_buf_min_days = 0.1; max_cpus = 1; - cpu_sched_period= 3600; + cpu_sched_period= 3600; //1 hour disk_interval = 60; disk_max_used_gb = 1; disk_max_used_pct = 50; @@ -173,7 +173,7 @@ int GLOBAL_PREFS::parse(FILE* in, char* host_venue, bool& found_venue) { } else if (parse_double(buf, "", disk_interval)) { if (disk_interval<0) disk_interval = 0; continue; - } else if (parse_double(buf, "", cpu_sched_period)) { + } else if (parse_int(buf, "", cpu_sched_period)) { cpu_sched_period= cpu_sched_period * 60; continue; } else if (parse_double(buf, "", disk_max_used_gb)) { diff --git a/client/prefs.h b/client/prefs.h index 7b21ab1596..2d800dce6c 100644 --- a/client/prefs.h +++ b/client/prefs.h @@ -46,7 +46,7 @@ struct GLOBAL_PREFS { //double work_buf_max_days; double work_buf_min_days; int max_cpus; - double cpu_sched_period; + int cpu_sched_period; double disk_interval; double disk_max_used_gb; double disk_max_used_pct;