*** empty log message ***

svn path=/trunk/boinc/; revision=2828
This commit is contained in:
David Anderson 2003-12-24 21:49:35 +00:00
parent 452f767bad
commit 7e2fe724fd
6 changed files with 20 additions and 20 deletions

View File

@ -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){

View File

@ -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();

View File

@ -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)
);

View File

@ -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(

View File

@ -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",

View File

@ -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");
}