- validator: get_credit_from_wu() returns an error, rather than exiting,

if WU doesn't have <credit> element

svn path=/trunk/boinc/; revision=15777
This commit is contained in:
David Anderson 2008-08-07 22:50:05 +00:00
parent 13f51d2402
commit ee56ea3341
7 changed files with 68 additions and 47 deletions

View File

@ -6325,3 +6325,16 @@ David 7 Aug 2008
html/user/
forum_forum.php
white.css
David 7 Aug 2008
- validator: get_credit_from_wu() returns an error, rather than exiting,
if WU doesn't have <credit> element
html/
ops/
bossa_admin.php
user/
white.css
sched/
validator.C
validate_util.C,h

View File

@ -83,10 +83,11 @@ td.indent {
}
td.heading {
#background-color: rgb(157, 221, 255);
#font-weight: bold;
background-color: rgb(223, 240, 255);
border: 1px solid lightblue;
background-color: rgb(223, 240, 255);
border: 1px solid lightblue;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
}
td.fieldname {

View File

@ -34,8 +34,9 @@ function include_app_file($app_id) {
require_once($file);
}
function show_app($app) {
echo "<tr>
function show_app($app, $i) {
$j = $i%2;
echo "<tr class=row$j>
<td>Name: $app->name<br>
Short name: $app->short_name<br>
Description: $app->description<br>
@ -57,8 +58,9 @@ function show_apps() {
start_table();
row1("Existing apps", 2);
table_header("Name/description", "");
$i = 0;
foreach ($apps as $app) {
show_app($app);
show_app($app, $i++);
}
end_table();
}
@ -165,10 +167,12 @@ function show_batch($batch_id) {
$jobs = BossaJob::enum("batch_id=$batch_id");
start_table();
table_header("ID", "Created", "State", "Instances");
$i = 0;
foreach ($jobs as $job) {
$t = time_str($job->create_time);
$s = job_state_string($job->state);
echo "<tr>
$j = $i++ % 2;
echo "<tr class=row$j>
<td>
$job->id <a href=bossa_admin.php?action=job_show_insts&job_id=$job->id>(details)</a><br>
";

View File

@ -5,9 +5,7 @@ a, a:link, a:visited, a:active {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:hover { text-decoration: underline; }
body {
background-image: url("img/gray_gradient.png");
@ -25,7 +23,7 @@ h1, h2 {
}
h1 {
color: #203C66;
color: #203C66;
margin: 10px;
}
@ -41,15 +39,14 @@ hr {
table {
border: 2px solid #e8e8e8;
padding: 2px;
margin: 2px 2px 2px 2px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: white;
padding: 4px;
margin: 2px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
}
table.noborder {
border: none;
border: none;
}
th {
@ -70,7 +67,7 @@ td.indent { border-left: 4px solid white; }
td.heading {
font-weight: bold;
margin: 4px 0px;
margin: 4px 0px;
padding: 8px;
background-color: #d8d8d8;
}
@ -79,11 +76,11 @@ td.fieldname {
background-color: #eeeeee;
text-align: right;
padding-right: 10px;
margin: 2px 0px;
margin: 2px 0px;
}
td.fieldvalue {
margin: 2px 0px;
margin: 2px 0px;
vertical-align: middle;
}
@ -127,9 +124,8 @@ tr.message { background-color: #e0e0e0; }
input, select, textarea{
border: 1px solid #d8d8d8;
background color: #eeeeee;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 2px;
font-size: 12px;
}
@ -150,9 +146,9 @@ img.userimg { border: 0px; }
#news {
background-color: #dff0ff;
border: 2px solid lightblue;
padding: 10px;
margin: 4px;
border: 2px solid lightblue;
padding: 10px;
margin: 4px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
@ -175,9 +171,9 @@ img.userimg { border: 0px; }
#uotd {
background-color: #eeeeee;
border: 2px solid lightgray;
padding: 10px;
margin: 4px;
border: 2px solid lightgray;
padding: 10px;
margin: 4px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
@ -186,15 +182,15 @@ img.userimg { border: 0px; }
td.category , tr.subtitle{
background-color: #dddddd;
border: 0px;
border: 0px;
font-weight: bold;
margin: 6px 0px;
}
th {
font-weight: bold;
margin: 4px 2px;
padding: 4px;
margin: 4px 2px;
padding: 4px;
}
td.postheader {
@ -202,18 +198,18 @@ td.postheader {
border-bottom: 1px solid rgb(190,190,200);
border-left: none;
border-right: none;
border-top: none;
margin-left: 4px;
border-top: none;
margin-left: 4px;
}
td.postbody {
font-size: 9pt;
margin-left: 4px;
margin-left: 4px;
}
td.postfooter {
background-color: rgb(220,210,210);
margin-left: 4px;
margin-left: 4px;
}
tr.helpdeskseperator { height: 10pt; }
@ -221,11 +217,11 @@ tr.helpdeskseperator { height: 10pt; }
tr.postseperator {
background-color: rgb(200,200,200);
border: 1px solid rgb(170,170,170);
margin: 4px 0px;
margin: 4px 0px;
}
tr.postseperator td {
border: none;
border: 0px;
}
td.threadline { text-align: left; }
@ -254,7 +250,7 @@ blockquote.postbody {
border-left: 2px solid blue;
border-color: blue;
background-color: rgb(240,240,255);
padding: 0px 0px 0px 5px;
padding: 0px 0px 0px 5px;
margin: 0px 100px 0px 15px;
font-style: italic;
}
@ -273,7 +269,7 @@ td.lastpost { background-color: white; }
height: 1px;
background-color: black;
color: black;
border: 0;
border: 0px;
margin-right: 100%;
}

View File

@ -234,7 +234,7 @@ double median_mean_credit(WORKUNIT& /*wu*/, vector<RESULT>& results) {
}
}
double get_credit_from_wu(WORKUNIT& wu, vector<RESULT>&) {
int get_credit_from_wu(WORKUNIT& wu, vector<RESULT>&, double& credit) {
double x;
int retval;
DB_WORKUNIT dbwu;
@ -243,11 +243,11 @@ double get_credit_from_wu(WORKUNIT& wu, vector<RESULT>&) {
retval = dbwu.get_field_str("xml_doc", dbwu.xml_doc, sizeof(dbwu.xml_doc));
if (!retval) {
if (parse_double(dbwu.xml_doc, "<credit>", x)) {
return x;
credit = x;
return 0;
}
}
fprintf(stderr, "ERROR: <credit> missing from WU XML\n");
exit(1);
return ERR_XML_PARSE;
}
// This function should be called from the validator whenever credit

View File

@ -45,7 +45,7 @@ extern int get_logical_name(
);
extern double median_mean_credit(WORKUNIT&, std::vector<RESULT>& results);
extern double get_credit_from_wu(WORKUNIT&, std::vector<RESULT>& results);
extern int get_credit_from_wu(WORKUNIT&, std::vector<RESULT>& results, double&);
extern double stddev_credit(WORKUNIT&, std::vector<RESULT>& results);
extern double two_credit(WORKUNIT&, std::vector<RESULT>& results);
extern int update_credit_per_cpu_sec(

View File

@ -434,7 +434,14 @@ int handle_wu(
if (retry) transition_time = DELAYED;
if (credit_from_wu) {
credit = get_credit_from_wu(wu, results);
retval = get_credit_from_wu(wu, results, credit);
if (retval) {
log_messages.printf(MSG_CRITICAL,
"[WU#%d %s] get_credit_from_wu returned %d\n",
wu.id, wu.name, retval
);
return retval;
}
}
if (max_granted_credit && credit>max_granted_credit) {
credit = max_granted_credit;