Skip to content

Commit fcc3678

Browse files
authored
Merge pull request #56 from amereghe/fix_validator_flagging_runtime_outliers
Fix validator in flagging runtime outliers
2 parents 922314b + 397ac2c commit fcc3678

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

boinc_software/sixtrack-validator/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!make
22

3-
PROJ=/boincdata/boinc/software/boinc_src/boinc
3+
# PROJ=/boincdata/boinc/software/boinc_src/boinc
4+
PROJ=/afs/cern.ch/work/s/sixtadm/public/boinc
45
SIXT=/usr/local/boinc/project/sixtrack/sixtrack-validator
56

67
INCL=-I$(PROJ) -I$(PROJ)/lib -I$(PROJ)/db -I$(PROJ)/sched -I/usr/include/mysql

boinc_software/sixtrack-validator/sixtrack_bitwise_validator.cpp

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "sched_util.h"
3737
#include "sched_msgs.h"
3838
#include "validate_util.h"
39+
#include "validator.h"
3940
#include "md5_file.h"
4041

4142
using std::string;
@@ -56,6 +57,9 @@ using std::vector;
5657
#define SIXCREDIT 2.0E-6
5758
//#define SIXCREDIT 2.5E-6
5859

60+
bool is_gzip = false;
61+
// if true, files are gzipped; skip header when comparing
62+
5963
struct FILE_CKSUM {
6064
FILE *fp;
6165
};
@@ -65,7 +69,25 @@ struct FILE_CKSUM_LIST {
6569
~FILE_CKSUM_LIST(){}
6670
};
6771

68-
bool files_match(RESULT &r1, FILE_CKSUM_LIST& f1, const RESULT &r2, FILE_CKSUM_LIST& f2) {
72+
int validate_handler_init(int argc, char** argv) {
73+
// handle project specific arguments here
74+
for (int i=1; i<argc; i++) {
75+
if (is_arg(argv[i], "is_gzip")) {
76+
is_gzip = true;
77+
}
78+
}
79+
return 0;
80+
}
81+
82+
void validate_handler_usage() {
83+
// describe the project specific arguments here
84+
fprintf(stderr,
85+
" Custom options:\n"
86+
" [--is_gzip] files are gzipped; skip header when comparing\n"
87+
);
88+
}
89+
90+
bool files_match(RESULT &r1, FILE_CKSUM_LIST& f1, RESULT &r2, FILE_CKSUM_LIST& f2) {
6991

7092
int c1, c2;
7193
int ipos, jpos;
@@ -189,8 +211,8 @@ bool files_match(RESULT &r1, FILE_CKSUM_LIST& f1, const RESULT &r2, FILE_CKSUM_L
189211
outlier = 0;
190212
if(fracturn < 1.0) {
191213
r1.runtime_outlier = true;
192-
// r2.runtime_outlier = 1; // const
193-
outlier = 1;
214+
r2.runtime_outlier = true;
215+
outlier = 1;
194216
}
195217
runtime1 = r1.elapsed_time;
196218
runtime2 = r2.elapsed_time;
@@ -271,7 +293,7 @@ int init_result(RESULT& result, void*& data) {
271293

272294
int compare_results(
273295
RESULT & r1, void* data1,
274-
RESULT const& r2, void* data2,
296+
RESULT & r2, void* data2,
275297
bool& match
276298
) {
277299
FILE_CKSUM_LIST* f1 = (FILE_CKSUM_LIST*) data1;

0 commit comments

Comments
 (0)