Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime stats by application version #3362

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
36 changes: 36 additions & 0 deletions db/boinc_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ void DB_APP_VERSION::db_print(char* buf){
"pfc_n=%.15e, "
"pfc_avg=%.15e, "
"pfc_scale=%.15e, "
"runtime_n=%.15e, "
"runtime_avg=%.15e, "
"cputime_n=%.15e, "
"cputime_avg=%.15e, "
"expavg_credit=%.15e, "
"expavg_time=%.15e, "
"beta=%d ",
Expand All @@ -331,6 +335,10 @@ void DB_APP_VERSION::db_print(char* buf){
pfc.n,
pfc.avg,
pfc_scale,
runtime.n,
runtime.avg,
cputime.n,
cputime.avg,
expavg_credit,
expavg_time,
beta
Expand All @@ -353,6 +361,10 @@ void DB_APP_VERSION::db_parse(MYSQL_ROW &r) {
pfc.n = atof(r[i++]);
pfc.avg = atof(r[i++]);
pfc_scale = atof(r[i++]);
runtime.n = atof(r[i++]);
runtime.avg = atof(r[i++]);
cputime.n = atof(r[i++]);
cputime.avg = atof(r[i++]);
expavg_credit = atof(r[i++]);
expavg_time = atof(r[i++]);
beta = atoi(r[i++]);
Expand Down Expand Up @@ -1428,6 +1440,10 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) {
&& et.avg == orig.et.avg
&& et.q == orig.et.q
&& et.var == orig.et.var
&& runtime.n == orig.runtime.n
&& runtime.avg == orig.runtime.avg
&& cputime.n == orig.cputime.n
&& cputime.avg == orig.cputime.avg
&& turnaround.n == orig.turnaround.n
&& turnaround.avg == orig.turnaround.avg
&& turnaround.q == orig.turnaround.q
Expand All @@ -1444,6 +1460,10 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) {
"et_avg=%.15e, "
"et_q=%.15e, "
"et_var=%.15e, "
"runtime_n=%.15e, "
"runtime_avg=%.15e, "
"cputime_n=%.15e, "
"cputime_avg=%.15e, "
"turnaround_n=%.15e, "
"turnaround_avg=%.15e, "
"turnaround_q=%.15e, "
Expand All @@ -1456,6 +1476,10 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) {
et.avg,
et.q,
et.var,
runtime.n,
runtime.avg,
cputime.n,
cputime.avg,
turnaround.n,
turnaround.avg,
turnaround.q,
Expand All @@ -1480,6 +1504,10 @@ void DB_HOST_APP_VERSION::db_print(char* buf) {
"et_avg=%.15e, "
"et_var=%.15e, "
"et_q=%.15e, "
"runtime_n=%.15e, "
"runtime_avg=%.15e, "
"cputime_n=%.15e, "
"cputime_avg=%.15e, "
"max_jobs_per_day=%d, "
"n_jobs_today=%d, "
"turnaround_n=%.15e, "
Expand All @@ -1495,6 +1523,10 @@ void DB_HOST_APP_VERSION::db_print(char* buf) {
et.avg,
et.var,
et.q,
runtime.n,
runtime.avg,
cputime.n,
cputime.avg,
max_jobs_per_day,
n_jobs_today,
turnaround.n,
Expand All @@ -1516,6 +1548,10 @@ void DB_HOST_APP_VERSION::db_parse(MYSQL_ROW& r) {
et.avg = atof(r[i++]);
et.var = atof(r[i++]);
et.q = atof(r[i++]);
runtime.n = atof(r[i++]);
runtime.avg = atof(r[i++]);
cputime.n = atof(r[i++]);
cputime.avg = atof(r[i++]);
max_jobs_per_day = atoi(r[i++]);
n_jobs_today = atoi(r[i++]);
turnaround.n = atof(r[i++]);
Expand Down
4 changes: 4 additions & 0 deletions db/boinc_db_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ struct APP_VERSION {
// PFC scaling factor for this app (or 0 if not enough data)
// The reciprocal of this version's efficiency, averaged over all jobs,
// relative to that of the most efficient version
AVERAGE runtime;
AVERAGE cputime;
double expavg_credit;
double expavg_time;
bool beta;
Expand Down Expand Up @@ -739,6 +741,8 @@ struct HOST_APP_VERSION {
//
// for old clients (which don't report elapsed time)
// we use this for CPU time stats
AVERAGE runtime;
AVERAGE cputime;
int max_jobs_per_day;
// the actual limit is:
// for GPU versions:
Expand Down
8 changes: 8 additions & 0 deletions db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ create table app_version (
pfc_n double not null default 0,
pfc_avg double not null default 0,
pfc_scale double not null default 0,
runtime_n double not null default 0,
runtime_avg double not null default 0,
cputime_n double not null default 0,
cputime_avg double not null default 0,
expavg_credit double not null default 0,
expavg_time double not null default 0,
beta tinyint not null default 0,
Expand Down Expand Up @@ -229,6 +233,10 @@ create table host_app_version (
et_avg double not null,
et_var double not null,
et_q double not null,
runtime_n double not null,
runtime_avg double not null,
cputime_n double not null,
cputime_avg double not null,
max_jobs_per_day integer not null,
n_jobs_today integer not null,
turnaround_n double not null,
Expand Down
19 changes: 18 additions & 1 deletion html/ops/db_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,22 @@ function update_9_12_2018() {
");
}

// Add fields needed for computing runtime stats
function update_10_30_2019() {
do_query("alter table app_version
add runtime_n double not null default 0 after pfc_scale,
add runtime_avg double not null default 0 after runtime_n,
add cputime_n double not null default 0 after runtime_avg,
add cputime_avg double not null default 0 after cputime_n
");
do_query("alter table host_app_version
add runtime_n double not null default 0 after et_q,
add runtime_avg double not null default 0 after runtime_n,
add cputime_n double not null default 0 after runtime_avg,
add cputime_avg double not null default 0 after cputime_n
");
}

// Updates are done automatically if you use "upgrade".
//
// If you need to do updates manually,
Expand Down Expand Up @@ -1289,7 +1305,8 @@ function update_9_12_2018() {
array(27025, "update_4_19_2018"),
array(27026, "update_5_9_2018"),
array(27027, "update_8_23_2018"),
array(27028, "update_9_12_2018")
array(27028, "update_9_12_2018"),
array(27029, "update_10_30_2019")
);

?>
19 changes: 17 additions & 2 deletions html/user/apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@
} else {
$b = $app->beta?" (beta test)":"";
echo "
<tr><th class=\"bg-primary\" colspan=4>$app->user_friendly_name$b</th></tr>
<tr><th class=\"bg-primary\" colspan=6>$app->user_friendly_name$b</th></tr>
<tr>
<th>".tra("Platform")."</th>
<th>".tra("Version")."</th>
<th>".tra("Created")."</th>
<th>".tra("Average computing")."</th>
<th>".tra("Avg Run Time")."</th>
<th>".tra("Avg CPU Time")."</th>
<th style=text-align:right>".tra("Average computing")."</th>
</tr>
";
}
Expand Down Expand Up @@ -84,10 +86,23 @@
$total_gf += $gf;
$gf = number_format($gf, 0);
$b = $av->beta?" (beta test)":"";
$runtime_avg="NA";
$cputime_avg="NA";
if ($av->runtime_avg>0) {
$runtime_avg = number_format($av->runtime_avg/3600, 2);
$runtime_avg .= " hrs/task";
}
if ($av->cputime_avg>0) {
$cputime_avg = number_format($av->cputime_avg/3600, 2);
$cputime_avg .= " hrs/task";
}

echo "<tr>
<td>$platform->user_friendly_name</td>
<td>$version_num_f$b</td>
<td>$create_time_f</td>
<td>$runtime_avg</td>
<td>$cputime_avg</td>
<td align=right>$gf GigaFLOPS</td>
</tr>
";
Expand Down
40 changes: 32 additions & 8 deletions sched/credit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,23 @@ int get_pfc(
return 0;
}

// get app version
//
avp = av_lookup(r.app_version_id, app_versions);

// Update runtime and cputime stats.
// this is here because this is where it used to be. It should probably be
// elsewhere since it's really not pfc related.
if (avp && !r.runtime_outlier) {
if (r.elapsed_time > 0) {
avp->runtime.update(r.elapsed_time,AV_AVG_THRESH,AV_AVG_WEIGHT,AV_AVG_LIMIT);
hav.runtime.update(r.elapsed_time,HAV_AVG_THRESH,HAV_AVG_WEIGHT,HAV_AVG_LIMIT);
}
if (r.cpu_time > 0) {
avp->cputime.update(r.cpu_time,HAV_AVG_THRESH,HAV_AVG_WEIGHT,HAV_AVG_LIMIT);
hav.cputime.update(r.cpu_time,HAV_AVG_THRESH,HAV_AVG_WEIGHT,HAV_AVG_LIMIT);
}
}
// old clients report CPU time but not elapsed time.
// Use HOST_APP_VERSION.et to track statistics of CPU time.
//
Expand All @@ -575,16 +592,15 @@ int get_pfc(
r.id
);
}

if (!r.runtime_outlier) {
hav.et.update_var(
r.cpu_time/wu.rsc_fpops_est,
HAV_AVG_THRESH, HAV_AVG_WEIGHT, HAV_AVG_LIMIT
);
// if ((r.elapsed_time > 0) && (r.cpu_time > 0)) {
// hav.rt.update(r.elapsed_time,HAV_AVG_THRESH,HAV_AVG_WEIGHT,HAV_AVG_LIMIT);
// hav.cpu.update(r.cpu_time,HAV_AVG_THRESH,HAV_AVG_WEIGHT,HAV_AVG_LIMIT);
// }
}


pfc = wu_estimated_pfc(wu, app);
if (config.debug_credit) {
log_messages.printf(MSG_NORMAL,
Expand Down Expand Up @@ -650,9 +666,6 @@ int get_pfc(
);
}

// get app version
//
avp = av_lookup(r.app_version_id, app_versions);

// Sanity check
// If an app version scale exists, use it. Otherwise assume 1.
Expand Down Expand Up @@ -1076,9 +1089,20 @@ int write_modified_app_versions(vector<DB_APP_VERSION_VAL>& app_versions) {
}
char query[512], clause[512];
sprintf(query,
"pfc_n=%.15e, pfc_avg=%.15e, expavg_credit=%.15e, expavg_time=%f",
"pfc_n=%.15e, "
"pfc_avg=%.15e, "
"runtime_n=%.15e, "
"runtime_avg=%.15e, "
"cputime_n=%.15e, "
"cputime_avg=%.15e, "
"expavg_credit=%.15e, "
"expavg_time=%f ",
av.pfc.n,
av.pfc.avg,
av.runtime.n,
av.runtime.avg,
av.cputime.n,
av.cputime.avg,
av.expavg_credit,
av.expavg_time
);
Expand Down