16
16
// You should have received a copy of the GNU Lesser General Public License
17
17
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
19
error_reporting(E_ALL);
20
ini_set('display_errors', true);
21
ini_set('display_startup_errors', true);
19
23
class BoincAssignment {
20
24
static function enum($where_clause) {
21
25
$db = BoincDb::get();
888
function days_string($x) {
889
return number_format($x/86400, 2)." days";
892
function resource_name($x) {
894
case 2: return "CPU";
895
case 3: return "NVIDIA";
896
case 4: return "ATI";
898
return "Unknown resource: $x";
900
function app_version_string($avid) {
901
if ($avid > 1000000) {
902
$appid = (int)($avid/1000000);
903
$platform_name = "Anonymous platform";
904
$version_info = resource_name($avid%1000000);
906
$av = BoincAppVersion::lookup("id=$avid");
907
if (!$av) return "Missing app version $avid";
909
$platform = BoincPlatform::lookup_id($av->platformid);
910
if (!$platform) return "Missing platform $av->platformid";
911
$platform_name = $platform->user_friendly_name;
912
$version_info = "$av->version_num $av->plan_class
913
<br>PFC: $av->pfc_avg ($av->pfc_n)
914
<br>scale: $av->pfc_scale
917
$app = BoincApp::lookup_id($appid);
918
if (!$app) return "Missing app $appid";
919
return "$app->user_friendly_name
925
function show_host_app_versions($hostid) {
927
table_header("app version", "PFC", "Elapsed", "Turnaround");
928
$havs = BoincHostAppVersion::enum("host_id=$hostid");
929
foreach ($havs as $hav) {
931
app_version_string($hav->app_version_id),
932
"$hav->pfc_avg ($hav->pfc_n)",
933
"$hav->et_avg ($hav->et_n)",
934
days_string($hav->turnaround_avg)." ($hav->turnaround_n)"
884
940
function show_host($host) {
893
949
row("Venue", $host->venue);
950
row("Info", $host->serialnum);
894
951
row("Total credit", $host->total_credit);
895
952
row("Average credit", $host->expavg_credit);
896
953
row("Average update time", time_str($host->expavg_time));
902
959
row("Local Standard Time", "UTC $x hours");
903
960
row("Number of CPUs", $host->p_ncpus);
904
961
row("CPU", "$host->p_vendor $host->p_model");
905
row("FP ops/sec", $host->p_fpops);
906
row("Int ops/sec", $host->p_iops);
962
row("GFLOPS", number_format($host->p_fpops/1e9, 2));
963
row("GIOPS", number_format($host->p_iops/1e9, 2));
907
964
row("memory bandwidth", $host->p_membw);
908
965
row("Operating System", "$host->os_name $host->os_version");
909
966
$x = $host->m_nbytes/(1024*1024);
923
980
row("Free Disk Space", "$y GB");
924
981
row("Avg network bandwidth (upstream)", "$host->n_bwup bytes/sec");
925
982
row("Avg network bandwidth (downstream)", "$host->n_bwdown bytes/sec");
926
$x = $host->avg_turnaround/86400;
927
row("Average turnaround", round($x, 2)." days");
983
row("Average turnaround", days_string($host->avg_turnaround));
928
984
row("Number of RPCs", $host->rpc_seqno);
929
985
row("Last RPC", time_str($host->rpc_time));
930
986
row("% of time client on", 100*$host->on_frac." %");
933
989
row("# of results today", $host->nresults_today);
934
990
row("Results", "<a href=\"db_action.php?table=result&detail=low&hostid=$host->id&sort_by=sent_time\">click here</a>");
992
show_host_app_versions($host->id);
939
995
function wu_error_mask_str($s) {
1185
1241
row("Host ID", "<a href=\"db_action.php?table=host&id=$result->hostid\">" . host_name_by_id($result->hostid) . "</a> [$result->hostid]");
1186
1242
row("User ID", "<a href=\"db_action.php?table=user&id=$result->userid\">" . user_name_by_id($result->userid) . "</a> [$result->userid]");
1187
1243
row("CPU time", $result->cpu_time);
1188
row("XML doc in", "<pre>".htmlspecialchars($result->xml_doc_in)."</pre>");
1189
row("XML doc out", "<pre>".htmlspecialchars($result->xml_doc_out)."</pre>");
1190
row("stderr out", "<pre>".htmlspecialchars($result->stderr_out)."</pre>");
1244
row("Elapsed time", $result->elapsed_time);
1191
1245
if($error=stderr_error_string($result->stderr_out)) {
1192
1246
row("error in stderr out", $error);
1198
1252
row("Granted credit", $result->granted_credit);
1199
1253
row("Application", "<a href=\"db_action.php?table=app&id=$result->appid\">".app_name_by_id($result->appid)."</a>");
1200
1254
row("App version", "<a href=\"db_action.php?table=app_version&appid=$result->appid&clauses=version_num%3D$result->app_version_num\">".$result->app_version_num."</a>");
1255
row("App version ID", $result->app_version_id);
1256
row("Estimated GFLOPS", number_format($result->flops_estimate/1e9, 2));
1201
1257
row("Random",$result->random);
1202
1258
row("Opaque",$result->opaque);
1203
1259
row("Teamid",$result->teamid);
1204
1260
row("Priority",$result->priority);
1261
row("XML doc in", "<pre>".htmlspecialchars($result->xml_doc_in)."</pre>");
1262
row("XML doc out", "<pre>".htmlspecialchars($result->xml_doc_out)."</pre>");
1263
row("stderr out", "<pre>".htmlspecialchars($result->stderr_out)."</pre>");
1206
echo "<div align=\"center\">";
1207
echo "<a href=\"show_log.php?s=$result->name\">GREP LOGS FOR THIS RESULT</a>";
1267
<a href=\"show_log.php?s=$result->name\">GREP LOGS FOR THIS RESULT</a>
1212
1273
function result_short_header() {
1256
1317
$received = "<font color=\"#ff3333\">". time_str($result->report_deadline) . "</font>";
1259
$version = $result->app_version_num;
1320
$version = "$result->app_version_num/$result->app_version_id";
1260
1321
$outcome_color = outcome_color($result->outcome);
1261
1322
$validate_color = validate_color($result->validate_state);
1262
1323
$host_user = host_user_link($result->hostid);
1263
1324
$cpu_hours = sprintf("%.1f",$result->cpu_time / 3600);
1264
1325
$claimed_credit = credit_str($result->claimed_credit);
1265
$granted_credit = credit_str($result->granted_credit);
1326
$granted_credit = "<a href=credit.php?resultid=$result->id>".credit_str($result->granted_credit)."</a>";
1266
1327
$delete_state = file_delete_state_str($result->file_delete_state);