function reset_app($app) { $avs = BoincAppVersion::enum("appid={$app->id}"); foreach ($avs as $av) { $av->update("pfc_n=0, pfc_avg=0, pfc_scale=0, et_n=0, et_avg=0, et_var=0, et_q=0, expavg_credit=0, expavg_time=0"); BoincHostAppVersion::update_aux("pfc_n=0, pfc_avg=0 where app_version_id={$av->id}"); } $app->update("min_avg_pfc = 0"); }
function show_result($r, $w) { $gavid = gavid($r->app_version_id, $w->appid); $hav = BoincHostAppVersion::lookup($r->hostid, $gavid); $av = BoincAppVersion::lookup_id($r->app_version_id); $raw_credit = $r->elapsed_time * $r->flops_estimate * COBB_SCALE; echo "<hr><pre>\nResult ID: <a href=db_action.php?table=result&id={$r->id}>{$r->id}</a>\nHost: <a href=credit.php?hostid={$r->hostid}&avid={$r->app_version_id}>{$r->hostid}</a>\nelapsed_time: {$r->elapsed_time}\nflops_estimate: " . $r->flops_estimate / 1000000000.0 . "\napp_version_id: {$r->app_version_id}\n"; if ($av) { $host_scale = $av->pfc_avg / $hav->pfc_avg; $av_scale = $av->pfc_scale; echo "app version scale: {$av->pfc_scale}\n"; } else { $host_scale = 1; $av_scale = 1; } echo "host scale: {$host_scale}\nCredit:\n Original: {$r->claimed_credit}\n Raw: {$raw_credit}\n Scaled: " . $raw_credit * $host_scale * $av_scale . "\n Granted: {$r->granted_credit}\n"; if ($hav) { echo "Host app version:\n PFC avg: {$hav->pfc_avg}\n"; } }
function show_host_av($host_id, $av_id) { $hav = BoincHostAppVersion::lookup("host_id={$host_id} and {$app_version_id}={$av_id}"); page_head("Host {$host_id} / app_version {$av_id} credit"); echo "Results"; $rs = BoincResult::enum("hostid={$hostid} and app_version_id={$avid} and validate_state=1 order by id desc limit 100"); start_table(); table_header("Workunit", "Elapsed", "Proj FLOPS", "Raw credit", "granted"); $n = 0; $total = 0; foreach ($rs as $r) { $raw_credit = $r->elapsed_time * $r->flops_estimate * COBB_SCALE; $n++; $total += $raw_credit; table_row("<a href=credit.php?wu_id={$r->workunitid}>{$r->workunitid}</a>", $r->elapsed_time, $r->projected_flops, $raw_credit, $r->granted_credit); } start_table(); row2("PFC nsamples", $hav->pfc_n); row2("PFC avg", $hav->pfc_avg); row2("Average raw credit", $total / $n); end_table(); page_tail(); }
return tra("Missing platform"); } $pc = strlen($av->plan_class) ? "({$av->plan_class})" : ""; $v = number_format($av->version_num / 100, 2); return "{$app->user_friendly_name} {$v} {$platform->name} {$pc}"; } } function show_hav($hav) { row1(av_desc($hav->app_version_id)); row2(tra("Number of tasks completed"), $hav->et_n); row2(tra("Max tasks per day"), $hav->max_jobs_per_day); row2(tra("Number of tasks today"), $hav->n_jobs_today); row2(tra("Consecutive valid tasks"), $hav->consecutive_valid); $x = number_format($hav->turnaround_avg / 86400, 2); if ($hav->et_avg) { $gflops = number_format(1.0E-9 / $hav->et_avg, 2); row2(tra("Average processing rate"), $gflops . " GFLOPS"); } row2(tra("Average turnaround time"), "{$x} days"); } $hostid = get_int('hostid'); $havs = BoincHostAppVersion::enum("host_id={$hostid}"); page_head(tra("Application details for host %1", $hostid)); start_table(); foreach ($havs as $hav) { //if (!$hav->pfc_n) continue; show_hav($hav); } end_table(); page_tail();