Developing a custom validator

This takes a result, reads its output file(s), parses them into a memory structure,
and returns (via the 'data' argument) a pointer to this structure.
The return value is:

Zero on success,

ERR_OPENDIR if there was a transient error, e.g. the output file is on a network volume that is not available.
The validator will try this result again later.

VAL_RESULT_SUSPICIOUS if an initial consistency check of the result indicates no error but that it should be compared with a second result to make sure contents are valid. In the meantime this result is marked as inconclusive and the validator will try this again later when a second result is ready. Only useful when using AdaptiveReplication.

Any other return value indicates a permanent error.
Example: an output file is missing, or has a syntax error.
The result will be marked as invalid.

To locate and open the result's output files, use
utility functions such as get_output_file_path() and try_fopen()
(see example below).

This takes two results and their associated memory structures.
It returns (via the 'match' argument) true if the two results are equivalent
(within the tolerances of the application).

extern int cleanup_result(RESULT& r, void* data);

This frees the structure pointed to by data, if it's non-NULL.

You must link these functions with the files validator.cpp, validate_util.cpp, and validate_util2.cpp.
The result is your custom validator.

If for some reason you need to access the WORKUNIT in your init_result() etc. functions:

DB_WORKUNIT wu;
wu.lookup_id(result.workunitid);

Note: You need commit ​b065526 in order to access result.workunit inside e.g. init_result()

Runtime outliers

BOINC's mechanisms for estimating job runtimes are based on the assumption
that a job's computation is roughly proportional to its FLOPS estimate (workunit.rsc_fpops_est).
If there are exceptions to this (e.g. jobs that exit immediately because of unusual input data)
these mechanisms will work better if you label them as such.
To do this, set

result.runtime_outlier = true;

in init_result() for these results.

Example

Here's an example for an application
whose output file contains an integer and a double.
Two results are considered equivalent if the integers are equal and the doubles differ by no more than 0.01.

Download in other formats:

Site migrated to: https://github.com/BOINC/boinc-dev-doc/wikiCopyright (c) 2014 University of California. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.