- scheduler: in matchmaker scheduler, if find a "locked" array slot,

which whether we're the process that locked it (from Artyom Sharov)

svn path=/trunk/boinc/; revision=15635
This commit is contained in:
David Anderson 2008-07-18 20:59:59 +00:00
parent 95eb044ef1
commit e70273774a
13 changed files with 307 additions and 246 deletions

View File

@ -5857,3 +5857,16 @@ Rom 18 July 2008
win_build/installerv2/redist/Windows/src/boinccas/
CAShutdownBOINCManager.cpp
David 18 July 2008
- web: fiddle around with style2.css and sample front page;
change font, etc.
html/
project.sample/
project.inc
user/
sample_index.php
style2.css
weak_auth.php
white.css

View File

@ -3,8 +3,7 @@ alter table bossa_app
add unique(short_name);
alter table bossa_job
add unique(name),
add index bj_conf_needed(app_id, conf_needed);
add index bj_conf_needed(app_id, calibration, priority_0);
alter table bossa_job_inst
add index bji_job(job_id),

View File

@ -46,8 +46,9 @@ create table bossa_user (
category integer not null,
flags integer not null,
-- debug, show_all
info text
info text,
-- Project-dependent info about users ability and performance.
primary key(user_id)
) engine = InnoDB;
create table bossa_batch (

View File

@ -1,6 +1,15 @@
<?
$project_news = array(
array("July 17, 2008",
"GPU computing has arrived to BOINC!
The <a href=http://www.gpugrid.net>GPUGRID.net</a> project
from the Barcelona Biomedical Research Park (PRBB)
uses CUDA-capable NVIDIA chips
to create an infrastructure for biomolecular simulations.
(Currently available for Linux64; other platforms to follow soon.
To participate, follow the instructions on the web site)."
),
array("July 10, 2008",
"<a href=http://boinc.berkeley.edu/wiki/BOINC_logo_merchandise>BOINC-logo merchandise</a> (T-shirts, mouse pads) is now available."
),

View File

@ -26,7 +26,6 @@ define("PROB_LIMIT", 1e-3);
function job_show($job, $inst, $user) {
$info = $job->get_info($job);
$path = $info->path;
echo "JOB SHOW";
echo "
<h2>Find the Ellipse!</h2>
<form method=get action=bossa_job_finished.php>
@ -41,7 +40,6 @@ function job_show($job, $inst, $user) {
}
function job_issued($job, $inst, $user) {
echo "JOB ISSUED";
$insts = $job->get_instances();
if (count($insts) > 1) {
$job->set_priority(0);
@ -60,8 +58,16 @@ function job_finished($job, $inst, $user) {
$inst->update_info($response);
if ($job->calibration) {
$b = $user->bossa;
$info = $job->get_info();
$answer = $info->answer;
$u = $b->get_info();
if (!$u) {
$u->npos = 0;
$u->npos_err = 0;
$u->nneg = 0;
$u->nneg_err = 0;
}
if (compatible($response, $answer)) {
if ($answer->have_ellipse) {
$u->npos++;
@ -77,8 +83,7 @@ function job_finished($job, $inst, $user) {
$u->nneg_err++;
}
}
$b = $user->bossa;
$b->update_info($info);
$b->update_info($u);
return;
}
@ -159,7 +164,7 @@ function job_timed_out($job, $inst, $user) {
function show_job_summary($job) {
$info = $job->get_info();
echo "<a href=".URL_BASE."$info->path>View image</a>";
echo "<a href=".URL_BASE."$info->path>(view image)</a>";
}
function show_instance_summary($inst) {
@ -172,6 +177,25 @@ function show_instance_summary($inst) {
}
function show_user_summary($user) {
$b = $user->bossa;
$info = $b->get_info();
if ($info) {
if ($info->npos) {
$pos_err = $info->npos_err/$info->npos;
} else {
$pos_err = "---";
}
if ($info->nneg) {
$neg_err = $info->nneg_err/$info->nneg;
} else {
$neg_err = "---";
}
echo "error rate: positive $pos_err ($info->npos_err/$info->npos),
negative $neg_err ($info->nneg_err/$info->nneg)
";
} else {
echo "No data";
}
}
?>

View File

@ -5,7 +5,6 @@ function show_next_job($app, $user) {
if ($inst) {
$job = BossaJob::lookup_id($inst->job_id);
$file = "../inc/$app->short_name.inc";
echo "reading $file\n";
require_once($file);
job_issued($job, $inst, $user);
page_head("Bossa job");

View File

@ -102,8 +102,8 @@ function show_all() {
page_tail();
}
function show_instances($job_id) {
$insts = BossaJobInst::enum("job_id=$job_id");
function show_instances($job) {
$insts = BossaJobInst::enum("job_id=$job->id");
if (!count($insts)) {
echo "---";
return;
@ -122,7 +122,7 @@ function show_instances($job_id) {
$d = "---";
};
echo "<tr>
<td><a href=show_user.php?userid=$user->id>$user->name</a></td>
<td><a href=bossa_admin.php?action=show_user&app_id=$job->app_id&user_id=$user->id>$user->name</a></td>
<td>$t</td>
<td>$d</td>
<td>
@ -149,7 +149,7 @@ function show_batch($batch_id) {
$s = job_state_string($job->state);
echo "<tr>
<td>
<a href=bossa_admin.php?action=show_insts&job_id=$job->id>$job->id</a><br>
$job->id <a href=bossa_admin.php?action=show_insts&job_id=$job->id>(details)</a><br>
";
show_job_summary($job);
echo "
@ -158,7 +158,7 @@ function show_batch($batch_id) {
<td>$s</td>
<td>
";
show_instances($job->id);
show_instances($job);
echo "
</td>
</tr>
@ -170,23 +170,19 @@ function show_batch($batch_id) {
function show_batches($app_id) {
$batches = BossaBatch::enum("app_id = $app_id");
page_head("Batches");
$app = BossaApp::lookup_id($app_id);
page_head("Batches ($app->name)");
start_table();
table_header("ID", "Name", "Calibration?", "Created", "Jobs", "Completed");
foreach ($batches as $batch) {
$n = BossaJob::count("batch_id=$batch->id");
$c = BossaJob::count("batch_id=$batch->id and state=2");
$t = time_str($batch->create_time);
$cal = $batch->calibration?"yes":"no";
echo "<tr>
<td><a href=bossa_admin.php?action=show_batch&batch_id=$batch->id>$batch->id</a></td>
<td>$batch->name</td>
<td>$cal</td>
<td>$t</td>
<td>$n</td>
<td>$c</td>
</tr>
";
table_row(
"$batch->id <a href=bossa_admin.php?action=show_batch&batch_id=$batch->id>(show jobs)</a>",
"$batch->name",
$batch->calibration?"yes":"no",
time_str($batch->create_time),
BossaJob::count("batch_id=$batch->id"),
BossaJob::count("batch_id=$batch->id and state=2")
);
}
end_table();
page_tail();
@ -196,10 +192,26 @@ function show_insts($job_id) {
$job = BossaJob::lookup_id($job_id);
include_app_file($job->app_id);
page_head("Instances of job $job_id");
show_instances($job_id);
show_instances($job);
page_tail();
}
function show_user() {
$user_id = get_int('user_id');
$app_id = get_int('app_id');
$user = BoincUser::lookup_id("$user_id");
BossaUser::lookup($user);
$app = BossaApp::lookup_id($app_id);
include_app_file($app_id);
page_head("Bossa user ($app->name)");
show_user_summary($user);
$insts = BossaJobInst::enum("user_id=$user_id");
foreach ($insts as $inst) {
}
page_tail();
}
$user = get_logged_in_user();
@ -219,7 +231,7 @@ mysql $db_name < bossa_schema.sql
Then <a href=bossa_admin.php>reload this page</a>.
";
page_tail();
exit();
exit;
}
}
@ -250,7 +262,7 @@ case 'add_app':
$course->update("bossa_app_id=$app_id");
}
Header('Location: bossa_admin.php');
exit();
exit;
case 'update_user':
$flags = 0;
if (get_str('show_all', true)) $flags |= BOLT_FLAGS_SHOW_ALL;
@ -258,19 +270,22 @@ case 'update_user':
$user->bossa->update("flags=$flags");
$user->bossa->flags = $flags;
Header('Location: bossa_admin.php');
exit();
exit;
case 'show_user':
show_user();
exit;
case 'show_batches':
$app_id = $_GET['app_id'];
show_batches($app_id);
exit();
exit;
case 'show_batch':
$batch_id = $_GET['batch_id'];
show_batch($batch_id);
exit();
exit;
case 'show_insts':
$job_id = $_GET['job_id'];
show_insts($job_id);
exit();
exit;
case 'hide':
$app_id = get_int('app_id');
$app = BossaApp::lookup_id($app_id);
@ -285,7 +300,7 @@ case 'unhide':
break;
case '':
show_all();
exit();
exit;
default:
error_page("unknown action $action");
}

View File

@ -28,11 +28,10 @@ function project_banner($title, $prefix) {
// Put your project title and logo here
// If you include any links, prepend URL with $prefix
echo "<table width=\"100%\">
<tr>
<td><h2>$title</h2></td>
<td align=right>
</td></tr></table>
echo "
<p>
<span class=\"page_title\">$title</span>
<p>
";
}
@ -44,7 +43,8 @@ function project_footer($show_return, $show_date, $prefix) {
}
echo "<br><br>Copyright &copy; ".date("Y ").COPYRIGHT_HOLDER."</center>\n";
if ($show_date) {
echo "<font size=-2 color=bbbbbb>Generated ",time_str(time()),"</font>\n";
$t = time_str(time());
echo "<span class=\"note\">Generated $t</span>\n";
}
}
@ -75,25 +75,24 @@ function show_profile_question2() {
}
function project_workunit($wu){
//echo "This is displayed on the workunit page";
// shown in the workunit page
}
function project_user_summary($user){
//echo "Text here will go to the user summary page";
// shown in the user summary page
}
function project_user_page_private($user){
//echo "Whatever is here is added to the private account page";
// shown in the private account page
}
function project_user_credit($user){
//echo "Whatever is here is added to the private account page";
// shown in the the private account page, credit area
}
function project_forum_post_rules() {
// Add <li> entries for additional forum post rules
return "
";
// additional forum post rules
return "";
}
?>

View File

@ -33,7 +33,7 @@ if ($init) {
page_head("Your account");
}
start_table();
start_table_noborder();
echo "<tr><td valign=top>";
start_table();
show_user_info_private($user);

View File

@ -78,10 +78,10 @@ echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://
echo "<html>
<head>
<title>".PROJECT."</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"white.css\">
<link rel=\"stylesheet\" type=\"text/css\" href=\"".STYLESHEET."\">
<link rel=\"alternate\" type=\"application/rss+xml\" title=\"".$rssname."\" href=\"".$rsslink."\">
</head><body>
<h1>".PROJECT."</h1>
<span class=page_title>".PROJECT."</span>
<table cellpadding=\"8\" cellspacing=\"4\">
<tr><td rowspan=\"2\" valign=\"top\" width=\"40%\">
";

View File

@ -1,325 +1,327 @@
a:link, a:visited, a:active {
color: #FF5C00;
text-decoration: none;
color: #FF5C00;
text-decoration: none;
}
a:hover {
text-decoration: underline;
color: #00A0E3;
text-decoration: underline;
color: #00A0E3;
}
body {
background-color: #F0F8FF;
font-family: Verdana;
font-size: 11px;
margin: 5px 40px;
color: black;
background-image: url(img/blue_gradient.png);
background-repeat: repeat-x;
background-color: #F0F8FF;
font-family: "Trebuchet MS", Verdana, Arial, Sans Serif;
font-size: 13px;
margin: 10px 30px;
color: black;
background-image: url(img/blue_gradient.png);
background-repeat: repeat-x;
}
input, select {
border: 1px solid grey;
background-color: #eeeeee;
padding: 3px;
font-size: 11px;
margin: 2px;
border: 1px solid grey;
background-color: #eeeeee;
padding: 3px;
font-size: 11px;
margin: 2px;
}
input:hover, input:active, select:hover {
border: 1px solid #FF5C00;
border: 1px solid #FF5C00;
}
input.btn {
margin: 3px 0px;
padding: 2px 5px;
margin: 3px 0px;
padding: 2px 5px;
}
h1 {
font-size: x-large;
font-weight: bold;
margin: 0px;
color: white;
font-size: x-large;
font-weight: bold;
color: white;
}
h2 {
font-size: large;
font-weight: bold;
margin: 0px;
font-size: large;
font-weight: bold;
margin: 4px;
}
h3, h4 {
font-size: small;
font-weight: bold;
font-size: small;
font-weight: bold;
}
img {
border: 0px;
border: 0px;
}
table {
border: 1px solid black;
background-color: white;
font-family: Verdana;
font-size: 11px;
margin: 6px 0px;
padding: 2px;
border: 1px solid black;
background-color: white;
margin: 6px 0px;
padding: 2px;
}
th {
border: 1px solid darkgrey;
background-color: #c8c8c8;
font-weight: bold;
border: 1px solid darkgrey;
background-color: #c8c8c8;
font-weight: bold;
}
td {
padding: 4px;
border: 0px;
margin-bottom: 0px;
vertical-align: top;
padding: 4px;
border: 0px;
margin-bottom: 0px;
vertical-align: top;
}
td.bordered {
border: 1px solid gray;
border: 1px solid gray;
}
td.indent {
border-left: 4px solid white;
border-left: 4px solid white;
}
td.heading {
background-color: #D8D8D8;
font-weight: bold;
background-color: #D8D8D8;
font-weight: bold;
}
td.heading2 {
font-weight: bold;
background-color: #eeeeee;
border: 1px solid grey;
font-weight: bold;
background-color: #eeeeee;
border: 1px solid grey;
}
td.fieldname {
background-color: #eeeeee;
text-align: right;
background-color: #eeeeee;
text-align: right;
}
td.fieldvalue {
font-weight: bold;
font-weight: bold;
}
td.fieldname_error {
background-color: #ff8888;
text-align: right;
background-color: #ff8888;
text-align: right;
}
td.fieldvalue_error {
background-color: #ff8888;
font-weight: bold;
background-color: #ff8888;
font-weight: bold;
}
td.category {
background-color: #dddddd;
background-color: #dddddd;
}
td.navbar {
border: 0px;
text-align: center;
border: 0px;
text-align: center;
}
a.navbar:link, a.navbar:visited {
color: #ff9711;
text-decoration: none;
color: #ff9711;
text-decoration: none;
}
a.navbar:hover {
color: #ffc060;
text-decoration: underline;
color: #ffc060;
text-decoration: underline;
}
tr.row1 {
text-align: left;
text-align: left;
}
tr.row0 td {
background-color: #eeeeee;
text-align: left;
background-color: #eeeeee;
text-align: left;
}
tr.row0 td.postheader {
background-color: #F0F8FF;
background-color: #F0F8FF;
}
tr.row0 td.postbody {
background-color: white;
background-color: white;
}
tr.row0 .authorcol input {
background-color: white;
background-color: white;
}
tr.row_hd0 {
background-color: #CFFACF;
background-color: #CFFACF;
}
tr.row_hd1 {
background-color: #DEFADE;
background-color: #DEFADE;
}
tr.subtitle {
background-color: #eeeeee;
font-weight: bold;
background-color: #eeeeee;
font-weight: bold;
}
tr.message {
background-color:#E0E0EF;
background-color:#E0E0EF;
}
.title {
font-size: 12px;
font-weight: bold;
font-size: 12px;
font-weight: bold;
}
.description {
font-size: 80%;
font-weight: normal;
font-size: 80%;
font-weight: normal;
}
.authorcol {
width: 125px;
overflow: hidden;
padding: 2px;
width: 125px;
overflow: hidden;
padding: 2px;
}
.authorcol img {
margin: 3px 0px;
margin: 3px 0px;
}
.cellwrap {
width: 100%;
overflow: auto;
width: 100%;
overflow: auto;
}
blockquote.postbody {
border-left: 2px solid #00A0E3;
background-color: #F0F8FF;
padding: 4px 8px;
margin-bottom: 0px;
margin-left: 20px;
margin-right: 60px;
font-style: italic;
border-left: 2px solid #00A0E3;
background-color: #F0F8FF;
padding: 4px 8px;
margin-bottom: 0px;
margin-left: 20px;
margin-right: 60px;
font-style: italic;
}
#thread {
width: 100%;
table-layout: fixed;
overflow: overflow;
width: 100%;
table-layout: fixed;
overflow: overflow;
}
#threadauthor input {
background-color: white;
background-color: white;
}
td.lastpost {
background-color: white;
background-color: white;
}
.sigdelim {
width: 60%;
height: 1px;
background-color: black;
color: black;
border: 0;
margin-right: 100%;
width: 60%;
height: 1px;
background-color: black;
color: black;
border: 0;
margin-right: 100%;
}
td.postheader {
background-color: #F0F8FF;
border-bottom: 1px solid #00A0E3;
border-left: 1px solid #00A0E3;
border-right: none;
padding-left: 6px;
background-color: #F0F8FF;
border-bottom: 1px solid #00A0E3;
border-left: 1px solid #00A0E3;
border-right: none;
padding-left: 6px;
}
td.postbody {
font-size: 9pt;
border-left: 1px solid #00A0E3;
padding-left: 8px;
padding-bottom: 6px;
font-size: 9pt;
border-left: 1px solid #00A0E3;
padding-left: 8px;
padding-bottom: 6px;
}
td.postfooter{
background-color: #EEEEEE;
border-top: 1px solid #00A0E3;
border-left: none;
border-right: none;
border-bottom: none;
padding-left: 6px;
background-color: #EEEEEE;
border-top: 1px solid #00A0E3;
border-left: none;
border-right: none;
border-bottom: none;
padding-left: 6px;
}
tr.helpdeskseperator{
height: 10pt;
height: 10pt;
}
tr.postseperator td{
border-top: 1px solid #AAAAAA;
border-bottom: 1px solid #AAAAAA;
background-color: #D3D3D3;
border-top: 1px solid #AAAAAA;
border-bottom: 1px solid #AAAAAA;
background-color: #D3D3D3;
}
td.threadline {
text-align: left;
color: #0074A4;
text-align: left;
color: #0074A4;
}
td.threadline a, tr.row1 em a {
color: #005477;
font-weight: bold;
color: #005477;
font-weight: bold;
}
td.threadline a:hover, tr.row1 em a:hover {
text-decoration: underline;
color: #00A0E3;
text-decoration: underline;
color: #00A0E3;
}
td.running {
background-color: #00ff00;
background-color: #00ff00;
}
td.notrunning {
background-color: #ff0000;
background-color: #ff0000;
}
td.disabled {
background-color: #ff8800;
background-color: #ff8800;
}
span.page_title {
font-size: 24px;
color: white;
margin: 20px;
}
span.note{
font-weight: normal;
font-size: 0.9em;
font-family: padding
font-weight: normal;
font-size: 0.9em;
}
span.news_date {
color: #191970;
font-size: 0.9em;
color: #191970;
font-size: 0.9em;
}
span.news_title {
font-size: 0.9em;
font-weight: bold;
font-size: 0.9em;
font-weight: bold;
}
.code {
font-family: "Consolas", "Courier New", courier, monospaace;
display: block;
margin-top: 3px;
margin-left: 5em;
border-left: 3px solid #00A0E3;
padding-left: 1em;
padding-top: 4px;
white-space: nowrap;
overflow: auto;
background-color: #F0F8FF;
font-family: "Consolas", "Courier New", courier, monospaace;
display: block;
margin-top: 3px;
margin-left: 5em;
border-left: 3px solid #00A0E3;
padding-left: 1em;
padding-top: 4px;
white-space: nowrap;
overflow: auto;
background-color: #F0F8FF;
}
* html body .code {
@ -328,69 +330,67 @@ span.news_title {
}
#news {
background-color: #E8F8FF;
vertical-align: top;
text-align: justify;
padding: 10px;
border: 1px solid grey;
background-color: #eeeeee;
text-align: justify;
padding: 10px;
border: 1px solid grey;
}
#news h2, #uotd h2, #mainnav h2 {
font-size: 1.2em;
font-weight: bold;
font-size: 1.2em;
font-weight: bold;
}
#news h3 {
font-size: 1em;
margin: 2px 0px;
font-size: 1em;
margin: 2px 0px;
}
#news p {
margin-top: 0px;
margin-top: 0px;
}
#uotd {
background-color: #FAF0E6;
vertical-align: top;
padding: 10px;
border: 1px solid grey;
background-color: #eeeeee;
padding: 10px;
border: 1px solid grey;
}
.smalltext {
font-size: 0.8em;
font-size: 0.8em;
}
.error {
color: #ff0000;
font-weight: bold;
font-size: 1.1em;
color: #ff0000;
font-weight: bold;
font-size: 1.1em;
}
.notice {
color: #009900;
font-weight: bold;
font-size: 1.1em;
color: #009900;
font-weight: bold;
font-size: 1.1em;
}
#preview {
border: 2px solid #cccccc;
background-color: #eeeeee;
margin: 1em;
padding: 0.2em;
border: 2px solid #cccccc;
background-color: #eeeeee;
margin: 1em;
padding: 0.2em;
}
#preview .header {
font-weight: bold;
font-size: 1.3em;
border-bottom: 1px solid #cccccc;
font-weight: bold;
font-size: 1.3em;
border-bottom: 1px solid #cccccc;
}
#mainnav {
text-align: justfy;
padding: 6px;
text-align: justfy;
padding: 6px;
}
hr {
size: 0px;
border-top: 1px dashed black;
size: 0px;
border-top: 1px dashed black;
}

View File

@ -10,21 +10,18 @@ page_head("Weak account key");
$weak_auth = weak_auth($user);
//this is somewhat a rewrite of escape_url_readable from str_util.C - maybe it
//should be moved into its own function instead of inline here
// figure out the name of this project's account file.
//cut off the http://
// strip http://
$idx = strpos($url, '://');
if ($idx !== FALSE) {
if ($idx) {
$url = substr($url, $idx+strlen('://'));
}
//convert invalid characters into underscores
for ($i=0; $i<strlen($url); $i++) {
$c = $url[$i];
if (ctype_alnum($c) || $c == '.' || $c == '-' || $c == '_') {
//noop; easier than inverting the condition
} else {
//in-place modification
if (!ctype_alnum($c) && $c != '.' && $c != '-' && $c != '_') {
$url[$i] = '_';
}
}

View File

@ -4,15 +4,16 @@ a:link, a:visited, a:active {
body, table, select {
background-color: white;
font-family: Verdana, Arial, Sans-Serif;
font-size: 12px;
font-family: "Trebuchet MS", Verdana, Arial, Sans Serif;
font-size: 13px;
margin: 5px 10px;
}
body {
color: black;
}
th{
th {
background-color: #c0c0c0;
font-weight: bold;
border: 1px solid white;
@ -234,6 +235,11 @@ td.disabled {
background-color: #ff8800;
}
span.page_title {
font-size: 24px;
margin: 20px;
}
span.note {
font-weight: normal;
font-size: 0.9em;
@ -269,11 +275,11 @@ span.highlight {
}
#news {
background-color: #dddddd;
vertical-align: top;
background-color: #eeeeee;
}
#news h2, #uotd h2, #mainnav h2 {
margin-top: 0px;
font-size: 1.2em;
font-weight: bold;
}
@ -289,8 +295,7 @@ span.highlight {
}
#uotd {
background-color: #ffeeff;
vertical-align: top;
background-color: #eeeeee;
}
.smalltext {