mirror of https://github.com/BOINC/boinc.git
- web: update text for finding data directory
This commit is contained in:
parent
4239d08fbf
commit
8740e9a2b5
|
@ -0,0 +1,65 @@
|
|||
#! /usr/bin/env php
|
||||
<?php
|
||||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2013 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/>.
|
||||
|
||||
// size_census
|
||||
// for each multi-size app,
|
||||
// find the N quantiles of its effective speed,
|
||||
// and write them to a file.
|
||||
// See http://boinc.berkeley.edu/trac/wiki/JobSizeMatching
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', true);
|
||||
ini_set('display_startup_errors', true);
|
||||
|
||||
require_once("../inc/boinc_db.inc");
|
||||
|
||||
function do_app($app) {
|
||||
// enumerate the host_app_versions for this app,
|
||||
// joined to the host
|
||||
|
||||
$db = BoincDb::get();
|
||||
$dbn = $db->db_name;
|
||||
$query = "select et_avg, host.on_frac, host.active_frac " .
|
||||
" from $dbn.host_app_version, $dbn.host, $dbn.app_version " .
|
||||
" where host_app_version.app_version_id = app_version.id " .
|
||||
" and app_version.appid = 1 " .
|
||||
" and et_n > 0 " .
|
||||
" and host.id = host_app_version.host_id";
|
||||
$result = $db->do_query($query);
|
||||
$a = array();
|
||||
while ($x = mysql_fetch_object($result)) {
|
||||
$a[] = $x->et_avg * $x->on_frac * $x->active_frac;
|
||||
}
|
||||
mysql_free_result($result);
|
||||
sort($a);
|
||||
$n = count($a);
|
||||
$f = fopen("../../size_census_".$app->name, "w");
|
||||
for ($i=1; $i<$app->n_size_classes; $i++) {
|
||||
$k = (int)(($i*n)/$app->n_size_classes);
|
||||
fprintf($f, "%f\n", $a[$k]);
|
||||
}
|
||||
fclose($f);
|
||||
}
|
||||
|
||||
$apps = BoincApp::enum("deprecated=0 and n_size_classes>1");
|
||||
foreach ($apps as $app) {
|
||||
do_app($app);
|
||||
}
|
||||
|
||||
?>
|
|
@ -47,7 +47,7 @@ echo "<p><h3>"
|
|||
.tra("If you have run BOINC under this account, you can still access it. Here's how:")."
|
||||
|
||||
<ul>
|
||||
<li> ".tra("Go to the BOINC data directory on your computer (on Windows this is usually <b>C:\\Documents and Settings\All Users\Application Data\BOINC</b> or <b>C:\\Program Files\BOINC</b>.")."
|
||||
<li> ".tra("Go to the BOINC data directory on your computer (its location is written to the Event Log at startup).")."
|
||||
<li> ".tra("Find your account file for this project; it will be named <b>%1</b>.", $account_file)."
|
||||
<li> ".tra("Open the file in a text editor like Notepad. You'll see something like")."
|
||||
<pre>
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
// This file is part of BOINC.
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2013 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/>.
|
||||
|
||||
// daemon to regulate the transition of jobs from INACTIVE to UNSENT,
|
||||
// to maintain a buffer of UNSENT jobs of each size class.
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "boinc_db.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include "sched_config.h"
|
||||
#include "sched_msgs.h"
|
||||
#include "sched_util.h"
|
||||
|
||||
char* app_name = NULL;
|
||||
int lo = 0;
|
||||
int hi = 0;
|
||||
int sleep_time = 0;
|
||||
DB_APP app;
|
||||
const char* order_clause = "";
|
||||
|
||||
void usage(){
|
||||
fprintf(stderr, "usage: size_regulator --app_name x --lo x --hi x --sleep_time x\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int do_pass(bool& action) {
|
||||
DB_RESULT result;
|
||||
int unsent[100];
|
||||
int retval = result.get_unsent_counts(app, unsent);
|
||||
if (retval) return retval;
|
||||
action = false;
|
||||
for (int i=0; i<app.n_size_classes; i++) {
|
||||
if (unsent[i] < lo) {
|
||||
int n = hi - unsent[i], nchanged;
|
||||
retval = result.make_unsent(app, i, n, order_clause, nchanged);
|
||||
if (retval) return retval;
|
||||
if (nchanged == n) {
|
||||
action = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int retval;
|
||||
char buf[256];
|
||||
|
||||
for (int i=1; i<argc; i++) {
|
||||
if (!strcmp(argv[i], "--app_name")) {
|
||||
app_name = argv[++i];
|
||||
} else if (!strcmp(argv[i], "--lo")) {
|
||||
lo = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "--hi")) {
|
||||
hi = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "--sleep_time")) {
|
||||
sleep_time = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "--random_order")) {
|
||||
order_clause = " order by random ";
|
||||
} else if (!strcmp(argv[i], "--priority_asc")) {
|
||||
order_clause = " order by priority asc ";
|
||||
} else if (!strcmp(argv[i], "--priority_order")) {
|
||||
order_clause = " order by priority desc ";
|
||||
} else if (!strcmp(argv[i], "--priority_order_create_time")) {
|
||||
order_clause = " order by priority desc, workunitid ";
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
}
|
||||
if (!app_name || !lo || !hi || !sleep_time) {
|
||||
usage();
|
||||
}
|
||||
|
||||
retval = config.parse_file();
|
||||
if (retval) {
|
||||
log_messages.printf(MSG_CRITICAL,
|
||||
"Can't parse config.xml: %s\n", boincerror(retval)
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
log_messages.printf(MSG_NORMAL, "Starting\n");
|
||||
|
||||
sprintf(buf, "where name='%s'", app_name);
|
||||
if (app.lookup(buf)) {
|
||||
log_messages.printf(MSG_CRITICAL, "no such app: %s\n", app_name);
|
||||
exit(1);
|
||||
}
|
||||
if (app.n_size_classes < 2) {
|
||||
log_messages.printf(MSG_CRITICAL, "app is not multi-size\n");
|
||||
exit(1);
|
||||
}
|
||||
while (1) {
|
||||
bool action;
|
||||
retval = do_pass(action);
|
||||
if (retval) {
|
||||
log_messages.printf(MSG_CRITICAL,
|
||||
"do_pass(): %s", boincerror(retval)
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
if (!action) daemon_sleep(sleep_time);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue