".html_text("
int get_output_file_path(RESULT const&, std::string&);
"),"
Returns the path of a result's output file
(parses result.xml_doc_out and computes the file's position in the
hierarchical directory structure).
Note: this function doesn't handle multiple output files
(if there are multiple files, it returns the path of the first one).
If your application has multiple output files, see below.
".html_text("
int try_fopen(char* path, FILE*& f, char* mode);
")."
Open a file, distinguishing between recoverable and nonrecoverable errors.
Returns zero on success.
Returns ERR_FOPEN if the directory is present but not the file
(this is considered a nonrecoverable error).
Returns ERR_OPENDIR if the directory is not there
(this is generally a recoverable error, like NFS mount failure).
".html_text("
double median_mean_credit(vector const& results);
")."
Given a vector of N correct results, computes a canonical credit as follows:
- if N==1, return that result's claimed credit
- if N==2, return min of claimed credits
- if N>2, toss out high and low claimed credit,
and return the average of the rest.
Multiple output files
If your application has multiple output files
you'll need to generalize get_output_file_path().
To do this you'll need to know the following:
The database field 'result.xml_doc_out'
describes a result's output files.
It has the form
".html_text("
...
[ ... ]
foobar
blah
blah
...
[ ... ]
"),"
The components are:
- The <name> element is the result name.
- The <wu_name> element is the workunit name.
- Each <file_ref> element is an association to an output file,
described by a corresponding <file_info> element.
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();
?>