コード例 #1
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();
}
コード例 #2
0
ファイル: app_reset.php プロジェクト: nicolas17/boincgit-test
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");
}
コード例 #3
0
ファイル: gpu_list.php プロジェクト: nicolas17/boincgit-test
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;
}
コード例 #4
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();
}
コード例 #5
0
ファイル: manage_app.php プロジェクト: CalvinZhu/boinc
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();
}
コード例 #6
0
ファイル: app_details.php プロジェクト: CalvinZhu/boinc
// 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();
コード例 #7
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;
    }
コード例 #8
0
ファイル: app_versions.php プロジェクト: dimhotepus/boinc
<?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";
コード例 #9
0
ファイル: job_times.php プロジェクト: entibasse/superhost
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;
}
コード例 #10
0
ファイル: credit.php プロジェクト: maexlich/boinc-igemathome
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();
}