diff --git a/checkin_notes b/checkin_notes index 021692e9ec..30dd62234f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8568,18 +8568,18 @@ Jeff 18 Dec 2003 parse.h David 19 Dec 2003 - - new system tray icons, for "new message" and "new error message" situations, - contributed by Rom Walton. - NOTE: these are not actually used; - we need to add flags for when they should be displayed + - new system tray icons, for "new message" and "new error message" situations, + contributed by Rom Walton. + NOTE: these are not actually used; + we need to add flags for when they should be displayed - client/win/ - resource.h - resource.rc - wingui_mainwindow.cpp,h - res/ - iconerror.ico (new) - iconinfo.ico (new) + client/win/ + resource.h + resource.rc + wingui_mainwindow.cpp,h + res/ + iconerror.ico (new) + iconinfo.ico (new) Karl 2003-12-19 - undid #ifndef for base64. Renamed to r_base64. @@ -8693,3 +8693,54 @@ David 23 Dec 2003 (various) lib/ filesys.C,h + +David 24 Dec 2003 + - Fixed errors in deciding whether more work was needed, + and if so how much. + This caused a situation where hosts would repeatedly + ask the server for more work + (which, because of recent anti-spam mechanism, would return no work) + The error involved the confusion of two quantities: + 1) work buffer + This is an estimate of the time (measured in days) + until this host will finish all current work. + It reflects the host's "active_frac" and the # of CPUs. + 2) CPU time + This is an estimate of the CPU time a WU will take on this host. + It does not reflect active_frac or # of CPUs + Example error: current_work_buf_days() didn't reflect active_frac and ncpus. + So we underestimated the work buffer, and requested work inappropriately. + + NOTE: the field in a request message + is in units of CPU time, NOT work buffer + + - Fixed errors in estimating the wallclock duration of a WU + (used in feasibility test in scheduler): + Should divide, not multiply, by active_frac; + should not multiply by # cpus + - add a "deprecated" flag to app_version. + If you decide that a particulate app_version has problems, + you can deprecate it. + The scheduler advertises the latest non-deprecated version. + NOTE: this only is effective if core clients have the following: + - Changed the policy assigning an app_version to a WU + Use the version included in the scheduler reply, + and if there is none, use the latest version. + This means that if a project deprecates an app_version, + clients won't use it. + client/ + client_state.h + cs_apps.C + cs_scheduler.C + scheduler_op.C + db/ + schema.sql + boinc_db.C,h + lib/ + filesys.h + result_state.h + py/Boinc/ + database.py + sched/ + handle_request.C + sched_shmem.C diff --git a/client/client_state.h b/client/client_state.h index c2c74857db..9cca6b5877 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -181,7 +181,7 @@ public: private: int nslots; - int latest_version_num(char*); + int choose_version_num(char*, SCHEDULER_REPLY&); bool input_files_available(RESULT*); int app_finished(ACTIVE_TASK&); bool start_apps(); diff --git a/client/cs_apps.C b/client/cs_apps.C index 78b13f6d8d..ef35bd5d22 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -313,11 +313,24 @@ double CLIENT_STATE::get_percent_done(RESULT* result) { return atp ? force_fraction(atp->fraction_done) : 0.0; } -int CLIENT_STATE::latest_version_num(char* app_name) { +// Decide which app version to use for a WU. +// +int CLIENT_STATE::choose_version_num(char* app_name, SCHEDULER_REPLY& sr) { unsigned int i; int best = -1; APP_VERSION* avp; + // First look in the scheduler reply + // + for (i=0; iapp_name)) { + return avp->version_num; + } + } + + // If not there, use the latest one in our state + // for (i=0; iapp_name, app_name)) continue; diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 9318e1f5b5..319664e194 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -52,7 +52,7 @@ const int SECONDS_BEFORE_REPORT_DEADLINE_TO_REPORT = 60*60*6; double CLIENT_STATE::current_work_buf_days() { unsigned int i; RESULT* rp; - double seconds_remaining=0; + double seconds_remaining=0, x; for (i=0; iwup) * (1.0-get_percent_done(rp)); } - return (seconds_remaining / SECONDS_PER_DAY); + x = seconds_remaining / SECONDS_PER_DAY; + x /= host_info.p_ncpus; + x /= time_stats.active_frac; + return x; } -// seconds of work needed to come up to the max buffer level +// seconds of CPU work needed to come up to the max buffer level // double CLIENT_STATE::work_needed_secs() { double x = current_work_buf_days(); if (x > global_prefs.work_buf_max_days) return 0; + // TODO: take into account preference # CPUS - return (global_prefs.work_buf_max_days - x)*SECONDS_PER_DAY - * time_stats.active_frac * host_info.p_ncpus; + double y = (global_prefs.work_buf_max_days - x)*SECONDS_PER_DAY; + y *= time_stats.active_frac; + y *= host_info.p_ncpus; + return y; } // update exponentially-averaged CPU times of all projects @@ -553,7 +559,7 @@ int CLIENT_STATE::handle_scheduler_reply( if (!lookup_workunit(project, sr.workunits[i].name)) { WORKUNIT* wup = new WORKUNIT; *wup = sr.workunits[i]; - wup->version_num = latest_version_num(wup->app_name); + wup->version_num = choose_version_num(wup->app_name, sr); retval = link_workunit(project, wup); if (!retval) { workunits.push_back(wup); diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 254fee45e0..0673ac4e7c 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -76,6 +76,9 @@ int SCHEDULER_OP::init_get_work() { must_get_work = true; project = gstate.next_project(0); if (project) { + msg_printf(project, MSG_INFO, + "Requesting %f seconds of work", ns + ); retval = init_op_project(ns); if (retval) { sprintf(err_msg, "init_op_project failed, error %d\n", retval); diff --git a/lib/filesys.h b/lib/filesys.h index 9836246a12..6b92b275e0 100755 --- a/lib/filesys.h +++ b/lib/filesys.h @@ -17,6 +17,9 @@ // Contributor(s): // +#ifndef _FILESYS_ +#define _FILESYS_ + #include using std::string; #ifdef HAVE_DIRENT_H @@ -68,3 +71,5 @@ public: ~DirScanner(); bool scan(string& name); // return true if file returned }; + +#endif \ No newline at end of file diff --git a/lib/result_state.h b/lib/result_state.h index eb984bcfbb..f6e05cc7e9 100644 --- a/lib/result_state.h +++ b/lib/result_state.h @@ -21,6 +21,8 @@ #define _RESULT_STATE_ // States of a result on a client. +// THESE MUST BE IN NUMERICAL ORDER +// (because of the >= comparison in current_work_buf_days()) // #define RESULT_NEW 0 // New result, files may still need to be downloaded