diff --git a/api/boinc_api.cpp b/api/boinc_api.cpp index 1b15a7ca00..77602d988f 100644 --- a/api/boinc_api.cpp +++ b/api/boinc_api.cpp @@ -127,7 +127,6 @@ APP_CLIENT_SHM* app_client_shm = 0; static volatile int time_until_checkpoint; // time until enable checkpoint static volatile double fraction_done; -static volatile bool fd_exact = false; static volatile double last_checkpoint_cpu_time; static volatile bool ready_to_checkpoint = false; static volatile int in_critical_section = 0; @@ -384,9 +383,6 @@ static bool update_app_progress(double cpu_t, double cp_cpu_t) { sprintf(buf, "%e\n", fdone); strlcat(msg_buf, buf, sizeof(msg_buf)); } - if (fd_exact) { - strlcat(msg_buf, "\n", sizeof(msg_buf)); - } if (bytes_sent) { sprintf(buf, "%f\n", bytes_sent); strlcat(msg_buf, buf, sizeof(msg_buf)); @@ -1435,12 +1431,6 @@ int boinc_fraction_done(double x) { return 0; } -int boinc_fraction_done_exact(double x) { - fraction_done = x; - fd_exact = true; - return 0; -} - int boinc_receive_trickle_down(char* buf, int len) { std::string filename; char path[MAXPATHLEN]; diff --git a/api/boinc_api.h b/api/boinc_api.h index 870ab7de47..1ffbf33fd5 100644 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -92,7 +92,6 @@ extern int boinc_send_trickle_up(char* variety, char* text); extern int boinc_set_min_checkpoint_period(int); extern int boinc_checkpoint_completed(void); extern int boinc_fraction_done(double); -extern int boinc_fraction_done_exact(double); extern int boinc_suspend_other_activities(void); extern int boinc_resume_other_activities(void); extern int boinc_report_app_status( diff --git a/client/app.h b/client/app.h index a1bcdde1e5..8221f8c7fe 100644 --- a/client/app.h +++ b/client/app.h @@ -108,8 +108,6 @@ struct ACTIVE_TASK { // will be zero if the app doesn't use this call double fraction_done_elapsed_time; // elapsed time when fraction done was last reported - bool fraction_done_exact; - // true if app thinks fraction done is accurate int scheduler_state; int next_scheduler_state; // temp int signal; diff --git a/client/app_control.cpp b/client/app_control.cpp index 5af52fca8c..964c4a6f99 100644 --- a/client/app_control.cpp +++ b/client/app_control.cpp @@ -1349,7 +1349,6 @@ bool ACTIVE_TASK::get_app_status_msg() { bytes_received_episode = dtemp; } parse_int(msg_buf, "", want_network); - parse_bool(msg_buf, "fd_exact", fraction_done_exact); if (parse_int(msg_buf, "", other_pid)) { // for now, we handle only one of these other_pids.clear(); diff --git a/client/client_types.cpp b/client/client_types.cpp index 6bf31a21d0..a641e3d550 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -134,6 +134,7 @@ int APP::parse(XML_PARSER& xp) { if (xp.parse_str("name", name, sizeof(name))) continue; if (xp.parse_str("user_friendly_name", user_friendly_name, sizeof(user_friendly_name))) continue; if (xp.parse_bool("non_cpu_intensive", non_cpu_intensive)) continue; + if (xp.parse_bool("fraction_done_exact", fraction_done_exact)) continue; #ifdef SIM if (xp.parse_double("latency_bound", latency_bound)) continue; if (xp.parse_double("fpops_est", fpops_est)) continue; diff --git a/client/client_types.h b/client/client_types.h index 296f0b7ac1..325dd1034c 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -244,6 +244,7 @@ struct APP { char name[256]; char user_friendly_name[256]; bool non_cpu_intensive; + bool fraction_done_exact; PROJECT* project; int max_concurrent; // Limit on # of concurrent jobs of this app; 0 if none diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index 7727377bea..b501ba6ad6 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -798,7 +798,11 @@ int CLIENT_STATE::handle_scheduler_reply( for (i=0; iuser_friendly_name, sr.apps[i].user_friendly_name); + app->non_cpu_intensive = sr.apps[i].non_cpu_intensive; + app->fraction_done_exact = sr.apps[i].fraction_done_exact; } else { app = new APP; *app = sr.apps[i]; @@ -879,9 +883,7 @@ int CLIENT_STATE::handle_scheduler_reply( app, avpp.platform, avpp.version_num, avpp.plan_class ); if (avp) { - // update performance-related info; - // generally this shouldn't change, - // but if it does it's better to use the new stuff + // update app version attributes in case they changed on server // avp->avg_ncpus = avpp.avg_ncpus; avp->max_ncpus = avpp.max_ncpus; diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 3e01020676..30480c52e4 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -1058,7 +1058,7 @@ double ACTIVE_TASK::est_dur() { // if app says fraction done is accurate, just use it // - if (fraction_done_exact) return frac_est; + if (result->app->fraction_done_exact) return frac_est; // weighting of dynamic estimate is the fraction done // i.e. when fraction done is 0.5, weighting is 50/50 diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp index 12bf7c1943..3af5871d6c 100644 --- a/db/boinc_db.cpp +++ b/db/boinc_db.cpp @@ -214,7 +214,8 @@ void DB_APP::db_print(char* buf){ "homogeneous_app_version=%d, " "non_cpu_intensive=%d, " "locality_scheduling=%d, " - "n_size_classes=%d ", + "n_size_classes=%d, " + "fraction_done_exact=%d ", create_time, name, min_version, @@ -229,7 +230,8 @@ void DB_APP::db_print(char* buf){ homogeneous_app_version?1:0, non_cpu_intensive?1:0, locality_scheduling, - n_size_classes + n_size_classes, + fraction_done_exact?1:0 ); } @@ -252,6 +254,7 @@ void DB_APP::db_parse(MYSQL_ROW &r) { non_cpu_intensive = (atoi(r[i++]) != 0); locality_scheduling = atoi(r[i++]); n_size_classes = atoi(r[i++]); + fraction_done_exact = (atoi(r[i++]) != 0); } void DB_APP_VERSION::db_print(char* buf){ diff --git a/db/boinc_db_types.h b/db/boinc_db_types.h index 2d2b43b6b7..5778ac4847 100644 --- a/db/boinc_db_types.h +++ b/db/boinc_db_types.h @@ -82,6 +82,8 @@ struct APP { // type of locality scheduling used by this app (see above) int n_size_classes; // for multi-size apps, number of size classes + bool fraction_done_exact; + // fraction done reported by app is accurate int write(FILE*); void clear(); diff --git a/db/schema.sql b/db/schema.sql index fe6739803b..b4af60126e 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -55,6 +55,7 @@ create table app ( non_cpu_intensive tinyint not null default 0, locality_scheduling integer not null default 0, n_size_classes smallint not null default 0, + fraction_done_exact tinyint not null default 0, primary key (id) ) engine=InnoDB; diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 22ad22019a..a4719f0b05 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -925,6 +925,14 @@ function update_4_2_2014() { ); } +function update_5_3_2014() { + do_query( + "alter table app + add fraction_done_exact tinyint not null + " + ); +} + // Updates are done automatically if you use "upgrade". // // If you need to do updates manually, @@ -965,6 +973,7 @@ $db_updates = array ( array(27006, "update_1_13_2014"), array(27007, "update_3_6_2014"), array(27008, "update_4_2_2014"), + array(27009, "update_5_3_2014"), ); ?> diff --git a/html/ops/manage_apps.php b/html/ops/manage_apps.php index 8bdbc1de4b..1cbeb6f14d 100644 --- a/html/ops/manage_apps.php +++ b/html/ops/manage_apps.php @@ -43,6 +43,9 @@ function do_updates() { $n = post_str("beta", true)?1:0; $app->update("beta=$n"); + $n = post_str("fraction_done_exact", true)?1:0; + $app->update("fraction_done_exact=$n"); + echo "Application $id updated.

You must restart the project for this to take effect. @@ -82,11 +85,12 @@ function show_form() { "Created", "weight
details", "shmem items", - "homogeneous redundancy type
details", + "HR type
details", "homogeneous app version?
details", "deprecated?", "Non-CPU-intensive?", "Beta?", + "Exact fraction done?", "" ); @@ -153,6 +157,12 @@ function show_form() { "; + $v = ''; + if ($app->fraction_done_exact) $v = ' CHECKED '; + echo " + + "; + echo ""; echo ""; } diff --git a/sched/sched_types.cpp b/sched/sched_types.cpp index 5c4779f89a..decdc949a2 100644 --- a/sched/sched_types.cpp +++ b/sched/sched_types.cpp @@ -1026,9 +1026,11 @@ int APP::write(FILE* fout) { " %s\n" " %s\n" " %d\n" + " %d\n" "\n", name, user_friendly_name, - non_cpu_intensive?1:0 + non_cpu_intensive?1:0, + fraction_done_exact?1:0 ); return 0; }