. // show the results of ops/analyze_coproc_log.php // DEPRECATED require_once("../inc/util.inc"); require_once("../inc/boinc_db.inc"); check_get_args(array("mode")); function filename($mode) { switch ($mode) { case 'host': return "cuda_hosts.dat"; case 'user': return "cuda_users.dat"; case 'team': return "cuda_teams.dat"; case 'model': return "cuda_models.dat"; case 'day': return "cuda_days.dat"; } } function title($mode) { switch ($mode) { case 'host': return "Top CUDA hosts"; case 'user': return "Top CUDA users"; case 'team': return "Top CUDA teams"; case 'model': return "Top CUDA models"; case 'day': return "Daily CUDA credit"; } } function header_row($mode) { echo ""; switch ($mode) { case 'host': echo "Computer ID
click for details"; break; case 'user': echo "User"; break; case 'team': echo "Team"; break; case 'model': echo "Model"; break; case 'day': echo "Date"; break; } echo "CUDA CreditNumber of CUDA jobs\n"; } function show_row($x, $y, $mode, $i) { $class = $i%2?"row0":"row1"; echo ""; switch ($mode) { case 'host': echo "$x"; break; case 'user': $user = BoincUser::lookup_id($x); echo "$user->name"; break; case 'team': $team = BoincTeam::lookup_id($x); if ($team) { echo "$team->name"; } else { echo "(no team)"; } break; case 'model': echo $x; break; case 'day': echo $x; break; } echo "".format_credit_large($y->credit),"$y->nresults\n"; } $mode = get_str('mode', true); if (!$mode) { page_head("Show GPU info"); echo " "; page_tail(); exit; } $fname = "../ops/".filename($mode); $data = file_get_contents($fname); $array = unserialize($data); page_head(title($mode)); start_table(); header_row($mode); $i = 0; foreach ($array as $x=>$y) { show_row($x, $y, $mode, $i); $i++; } end_table(); page_tail(); ?>