-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.py
138 lines (119 loc) · 4.22 KB
/
config.py
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
"""
Main configuration file
Warning: this feature (i.e., centralized config file) is still in development
It is going to be largely extended in future
"""
from core.abstract_config import AbstractConfig
from core.collect import get_float_from_string, get_int_from_string, parse_time
from environment import GenericEnvironment, ASanEnvironment
class Config(AbstractConfig):
"""
Example config
Note that Config is a singleton
"""
# ========================
# Run and Build parameters
# ========================
# default input type
input_type = ""
# list of used environments
environments = (
GenericEnvironment,
ASanEnvironment
)
# measurement tools
stats_action = {
"perf": "perf stat -e cycles -e instructions",
"time": "/usr/bin/time --verbose",
"none": "",
}
# ========================
# Data preparation
# ========================
# Results processing (how data is gathered from raw logs)
# the format is as follows:
# name of field in csv file: [ keyword to identify a necessary line in logs, function to process the line]
parsed_data = {
"perf": {
"exit": ["[Exit code]", lambda l: get_int_from_string(l)],
"cycles": ["cycles", lambda l: get_int_from_string(l)],
"instructions": [" instructions ", lambda l: get_int_from_string(l)],
"time": ["seconds time elapsed", lambda l: get_float_from_string(l)],
},
"time": {
"time": ["Elapsed (wall clock) time", lambda l: parse_time(l)],
"user_time": ["User time (seconds)", lambda l: get_float_from_string(l)],
"sys_time": ["System time (seconds)", lambda l: get_float_from_string(l)],
"major_faults": ["Major (requiring I/O) page faults", lambda l: get_int_from_string(l)],
"minor_faults": ["Minor (reclaiming a frame) page faults", lambda l: get_int_from_string(l)],
"voluntary_context_switches": ["Voluntary context switches", lambda l: get_int_from_string(l)],
"involuntary_context_switches": ["Involuntary context switches", lambda l: get_int_from_string(l)],
"maxsize": ["Maximum resident set size", lambda l: get_int_from_string(l)],
},
"none": {},
}
# Results aggregation (what means to calculate)
# the format is as follows:
# type: (what column to aggregate, what columns to keep untouched)
aggregated_data = {
"perf": (["time"], ["compiler", "type", "name", "input", "threads"]),
"mem": (["maxsize"], ["compiler", "type", "name", "input", "threads"]),
"multi": (["time"], ["compiler", "type", "name", "input", "threads"]),
"tput": (["tput", "lat"], ["compiler", "type", "name", "num_clients", "input", "threads"]),
"instr": (["instructions"], ["compiler", "type", "name", "input", "threads"]),
"cache": (
["instructions", "l1_dcache_loads", "l1_dcache_load_misses", "l1_dcache_stores", "l1_dcache_store_misses", "llc_loads", "llc_load_misses", "llc_stores", "llc_store_misses"],
["compiler", "type", "name", "input", "threads"]
),
}
# ========================
# Plotting
# ========================
build_names = {
"long": {
"gcc-native": "Native (GCC)",
"gcc-asan": "ASan (GCC)",
},
"short": {
"gcc-native": "Native (GCC)",
"gcc-asan": "ASan",
},
"tiny": {
"Native (GCC)": r"$N$",
"ASan (GCC)": r"$A$",
},
"empty": {
"gcc-native": "",
"gcc-asan": "",
},
}
input_names = {
"long": {
0: "Small",
1: "Medium",
2: "Large",
3: "Extra Large",
4: "XXL"
},
"short": {
0: "S",
1: "M",
2: "L",
3: "XL",
4: "XXL"
}
}
default_build_order = (
"gcc-native",
"gcc-asan",
)
other_build_orders = {
"multi": (
"gcc-native",
"gcc-asan",
),
"cache": (
"gcc-asan",
"gcc-native",
),
}