From 9f27824fbac4e97bcace3b9bbf7d26ddd693198b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 13 Jul 2011 21:50:48 +0000 Subject: [PATCH] - admin web: improve the FLOPs estimation tool so that it works for GPU versions too svn path=/trunk/boinc/; revision=23840 --- checkin_notes | 11 +++++ html/inc/util_ops.inc | 19 ++++++++ html/ops/app_details.php | 23 +++------- html/ops/job_times.php | 94 ++++++++++++++++++++++------------------ 4 files changed, 86 insertions(+), 61 deletions(-) diff --git a/checkin_notes b/checkin_notes index 951299f21d..58673fad46 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4102,3 +4102,14 @@ David 13 July 2011 clientgui/ DltItemProperties.cpp + +David 13 July 2011 + - admin web: improve the FLOPs estimation tool so that + it works for GPU versions too + + html/ + ops/ + job_times.php + app_details.php + inc/ + util_ops.php diff --git a/html/inc/util_ops.inc b/html/inc/util_ops.inc index 81f23302f9..6a2ac65062 100644 --- a/html/inc/util_ops.inc +++ b/html/inc/util_ops.inc @@ -212,6 +212,25 @@ function admin_error_page($msg) { exit; } +// given a list of app versions, +// return a list of the current, non-deprecated ones +// +function current_versions($avs) { + foreach($avs as $av) { + foreach ($avs as $av2) { + if ($av->id == $av2->id) continue; + if ($av->platformid == $av2->platformid && $av->plan_class == $av2->plan_class && $av->version_num > $av2->version_num) { + $av2->deprecated = 1; + } + } + } + $x = array(); + foreach($avs as $av) { + if (!$av->deprecated) $x[] = $av; + } + return $x; +} + if (isset($cli_only)) { if (array_key_exists("SERVER_PORT", $_SERVER)) { die("This script is intended to be run from the command line, diff --git a/html/ops/app_details.php b/html/ops/app_details.php index 1593b27011..13fbc4a480 100644 --- a/html/ops/app_details.php +++ b/html/ops/app_details.php @@ -22,22 +22,6 @@ require_once('../inc/util_ops.inc'); $appid = get_int("appid"); -function remove_old($avs) { - foreach($avs as $av) { - foreach ($avs as $av2) { - if ($av->id == $av2->id) continue; - if ($av->platformid == $av2->platformid && $av->plan_class == $av2->plan_class && $av->version_num > $av2->version_num) { - $av2->deprecated = 1; - } - } - } - $x = array(); - foreach($avs as $av) { - if (!$av->deprecated) $x[] = $av; - } - return $x; -} - $app = BoincApp::lookup_id($appid); if (!$app) admin_error_page("no such app"); admin_page_head("Details for $app->name ($app->user_friendly_name)"); @@ -50,12 +34,15 @@ echo " If values are far outside this range, you may have bad FLOPs estimates. In this case, you may want to - reset credit statistics for this application. +
    +
  1. Get a better FLOPs estimate +
  2. reset credit statistics for this application. +
"; end_table(); echo "

App versions

\n"; $avs = BoincAppVersion::enum("appid=$appid"); -$avs = remove_old($avs); +$avs = current_versions($avs); foreach ($avs as $av) { $platform = BoincPlatform::lookup_id($av->platformid); start_table(); diff --git a/html/ops/job_times.php b/html/ops/job_times.php index 6b8477190e..083cb42212 100644 --- a/html/ops/job_times.php +++ b/html/ops/job_times.php @@ -40,7 +40,7 @@ function handle_result($result) { global $count; global $varsum; - $flops = $result->cpu_time * $result->p_fpops; + $flops = $result->elapsed_time * $result->flops_estimate; //printf("%e
\n", $flops); $n = (int) ($flops/$quantum); if (!array_key_exists($n, $hist)) { @@ -60,7 +60,7 @@ function show_stats() { global $sum; $stdev = sqrt($varsum/($count-1)); - printf("mean: %e
stdev: %e", $mean, $stdev); + printf("mean: %e
stdev: %e
samples: %d", $mean, $stdev, $count); } function show_stats_hist() { //deprecated @@ -131,37 +131,30 @@ function show_as_table() { echo ""; } -function show_apps() { - echo "

Apps:"; - $r = mysql_query("select * from app"); - while ($p = mysql_fetch_object($r)) { - echo "
$p->id $p->user_friendly_name\n"; - } -} - -function show_platforms() { - echo "

Platforms: -
0 All -
1 Windows only -
2 Darwin only -
3 Linux only +function version_select($appid) { + $x = "\n"; + return $x; } -function analyze($appid, $platformid, $nresults) { +function analyze($appid, $app_version_id, $nresults) { global $hist; - $clause = ""; - switch ($platformid) { - case 0: $clause = ""; break; - case 1: $clause = " and locate('Windows', os_name)"; break; - case 2: $clause = " and locate('Darwin', os_name)"; break; - case 3: $clause = " and locate('Linux', os_name)"; break; - } + $clause = $app_version_id?" and app_version_id = $app_version_id ":""; - $query = "select server_state, outcome, cpu_time, p_fpops from result, host where server_state=5 and appid=$appid and host.id = result.hostid and outcome=1 and validate_state=1 $clause limit $nresults"; - echo $query; + $query = "select id, server_state, outcome, elapsed_time, flops_estimate from result where server_state=5 and appid=$appid and outcome=1 and validate_state=1 $clause order by id desc limit $nresults"; $r = mysql_query($query); $n = 0; @@ -183,39 +176,54 @@ function analyze($appid, $platformid, $nresults) { show_as_xml(); } -function show_form() { +function show_app_select() { + admin_page_head("Show FLOPS distribution"); + echo "Select an application: +

+ "; + $apps = BoincApp::enum("deprecated=0"); + + foreach($apps as $app) { + echo "
id> + $app->user_friendly_name + "; + } + echo "

"; + admin_page_tail(); +} + +function show_form($appid) { admin_page_head("Show FLOPS distribution"); echo " + "; start_table(); - row2("App ID:", ""); - row2("platform ID (0 for all):", ""); - row2("FLOP quantum:
(determines graph resolution; if you see only one bar, use a smaller value)", ""); + row2("App version:", version_select($appid)); + row2("Resolution:
(if you see only one bar, use a smaller value)", ""); row2("Sample size (# of jobs):", ""); row2("", ""); end_table(); echo "
"; - show_platforms(); - show_apps(); admin_page_tail(); } if (get_str('submit', true)=='OK') { set_time_limit(0); - $appid = $_GET['appid']; - if (!$appid) { - echo "Must supply an appid"; - exit; - } - $platformid = $_GET['platformid']; - $quantum = $_GET['quantum']; - $nresults = $_GET['nresults']; - analyze($appid, $platformid, $nresults); + $appid = get_int('appid'); + $app_version_id = get_int('app_version_id'); + $quantum = (double)(get_str('quantum')); + $nresults = get_int('nresults'); + analyze($appid, $app_version_id, $nresults); } else { - show_form(); + $appid = get_int('appid', true); + if ($appid) { + show_form($appid); + } else { + show_app_select(); + } } ?>