From d36ebb68c3c76c728df4ebc84e4c0d713e249416 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 30 Aug 2011 21:39:05 +0000 Subject: [PATCH] - web: sort GPUs by average elapsed time svn path=/trunk/boinc/; revision=24085 --- checkin_notes | 74 +++++++++++++++++++++++------------------- html/user/gpu_list.php | 41 ++++++++++++++--------- 2 files changed, 65 insertions(+), 50 deletions(-) diff --git a/checkin_notes b/checkin_notes index e675e9c5d9..57a8b07913 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4849,12 +4849,12 @@ David 10 Aug 2011 various David 10 Aug 2011 - - fix compile warnings; msg tweak + - fix compile warnings; msg tweak - client/ - cpu_sched.cpp - lib/ - parse.cpp + client/ + cpu_sched.cpp + lib/ + parse.cpp David 10 Aug 2011 - client: use new XML parser pretty much everywhere @@ -4889,11 +4889,11 @@ Charlie 11 Aug 2011 project.pbxproj David 11 Aug 2011 - - client: more XML parsing stuff + - client: more XML parsing stuff - client/ - app.cpp - net_stats.cpp + client/ + app.cpp + net_stats.cpp David 11 Aug 2011 - scheduler: update XML parsing @@ -4903,10 +4903,10 @@ David 11 Aug 2011 sched_types.cpp David 11 Aug 2011 - - client: XML tweak + - client: XML tweak - client/ - client_types.cpp + client/ + client_types.cpp Charlie 12 Aug 2011 - Mac installer: Bug fixes for OS 10.7 Lion. @@ -5183,28 +5183,28 @@ David 26 Aug 2011 client_types.cpp David 26 Aug 2011 - - client: fix bug that caused project attach to fail - - clientgui: Rom, we should do error-checking of most GUI RPCs; - look for REPORT ERROR in ProjectProcessingPage.cpp + - client: fix bug that caused project attach to fail + - clientgui: Rom, we should do error-checking of most GUI RPCs; + look for REPORT ERROR in ProjectProcessingPage.cpp - client/ - acct_setup.cpp - coproc_detect.cpp - clientgui/ - ProjectProcessingPage.cpp + client/ + acct_setup.cpp + coproc_detect.cpp + clientgui/ + ProjectProcessingPage.cpp David 26 Aug 2011 - - web: fix glitch in forum next/prev links + - web: fix glitch in forum next/prev links - html/inc/ - host.inc - forum.inc - + html/inc/ + host.inc + forum.inc + David 26 Aug 2011 - - web: more tra() stuff + - web: more tra() stuff - html/user/ - forum_thread.php + html/user/ + forum_thread.php David 27 Aug 2011 - web: add a magic header string that supposedly will make @@ -5242,10 +5242,10 @@ David 28 Aug 2011 edit_forum_preferences_action.php David 29 Aug 2011 - - web: fix typo in profile credit/edit + - web: fix typo in profile credit/edit - html/user/ - create_profile.php + html/user/ + create_profile.php David 29 Aug 2011 - web: fix bug in "report post" function @@ -5272,10 +5272,10 @@ David 29 Aug 2011 vboxwrapper.cpp David 29 Aug 2011 - - web: add page showing top GPU models + - web: add page showing top GPU models - html/user/ - gpu_list.php + html/user/ + gpu_list.php Charlie 30 Aug 2011 - Mac: Copy BOINC libraries built with XCode 4.1 to locations @@ -5307,3 +5307,9 @@ David 30 Aug 2011 sched_send.cpp client/ cs_prefs.cpp + +David 30 Aug 2011 + - web: sort GPUs by average elapsed time + + html/user/ + gpu_list.php diff --git a/html/user/gpu_list.php b/html/user/gpu_list.php index 83b24262c9..923ae6fe09 100644 --- a/html/user/gpu_list.php +++ b/html/user/gpu_list.php @@ -15,11 +15,15 @@ function get_gpu_model($x, $vendor) { return null; } -function add_model($model, &$models) { +function add_model($model, $r, &$models) { if (array_key_exists($model, $models)) { - $models[$model]++; + $models[$model]->count++; + $models[$model]->time += $r->elapsed_time; } else { - $models[$model] = 1; + $x = null; + $x->count = 1; + $x->time = $r->elapsed_time; + $models[$model] = $x; } } @@ -39,7 +43,7 @@ function get_gpu_list($vendor) { $av_ids .= "0"; $t = time() - 30*86400; - $results = BoincResult::enum("app_version_id in ($av_ids) and create_time > $t limit 1000"); + $results = BoincResult::enum("app_version_id in ($av_ids) and create_time > $t and elapsed_time>100 limit 5000"); $total = array(); $win = array(); $linux = array(); @@ -50,15 +54,15 @@ function get_gpu_list($vendor) { $v = $vendor=="cuda"?"CUDA":"ATI"; $model = get_gpu_model($h->serialnum, $v); if (!$model) continue; - add_model($model, $total); + add_model($model, $r, $total); if (strstr($h->os_name, "Windows")) { - add_model($model, $win); + add_model($model, $r, $win); } if (strstr($h->os_name, "Linux")) { - add_model($model, $linux); + add_model($model, $r, $linux); } if (strstr($h->os_name, "Darwin")) { - add_model($model, $mac); + add_model($model, $r, $mac); } } @@ -77,21 +81,26 @@ function get_gpu_lists() { return $x; } +function gpucmp($x1, $x2) { + $y1 = $x1->time/$x1->count; + $y2 = $x2->time/$x2->count; + return $y1 > $y2; +} + function show_list($models, $name) { echo "

$name

\n"; if (!count($models)) { echo tra("No GPU tasks reported")."\n"; return; } - arsort($models); + uasort($models, 'gpucmp'); echo "
    \n"; - $first = true; - foreach ($models as $model=>$n) { - if ($first) { - $max = $n; - $first = false; - } - if ($n < $max/10) break; + $max_count = 0; + foreach ($models as $model=>$x) { + if ($x->count > $max_count) $max_count = $x->count; + } + foreach ($models as $model=>$x) { + if ($x->count < $max_count/10) continue; echo "
  1. $model\n"; } echo "
\n";