forked from IO500/io500
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphase_mdtest_hard_stat.c
51 lines (39 loc) · 1.11 KB
/
phase_mdtest_hard_stat.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <sys/stat.h>
#include <unistd.h>
#include <io500-phase.h>
#include <phase_mdtest.h>
typedef struct{
opt_mdtest_generic g;
mdtest_generic_res res;
} opt_mdtest_hard_stat;
static opt_mdtest_hard_stat o;
static ini_option_t option[] = {
{"API", "The API to be used", 0, INI_STRING, NULL, & o.g.api},
{"run", "Run this phase", 0, INI_BOOL, "TRUE", & o.g.run},
{NULL} };
static void validate(void){
}
static double run(void){
u_argv_t * argv = u_argv_create();
mdtest_hard_add_params(argv);
u_argv_push(argv, "-T"); /* only stat files */
u_argv_push_printf(argv, "--saveRankPerformanceDetails=%s/mdtest-hard-stat.csv", opt.resdir);
opt_mdtest_hard d = mdtest_hard_o;
mdtest_add_generic_params(argv, & d.g, & o.g);
if(opt.dry_run || o.g.run == 0 || mdtest_hard_o.g.run == 0){
u_argv_free(argv);
return 0;
}
FILE * out = u_res_file_prep(p_mdtest_hard_stat.name);
p_mdtest_run(argv, out, & o.res, MDTEST_FILE_STAT_NUM);
return o.res.rate;
}
u_phase_t p_mdtest_hard_stat = {
"mdtest-hard-stat",
IO500_PHASE_READ,
option,
validate,
run,
0,
.group = IO500_SCORE_MD
};