diff --git a/db/boinc_db.C b/db/boinc_db.C index a1f4f9fdc6..9dc0b03ff4 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -17,6 +17,9 @@ // Contributor(s): // // $Log$ +// Revision 1.30 2003/12/24 21:49:34 boincadm +// *** empty log message *** +// // Revision 1.29 2003/12/23 19:21:51 boincadm // *** empty log message *** // @@ -179,15 +182,10 @@ void DB_APP_VERSION::db_print(char* buf){ sprintf(buf, "id=%d, create_time=%d, appid=%d, version_num=%d, platformid=%d, " "xml_doc='%s', " - "min_core_version=%d, max_core_version=%d", - id, - create_time, - appid, - version_num, - platformid, + "min_core_version=%d, max_core_version=%d, deprecated=%d", + id, create_time, appid, version_num, platformid, xml_doc, - min_core_version, - max_core_version + min_core_version, max_core_version, deprecated ); } @@ -202,6 +200,7 @@ void DB_APP_VERSION::db_parse(MYSQL_ROW &r) { strcpy2(xml_doc, r[i++]); min_core_version = atoi(r[i++]); max_core_version = atoi(r[i++]); + deprecated = atoi(r[i++]); } void DB_USER::db_print(char* buf){ diff --git a/db/boinc_db.h b/db/boinc_db.h index 3c491e6e6d..a3633daaf5 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -124,6 +124,7 @@ struct APP_VERSION { // int min_core_version; // min core version this app will run with int max_core_version; // if <>0, max core version this will run with + bool deprecated; int write(FILE*, APP&); void clear(); diff --git a/db/schema.sql b/db/schema.sql index b41ff9c711..fdba9728b7 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -57,6 +57,7 @@ create table app_version ( xml_doc blob, min_core_version integer not null, max_core_version integer not null, + deprecated integer not null, primary key (id) ); diff --git a/py/Boinc/database.py b/py/Boinc/database.py index 3ab8f34f33..a6b455b543 100644 --- a/py/Boinc/database.py +++ b/py/Boinc/database.py @@ -74,7 +74,8 @@ class AppVersion(DatabaseObject): 'platformid', 'xml_doc', 'min_core_version', - 'max_core_version' ]) + 'max_core_version', + 'deprecated' ]) class User(DatabaseObject): _table = DatabaseTable( diff --git a/sched/handle_request.C b/sched/handle_request.C index 1e6b9e1340..1d92e361ee 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -111,31 +111,28 @@ double max_allowable_disk(USER& user, SCHEDULER_REQUEST& req) { return x; } -// if a host has active_frac < 0.5, assume 0.5 so we don't deprive it of work. +// if a host has active_frac < 0.1, assume 0.1 so we don't deprive it of work. // -const double HOST_ACTIVE_FRAC_MIN = 0.5; +const double HOST_ACTIVE_FRAC_MIN = 0.1; // estimate the number of seconds that a workunit requires running 100% on a // single CPU of this host. // // TODO: improve this. take memory bandwidth into account -// Also take "on fraction" etc. into account // -inline double estimate_duration(WORKUNIT& wu, HOST& host) { +inline double estimate_cpu_duration(WORKUNIT& wu, HOST& host) { if (host.p_fpops <= 0) host.p_fpops = 1e9; if (wu.rsc_fpops_est <= 0) wu.rsc_fpops_est = 1e12; return wu.rsc_fpops_est/host.p_fpops; } -// estimate the amount of real time for this WU based on active_frac and #cpus. +// estimate the amount of real time for this WU based on active_frac // inline double estimate_wallclock_duration(WORKUNIT& wu, HOST& host) { - if (host.p_ncpus < 1) host.p_ncpus = 1; + return estimate_cpu_duration(wu, host) + / max(HOST_ACTIVE_FRAC_MIN, host.active_frac) + ; - return double( - estimate_duration(wu, host) - * max(HOST_ACTIVE_FRAC_MIN, host.active_frac) - * host.p_ncpus); } // return true if the WU can be executed on the host @@ -795,7 +792,7 @@ static void scan_work_array( result.report_deadline = result.sent_time + wu.delay_bound; result.update(); - wu_seconds_filled = estimate_duration(wu, reply.host); + wu_seconds_filled = estimate_cpu_duration(wu, reply.host); log_messages.printf( SchedMessages::NORMAL, "[HOST#%d] Sending [RESULT#%d %s] (fills %d seconds)\n", diff --git a/sched/sched_shmem.C b/sched/sched_shmem.C index 169863d81b..a6c1d36f24 100644 --- a/sched/sched_shmem.C +++ b/sched/sched_shmem.C @@ -91,6 +91,7 @@ int SCHED_SHMEM::scan_tables() { n = 0; while (!app_version.enumerate()) { if (app_version.version_num/100 != MAJOR_VERSION) continue; + if (app_version.deprecated) continue; app_versions[n++] = app_version; if (n == MAX_APP_VERSIONS) overflow("app_versions"); }