Validation is the process of comparing redundant results and deciding which is to be considered correct. Because floating-point arithmetic varies between platforms, this decision is an application-specific.

A validator 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 validate.C. This program must be linked with two application-specific functions:

",
htmlspecialchars("
int check_set(vector results, int& canonicalid, double& credit);
int check_pair(RESULT& r1, RESULT& r2, bool& match);
"),
"
check_set() 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.

check_pair() compares two results and returns match=true if they agree.

Two example validators are supplied (each implements check_set() and check_pair()):

validate_util.C contains support functions for both of the above.


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:

The database field 'result.xml_doc_out' describes a result's output files. It has the form

",htmlspecialchars("
...
[ ... ]

    foobar
    blah
    blah
    ...
    [ ... ]

"),"
The components are:

The XML document describing the sizes and checksums of the output files is a list of <file_info> elements, with the nbytes and md5_cksum fields present. The project back end must parse this field to find the locations and checksums of output files. "; page_tail(); ?>