function av_desc($gavid)
{
    if ($gavid >= 1000000) {
        $appid = (int) ($gavid / 1000000);
        $app = BoincApp::lookup_id($appid);
        if (!$app) {
            return tra("Anonymous platform, missing app");
        }
        $rsc_type = $gavid % 1000000;
        $r = rsc_name($rsc_type);
        return "{$app->user_friendly_name} (" . tra("anonymous platform") . ", {$r})";
    } else {
        $av = BoincAppVersion::lookup_id($gavid);
        if (!$av) {
            return tra("Missing app version");
        }
        $app = BoincApp::lookup_id($av->appid);
        if (!$app) {
            return tra("Missing app");
        }
        $platform = BoincPlatform::lookup_id($av->platformid);
        if (!$platform) {
            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}";
    }
}
예제 #2
0
function show_form($all)
{
    if ($all) {
        echo "<a href=manage_app_versions.php>Don't show deprecated app versions</a>\n";
    } else {
        echo "<a href=manage_app_versions.php?all=1>Show deprecated app versions</a>\n";
    }
    $_platforms = BoincPlatform::enum("");
    foreach ($_platforms as $platform) {
        $platforms[$platform->id] = $platform;
    }
    $_apps = BoincApp::enum("");
    foreach ($_apps as $app) {
        $apps[$app->id] = $app;
    }
    start_table("");
    table_header("ID #<br><p class=\"text-muted\">click for details</p>", "Application<br><p class=\"text-muted\">click for details</p>", "Version", "Platform", "Plan class", "minimum<br>client version", "maximum<br>client version", "beta?", "deprecated?", "");
    $clause = $all ? "true" : "deprecated = 0";
    $avs = BoincAppVersion::enum("{$clause} order by appid, platformid, plan_class, version_num");
    $i = 0;
    foreach ($avs as $av) {
        // grey out deprecated versions
        //
        $f1 = $f2 = '';
        if ($av->deprecated) {
            $f1 = "<font color='GREY'>";
            $f2 = "</font>";
        }
        $all_value = $all ? 1 : 0;
        echo "<tr class=row{$i}><form action=manage_app_versions.php?all={$all_value}#av_{$av->id} method=POST>\n";
        $i = 1 - $i;
        echo "<input type=hidden name=id value={$av->id}>";
        echo "  <TD>{$f1} <a id='av_{$av->id}' href=db_action.php?table=app_version&id={$av->id}>{$av->id}</a> {$f2}</TD>\n";
        $app = $apps[$av->appid];
        echo "  <TD>{$f1} <a href=app_details.php?appid={$app->id}>{$app->name}</a> {$f2}</TD>\n";
        echo "  <TD>{$f1} {$av->version_num} {$f2}</TD>\n";
        $platform = $platforms[$av->platformid];
        echo "  <TD>{$f1} {$platform->name} {$f2}</TD>\n";
        echo "  <td><input type=text name=plan_class size=12 value='{$av->plan_class}'></td>\n";
        $v = $av->min_core_version;
        echo "  <TD><input type='text' size='4' name=min_core_version value='{$v}'></TD>\n";
        $v = $av->max_core_version;
        echo "  <TD><input type='text' size='4' name=max_core_version value='{$v}'></TD>\n";
        $v = '';
        if ($av->beta) {
            $v = ' CHECKED ';
        }
        echo "  <TD> <input name=beta type='checkbox' {$v}></TD>\n";
        $v = '';
        if ($av->deprecated) {
            $v = ' CHECKED ';
        }
        echo "  <TD> <input name=deprecated type='checkbox' {$v}></TD>\n";
        echo "<td><input class=\"btn btn-default\" name=submit type=submit value=Update>";
        echo "</tr></form>";
    }
    end_table();
}
예제 #3
0
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");
}
예제 #4
0
function show_av($avid)
{
    $av = BoincAppVersion::lookup_id($avid);
    if (!$av) {
        echo "app version {$avid} not found";
        return;
    }
    echo "<hr>\nApp version ID: {$avid}\nplan class: {$av->plan_class}\nPFC: " . $av->pfc_avg . "\nscale: " . $av->pfc_scale . "\n";
}
예제 #5
0
function get_gpu_list($vendor, $alt_vendor = null)
{
    $clause = "plan_class like '%{$vendor}%'";
    if ($alt_vendor) {
        $clause .= " or plan_class like '%{$alt_vendor}%'";
    }
    $avs = BoincAppVersion::enum($clause);
    if (count($avs) == 0) {
        return null;
    }
    $av_ids = "";
    foreach ($avs as $av) {
        $av_ids .= "{$av->id}, ";
    }
    $av_ids .= "0";
    $t = time() - 30 * 86400;
    //echo "start enum $vendor $av_ids\n";
    $results = BoincResult::enum("app_version_id in ({$av_ids}) and create_time > {$t} and elapsed_time>100 limit 500");
    //echo "end enum\n";
    $total = array();
    $win = array();
    $linux = array();
    $mac = array();
    foreach ($results as $r) {
        $h = BoincHost::lookup_id($r->hostid);
        if (!$h) {
            continue;
        }
        $wu = BoincWorkunit::lookup_id($r->workunitid);
        if (!$wu) {
            continue;
        }
        $v = $vendor == "cuda" ? "CUDA" : "CAL";
        $model = get_gpu_model($h->serialnum, $v);
        if (!$model) {
            continue;
        }
        add_model($model, $r, $wu, $total);
        if (strstr($h->os_name, "Windows")) {
            add_model($model, $r, $wu, $win);
        }
        if (strstr($h->os_name, "Linux")) {
            add_model($model, $r, $wu, $linux);
        }
        if (strstr($h->os_name, "Darwin")) {
            add_model($model, $r, $wu, $mac);
        }
    }
    $x = null;
    $x->total = $total;
    $x->win = $win;
    $x->linux = $linux;
    $x->mac = $mac;
    return $x;
}
예제 #6
0
function show_form()
{
    $_platforms = BoincPlatform::enum("");
    foreach ($_platforms as $platform) {
        $platforms[$platform->id] = $platform;
    }
    $_apps = BoincApp::enum("");
    foreach ($_apps as $app) {
        $apps[$app->id] = $app;
    }
    start_table("");
    table_header("ID #<br><span class=note>click for details</span>", "Application<br><span class=note>click for details</span>", "Version", "Platform", "Plan Class", "minimum<br>client version", "maximum<br>client version", "beta?", "deprecated?", "");
    $avs = BoincAppVersion::enum("true order by appid, platformid, plan_class, version_num");
    $i = 0;
    foreach ($avs as $av) {
        // grey out deprecated versions
        //
        $f1 = $f2 = '';
        if ($av->deprecated) {
            $f1 = "<font color='GREY'>";
            $f2 = "</font>";
        }
        echo "<tr class=row{$i}><form action=manage_app_versions.php method=POST>\n";
        $i = 1 - $i;
        echo "<input type=hidden name=id value={$av->id}>";
        echo "  <TD>{$f1} <a href=db_action.php?table=app_version&id={$av->id}>{$av->id}</a> {$f2}</TD>\n";
        $app = $apps[$av->appid];
        echo "  <TD>{$f1} <a href=app_details.php?appid={$app->id}>{$app->name}</a> {$f2}</TD>\n";
        echo "  <TD>{$f1} {$av->version_num} {$f2}</TD>\n";
        $platform = $platforms[$av->platformid];
        echo "  <TD>{$f1} {$platform->name} {$f2}</TD>\n";
        echo "  <td>{$f1} {$av->plan_class} {$f2}</td>\n";
        $v = $av->min_core_version;
        echo "  <TD><input type='text' size='4' name=min_core_version value='{$v}'></TD>\n";
        $v = $av->max_core_version;
        echo "  <TD><input type='text' size='4' name=max_core_version value='{$v}'></TD>\n";
        $v = '';
        if ($av->beta) {
            $v = ' CHECKED ';
        }
        echo "  <TD> <input name=beta type='checkbox' {$v}></TD>\n";
        $v = '';
        if ($av->deprecated) {
            $v = ' CHECKED ';
        }
        echo "  <TD> <input name=deprecated type='checkbox' {$v}></TD>\n";
        echo "<td><input name=submit type=submit value=Update>";
        echo "</tr></form>";
    }
    end_table();
}
예제 #7
0
function app_version_action($app)
{
    $avs = BoincAppVersion::enum("appid={$app->id}");
    foreach ($avs as $av) {
        $x = get_str("dep_{$av->id}", true);
        if ($x) {
            if (!$av->deprecated) {
                $av->update("deprecated=1");
            }
        } else {
            if ($av->deprecated) {
                $av->update("deprecated=0");
            }
        }
    }
    page_head("Update successful");
    echo "\n        <a href=manage_app.php?app_id={$app->id}>Return to application management page</a>\n    ";
    page_tail();
}
예제 #8
0
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
// show details of an app
require_once '../inc/util_ops.inc';
$appid = get_int("appid");
$app = BoincApp::lookup_id($appid);
if (!$app) {
    admin_error_page("no such app");
}
admin_page_head("Details for {$app->name} ({$app->user_friendly_name})");
start_table();
row2("Min average efficiency", $app->min_avg_pfc);
echo "\n    <p>\n    In the list below, 'Credit scale factor' should\n    be roughly 1 for CPU versions, 0.1 for GPU versions.\n    If values are far outside this range,\n    you may have bad FLOPs estimates.\n    In this case, you may want to\n    <ol>\n    <li> <a href=job_times.php?appid={$appid}>Get a better FLOPs estimate</a>\n    <li> <a href=app_reset.php?appid={$appid}>reset credit statistics for this application</a>.\n    </ol>\n";
end_table();
echo "<h2>App versions</h2>\n";
$avs = BoincAppVersion::enum("appid={$appid}");
$avs = current_versions($avs);
foreach ($avs as $av) {
    $platform = BoincPlatform::lookup_id($av->platformid);
    start_table();
    row2("ID", $av->id);
    row2("Platform", $platform->name);
    row2("Plan class", $av->plan_class);
    row2("Version num", $av->version_num);
    row2("Jobs validated", $av->pfc_n);
    row2("Average efficiency", $av->pfc_avg ? 1 / $av->pfc_avg : "---");
    row2("Credit scale factor", $av->pfc_scale);
    row2("Average credit", $av->expavg_credit);
    end_table();
}
admin_page_tail();
            $valid_app_versions = "{$av->id}";
        } else {
            $valid_app_versions .= ", {$av->id}";
        }
    }
    $limit_app_versions = "app_version_id IN ( {$valid_app_versions} ) AND";
    $query_order = "app_version_id DESC";
}
// Now that we have a valid list of app_version_nums'
// let's construct the main query
$main_query = "\nSELECT\n       app_version_id,\n       CASE\n           when INSTR(host.os_name, 'Darwin')  then\n                (CASE WHEN INSTR(host.p_vendor, 'Power') THEN 'Darwin PPC' ELSE 'Darwin x86' END)\n           when INSTR(host.os_name, 'Linux')   then 'Linux'\n           when INSTR(host.os_name, 'Windows') then 'Windows'\n           when INSTR(host.os_name, 'SunOS')   then 'SunOS'\n           when INSTR(host.os_name, 'Solaris') then 'Solaris'\n           when INSTR(host.os_name, 'Mac')     then 'Mac'\n           else {$unknown_platform}\n       end AS platform,\n       COUNT(*) AS total_results,\n       ((SUM(case when outcome = '1' then 1 else 0 end) / COUNT(*)) * 100) AS pass_rate,\n       ((SUM(case when outcome = '3' then 1 else 0 end) / COUNT(*)) * 100) AS fail_rate,\n       ((SUM(case when outcome = '3' and client_state = '1' then 1 else 0 end) / COUNT(*)) * 100) AS fail_rate1,\n       ((SUM(case when outcome = '3' and client_state = '2' then 1 else 0 end) / COUNT(*)) * 100) AS fail_rate2,\n       ((SUM(case when outcome = '3' and client_state = '3' then 1 else 0 end) / COUNT(*)) * 100) AS fail_rate3,\n       ((SUM(case when outcome = '3' and client_state = '4' then 1 else 0 end) / COUNT(*)) * 100) AS fail_rate4,\n       ((SUM(case when outcome = '3' and client_state = '5' then 1 else 0 end) / COUNT(*)) * 100) AS fail_rate5,\n       ((SUM(case when outcome = '3' and client_state = '6' then 1 else 0 end) / COUNT(*)) * 100) AS fail_rate6\nFROM   result\n           left join host on result.hostid = host.id\nWHERE\n       appid = '{$query_appid}' AND\n       server_state = '5' AND\n       {$limit_app_versions}\n       received_time > '{$query_received_time}'\nGROUP BY\n       app_version_id DESC,\n       platform\nORDER BY\n       {$query_order}\n";
$result = mysql_query($main_query);
start_table();
table_header("App version", "Total<br>Results", "Pass Rate", "Fail Rate", "Failed<br>Downloading", "Failed<br>Downloaded", "Failed<br>Computing", "Failed<br>Uploading", "Failed<br>Uploaded", "Aborted");
while ($res = mysql_fetch_object($result)) {
    $av = BoincAppVersion::lookup_id($res->app_version_id);
    $p = BoincPlatform::lookup_id($av->platformid);
    echo "<td align=\"left\" valign=\"top\">";
    echo sprintf("%.2f", $av->version_num / 100) . " {$p->name} [{$av->plan_class}]";
    echo "</td>";
    echo "<td align=\"right\" valign=\"top\">";
    echo $res->total_results;
    echo "&nbsp;&nbsp;</td>";
    echo "<td align=\"right\" valign=\"top\">";
    echo $res->pass_rate;
    echo "%&nbsp;&nbsp;</td>";
    echo "<td align=\"right\" valign=\"top\">";
    echo $res->fail_rate;
    echo "%&nbsp;&nbsp;</td>";
    echo "<td align=\"right\" valign=\"top\">";
    echo $res->fail_rate1;
예제 #10
0
// generate XML showing the average PFC of GPU versions
// relative to CPU versions.
// This can be used to scale GPU credit
// for projects that have only GPU versions
require_once "../inc/boinc_db.inc";
require_once "../inc/xml.inc";
$cpu_scale_sum = 0;
$cpu_credit_sum = 0;
$ati_scale_sum = 0;
$ati_credit_sum = 0;
$nvidia_scale_sum = 0;
$nvidia_credit_sum = 0;
$total_credit_sum = 0;
$apps = BoincApp::enum("deprecated=0");
foreach ($apps as $app) {
    $avs = BoincAppVersion::enum("appid={$app->id} and deprecated=0");
    foreach ($avs as $av) {
        if (strstr($av->plan_class, "ati")) {
            $ati_scale_sum += $av->pfc_scale * $av->expavg_credit;
            $ati_credit_sum += $av->expavg_credit;
        } else {
            if (strstr($av->plan_class, "nvidia") || strstr($av->plan_class, "cuda")) {
                $nvidia_scale_sum += $av->pfc_scale * $av->expavg_credit;
                $nvidia_credit_sum += $av->expavg_credit;
            } else {
                $cpu_scale_sum += $av->pfc_scale * $av->expavg_credit;
                $cpu_credit_sum += $av->expavg_credit;
            }
        }
        $total_credit_sum += $av->expavg_credit;
    }
예제 #11
0
function create_app_dir()
{
    global $app_name, $app_id, $platform, $wrapper_filename;
    global $wrapper_md5;
    $i = 0;
    $latest_i = -1;
    $have_latest_wrapper = false;
    while (1) {
        $app_dir = app_version_dir($app_name, $i, $platform);
        if (!file_exists($app_dir)) {
            break;
        }
        $latest_i = $i;
        $i++;
    }
    if ($latest_i >= 0) {
        $i = $latest_i;
        $app_dir = app_version_dir($app_name, $i, $platform);
        $file = "{$app_dir}/" . $app_name . "_1." . $i;
        $latest_md5 = md5_file($file);
        if ($latest_md5 == $wrapper_md5) {
            $have_latest_wrapper = true;
            echo "App version is current.\n";
        } else {
            echo "{$latest_md5} != {$wrapper_md5}\n";
        }
    }
    if ($have_latest_wrapper) {
        echo "Current wrapper already installed.\n";
        // make sure they ran update_versions
        //
        $av = BoincAppVersion::lookup("appid={$app_id} and version_num={$i}");
        if (!$av) {
            echo "- type 'bin/update_versions', and answer 'y' to all questions.\n";
        }
    } else {
        echo "Installing current wrapper.\n";
        $i = $latest_i + 1;
        $app_dir = app_version_dir($app_name, $i, $platform);
        if (make_app_version_dir($app_name, $i, $platform)) {
            error("Couldn't create dir: {$app_dir}");
        }
        $file = "{$app_dir}/{$app_name}" . "_1." . $i;
        if (!copy($wrapper_filename, $file)) {
            error("Couldn't copy {$wrapper_filename} to {$file}");
        }
        chmod($file, 0750);
        echo "- type 'bin/update_versions', and answer 'y' to all questions.\n";
    }
}
예제 #12
0
<?php

// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
// output XML summary of app versions
require_once "../inc/boinc_db.inc";
require_once "../inc/xml.inc";
BoincDb::get(true);
xml_header();
echo "<app_versions>\n";
$app_versions = BoincAppVersion::enum("deprecated=0 and pfc_n>0");
foreach ($app_versions as $av) {
    $platform = BoincPlatform::lookup_id($av->platformid);
    $app = BoincApp::lookup_id($av->appid);
    echo "\n    <app_version>\n        <id>{$av->id}</id>\n        <create_time>{$av->create_time}</create_time>\n        <platform>{$platform->name}</platform>\n        <app_name>{$app->name}</app_name>\n        <version_num>{$av->version_num}</version_num>\n        <plan_class>{$av->plan_class}</plan_class>\n        <pfc_n>{$av->pfc_n}</pfc_n>\n        <pfc_avg>{$av->pfc_avg}</pfc_avg>\n        <pfc_scale>{$av->pfc_scale}</pfc_scale>\n        <expavg_credit>{$av->expavg_credit}</expavg_credit>\n        <expavg_time>{$av->expavg_time}</expavg_time>\n    </app_version>\n";
}
echo "</app_versions>\n";
예제 #13
0
function version_select($appid)
{
    $x = "<select name=app_version_id>\n        <option value=0>All\n    ";
    $avs = BoincAppVersion::enum("appid={$appid}");
    $avs = current_versions($avs);
    foreach ($avs as $av) {
        $platform = BoincPlatform::lookup_id($av->platformid);
        $n = $platform->name;
        if (strlen($av->plan_class)) {
            $n .= " ({$av->plan_class})";
        }
        $x .= "<option value={$av->id}> {$n}\n";
    }
    $x .= "</select>\n";
    return $x;
}
예제 #14
0
function show_appl($app_id)
{
    $app = BoincApp::lookup_id($app_id);
    page_head("App {$app->user_friendly_name} credit");
    $avs = BoincAppVersion::enum("appid={$app_id} and deprecated=0");
    start_table();
    table_header("platform/class/version", "PFC nsamples", "PFC avg", "PFC scale");
    $avs = current_versions($avs);
    foreach ($avs as $av) {
        $plat = BoincPlatform::lookup_id($av->platformid);
        table_row("<a href=credit.php?av_id={$av->id}>{$plat->user_friendly_name} {$av->plan_class} {$av->version_num}</a>", $av->pfc_n, $av->pfc_avg, $av->pfc_scale);
    }
    end_table();
    page_tail();
}