2003-12-24 00:50:51 +00:00
|
|
|
<?
|
|
|
|
require_once("docutil.php");
|
|
|
|
page_head("Validation");
|
|
|
|
echo "
|
2004-02-09 05:11:05 +00:00
|
|
|
<p>
|
2004-03-15 20:40:59 +00:00
|
|
|
<b>Validation</b> is the process of comparing redundant results
|
|
|
|
and deciding which is to be considered correct.
|
2004-03-17 01:26:44 +00:00
|
|
|
Because floating-point arithmetic varies between platforms,
|
|
|
|
this decision is an application-specific.
|
|
|
|
<p>
|
|
|
|
A <b>validator</b> is a back-end program that does validation
|
|
|
|
and credit-granting.
|
|
|
|
You must supply a validator for each application in your project.
|
|
|
|
BOINC supplies a framework program <b>validate.C</b>.
|
2004-03-15 20:40:59 +00:00
|
|
|
This program must be linked with two application-specific functions:
|
|
|
|
<pre>",
|
|
|
|
htmlspecialchars("
|
2004-02-09 05:11:05 +00:00
|
|
|
int check_set(vector<RESULT> results, int& canonicalid, double& credit);
|
|
|
|
int check_pair(RESULT& r1, RESULT& r2, bool& match);
|
2004-03-15 20:40:59 +00:00
|
|
|
"),
|
|
|
|
"</pre>
|
2004-02-09 05:11:05 +00:00
|
|
|
<b>check_set()</b> takes a set of results.
|
|
|
|
If there is sufficient agreement,
|
|
|
|
it selects one of them as the canonical result
|
|
|
|
(returning its ID) and also decides what credit should
|
|
|
|
be granted for correct results for this workunit.
|
|
|
|
<p>
|
|
|
|
<b>check_pair()</b> compares two results and returns match=true
|
|
|
|
if they agree.
|
|
|
|
|
|
|
|
<p>
|
2004-03-17 01:26:44 +00:00
|
|
|
Two example validators are supplied
|
|
|
|
(each implements check_set() and check_pair()):
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<b>validate_test</b> requires a strict majority,
|
|
|
|
and regards results as equivalent only if they agree byte for byte.
|
|
|
|
<li>
|
|
|
|
<b>validate_trivial</b>
|
|
|
|
regards any two results as equivalent if their CPU time
|
|
|
|
exceeds a given minimum.
|
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
<b>validate_util.C</b> contains support functions for
|
|
|
|
both of the above.
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
<b>NOTE: the above code assumes that each result
|
|
|
|
has a single output file.
|
|
|
|
Revisions will be needed to handle multiple output files.
|
|
|
|
To do this you will need to know the following:
|
|
|
|
</b>
|
2004-02-09 05:11:05 +00:00
|
|
|
|
2003-12-24 00:50:51 +00:00
|
|
|
<p>
|
2004-03-17 01:26:44 +00:00
|
|
|
The database field 'result.xml_doc_out'
|
|
|
|
describes a result's output files.
|
|
|
|
It has the form
|
|
|
|
<pre>
|
2004-03-15 20:40:59 +00:00
|
|
|
",htmlspecialchars("
|
|
|
|
<file_info>...</file_info>
|
2003-12-24 00:50:51 +00:00
|
|
|
[ ... ]
|
2004-03-15 20:40:59 +00:00
|
|
|
<result>
|
|
|
|
<name>foobar</name>
|
|
|
|
<wu_name>blah</wu_name>
|
|
|
|
<exit_status>blah</exit_status>
|
|
|
|
<file_ref>...</file_ref>
|
2003-12-24 00:50:51 +00:00
|
|
|
[ ... ]
|
2004-03-15 20:40:59 +00:00
|
|
|
</result>
|
|
|
|
"),"
|
2003-12-24 00:50:51 +00:00
|
|
|
</pre>
|
|
|
|
The components are:
|
|
|
|
<ul>
|
|
|
|
<li> The <b><name></b> element is the result name.
|
|
|
|
<li> The <b><wu_name></b> element is the workunit name.
|
2004-03-17 01:26:44 +00:00
|
|
|
<li> Each <b><file_ref></b> element is an association to an output file,
|
|
|
|
described by a corresponding <b><file_info></b> element.
|
2003-12-24 00:50:51 +00:00
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
The XML document describing the sizes and checksums of the output
|
2004-03-17 01:26:44 +00:00
|
|
|
files is a list of <b><file_info></b> elements,
|
|
|
|
with the <b>nbytes</b> and <b>md5_cksum</b> fields present.
|
2003-12-24 00:50:51 +00:00
|
|
|
The project back end
|
|
|
|
must parse this field to find the locations and checksums of output files.
|
|
|
|
";
|
|
|
|
page_tail();
|
|
|
|
?>
|