diff --git a/checkin_notes b/checkin_notes index e6c02596ab..719ddfb323 100755 --- a/checkin_notes +++ b/checkin_notes @@ -17212,5 +17212,7 @@ David 9 Sept 2004 db/ boinc.db.h sched/ + sample_bitwise_validator.C sample_trivial_validator.C + validate_util.C,h validator.C diff --git a/sched/sample_bitwise_validator.C b/sched/sample_bitwise_validator.C index fded497510..7ca5f40abd 100644 --- a/sched/sample_bitwise_validator.C +++ b/sched/sample_bitwise_validator.C @@ -85,7 +85,7 @@ int init_result_read_file(RESULT const & result, void*& data) } int check_pair_initialized_identical( - RESULT const& /*r1*/, void* data1, + RESULT & /*r1*/, void* data1, RESULT const& /*r2*/, void* data2, bool& match) { @@ -103,7 +103,11 @@ int cleanup_result_string(RESULT const& /*result*/, void* data) { // See if there's a strict majority under equality. // -int check_set(vector& results, int& canonicalid, double& credit) { +int check_set( + vector& results, DB_WORKUNIT&, int& canonicalid, double& credit, + bool& retry +) { + retry = false; return generic_check_set_majority( results, canonicalid, credit, init_result_read_file, @@ -112,12 +116,16 @@ int check_set(vector& results, int& canonicalid, double& credit) { ); } -int check_pair(RESULT const& r1, RESULT const& r2, bool& match) { - return generic_check_pair( - r1, r2, match, +int check_pair( + RESULT & r1, RESULT const& r2, bool& retry +) { + retry = false; + int retval = generic_check_pair( + r1, r2, init_result_read_file, check_pair_initialized_identical, cleanup_result_string ); + return retval; } diff --git a/sched/sample_trivial_validator.C b/sched/sample_trivial_validator.C index f62f0aa8eb..f0a0a16638 100644 --- a/sched/sample_trivial_validator.C +++ b/sched/sample_trivial_validator.C @@ -31,7 +31,7 @@ int init_result_trivial(RESULT const& result, void*& data) { } int check_pair_initialized_trivial( - RESULT const& r1, void* /*data1*/, + RESULT & r1, void* /*data1*/, RESULT const& r2, void* /*data2*/ ) { bool match = (r1.cpu_time >= MIN_CPU_TIME && r2.cpu_time >= MIN_CPU_TIME); @@ -43,7 +43,10 @@ int cleanup_result_trivial(RESULT const&, void*) { return 0; } -int check_set(vector& results, int& canonicalid, double& credit, bool& retry) { +int check_set( + vector& results, DB_WORKUNIT&, int& canonicalid, double& credit, + bool& retry +) { retry = false; return generic_check_set_majority( results, canonicalid, credit, @@ -53,7 +56,8 @@ int check_set(vector& results, int& canonicalid, double& credit, bool& r ); } -int check_pair(RESULT const& r1, RESULT const& r2, bool& match) { +int check_pair(RESULT & r1, RESULT const& r2, bool& retry) { + retry = false; return check_pair_initialized_trivial( r1, NULL, r2, NULL diff --git a/sched/validate_util.C b/sched/validate_util.C index a0cd5f172f..9ef0e0f04b 100644 --- a/sched/validate_util.C +++ b/sched/validate_util.C @@ -201,7 +201,7 @@ int generic_check_set_majority( } int generic_check_pair( - RESULT const& r1, RESULT const& r2, bool& match, + RESULT & r1, RESULT const& r2, init_result_f init_result_f, check_pair_with_data_f check_pair_with_data_f, cleanup_result_f cleanup_result_f @@ -209,6 +209,7 @@ int generic_check_pair( void* data1; void* data2; int retval; + bool match; retval = init_result_f(r1, data1); if (retval) { @@ -232,6 +233,7 @@ int generic_check_pair( } retval = check_pair_with_data_f(r1, data1, r2, data2, match); + r1.validate_state = match?VALIDATE_STATE_VALID:VALIDATE_STATE_INVALID; cleanup_result_f(r1, data1); cleanup_result_f(r2, data2); diff --git a/sched/validate_util.h b/sched/validate_util.h index e1baa5d30a..b5886ec2c7 100644 --- a/sched/validate_util.h +++ b/sched/validate_util.h @@ -25,7 +25,7 @@ #include typedef int (*init_result_f)(RESULT const&, void*&); -typedef int (*check_pair_with_data_f)(RESULT const&, void*, RESULT const&, void*, bool&); +typedef int (*check_pair_with_data_f)(RESULT &, void*, RESULT const&, void*, bool&); typedef int (*cleanup_result_f)(RESULT const&, void*); extern int get_output_file_path(RESULT const& result, std::string& path); extern double median_mean_credit(std::vector const& results); @@ -44,7 +44,7 @@ int generic_check_set_majority( cleanup_result_f cleanup_result_f); int generic_check_pair( - RESULT const& r1, RESULT const& r2, bool& match, + RESULT & r1, RESULT const& r2, init_result_f init_result_f, check_pair_with_data_f check_pair_with_data_f, cleanup_result_f cleanup_result_f); diff --git a/sched/validator.C b/sched/validator.C index 2dafadc87f..b977509097 100644 --- a/sched/validator.C +++ b/sched/validator.C @@ -49,7 +49,7 @@ extern int check_set( bool& retry ); extern int check_pair( - RESULT const& new_result, RESULT const& canonical_result, bool& retry + RESULT & new_result, RESULT const& canonical_result, bool& retry ); SCHED_CONFIG config;