-
Notifications
You must be signed in to change notification settings - Fork 0
/
pmoss_configs.py
144 lines (125 loc) · 4.76 KB
/
pmoss_configs.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
139
140
141
142
143
import os
from enum import Enum
class Machine:
def __init__(self, name):
self.name = name
current_folder = os.getcwd()
file_hw = os.path.join(current_folder + "/machines/" + self.name + "/hw.cfg")
hw_cfgs = []
with open(file_hw, 'r') as f:
for line in f:
line = line.strip()
int_array = [int(_) for _ in line.split()]
hw_cfgs.append(int_array)
self.numa_node = hw_cfgs[0][0]
self.worker_per_numa = hw_cfgs[0][1]
self.mc_channel_per_numa = hw_cfgs[0][2]
self.socket = hw_cfgs[0][3]
self.num_upi_per_socket = hw_cfgs[0][4]
self.num_worker = hw_cfgs[1][0]
self.li_ncore_dumper = hw_cfgs[2]
self.li_worker = hw_cfgs[3]
self.worker_to_chassis_pos_mapping = hw_cfgs[4]
assert(len(self.li_worker) == len(self.worker_to_chassis_pos_mapping))
def __repr__(self):
return (f"Machine(name={self.name}, cnt_numa_node={self.numa_node}, worker_per_numa={self.worker_per_numa}, "
f"mc_channel_per_numa={self.mc_channel_per_numa}, num_worker={self.num_worker}, "
f"li_ncore_dumper={self.li_ncore_dumper}, li_worker={self.li_worker}, "
f"chassis mapping = {self.worker_to_chassis_pos_mapping})")
class ExpConfig:
def __init__(self, processor, chassis_dim, index, workload, num_features, num_meta_features,
cnt_grid_cells, cfg_par, per_cfg_sample, policy_dim,
rtg_scale, rtg_div, eval_start_cfg, idx_kb_folder, save_idx):
self.processor = processor
self.chassis_dim = chassis_dim # A tuple (x, y)
self.index = index # The name of the index used in the experiment
self.workload = workload # The type of workload used (e.g., read-heavy, write-heavy)
self.num_features = num_features # Number of features in the experiment configuration
self.num_meta_features = num_meta_features
self.cnt_grid_cells = cnt_grid_cells # Number of grid cells for partitioning or sampling
self.cfg_par = cfg_par # From which index does the data starts (including)
self.per_cfg_sample = per_cfg_sample
self.policy_dim = policy_dim
self.rtg_scale = rtg_scale # return to go 1.0, 1.1
self.rtg_div = rtg_div # Division by ?
self.eval_start_cfg = eval_start_cfg # For evaluation, which config to base it upon
self.idx_kb_folder = idx_kb_folder # kb_b, kb_r
self.machine = Machine(self.processor)
vendor, cpu = self.processor.split('_', 1)
current_folder = os.getcwd()
self.kb_path = os.path.join(current_folder + "/kbs/" +
vendor + "/" + cpu + "/" +
self.idx_kb_folder +"/"
)
self.save_idx = save_idx
def __repr__(self):
return (f"ExpConfig(processor={self.processor}\n"
f"chassis_dim={self.chassis_dim}\n"
f"index={self.index}\n"
f"workload={self.workload}\n"
f"num_features={self.num_features}\n"
f"num_meta_features={self.num_meta_features}\n"
f"cnt_grid_cells={self.cnt_grid_cells}\n"
f"cfg_par={self.cfg_par}\n"
f"rtg_scale={self.rtg_scale}, rtg_div={self.rtg_div}\n"
f"eval_start_cfg={self.eval_start_cfg}\n"
f"idx_kb_folder={self.idx_kb_folder}\n"
f"machine={self.machine}\n"
f"kb_path={self.kb_path}")
class wl(Enum):
MD_RS_UNIFORM = 0
MD_RS_NORMAL = 1
MD_LK_UNIFORM = 2
MD_RS_ZIPF = 3
MD_RS_HOT3 = 4
MD_RS_HOT5 = 5
MD_RS_HOT7 = 6
MD_LK_RS_25_75 = 7
MD_LK_RS_50_50 = 8
MD_LK_RS_75_25 = 9
MD_RS_LOGNORMAL = 10
SD_YCSB_WKLOADA = 11
SD_YCSB_WKLOADC = 12
SD_YCSB_WKLOADE = 13
SD_YCSB_WKLOADF = 14
SD_YCSB_WKLOADE1 = 15
SD_YCSB_WKLOADH = 16
SD_YCSB_WKLOADI = 17
WIKI_WKLOADA = 18
WIKI_WKLOADC = 19
WIKI_WKLOADE = 20
WIKI_WKLOADF = 21
WIKI_WKLOADI = 22
WIKI_WKLOADH = 23
WIKI_WKLOADA1 = 24
WIKI_WKLOADA2 = 25
WIKI_WKLOADA3 = 26
OSM_WKLOADA = 27
OSM_WKLOADC = 28
OSM_WKLOADE = 29
OSM_WKLOADH = 30
SD_YCSB_WKLOADA1 = 31
SD_YCSB_WKLOADH11 = 32
OSM_WKLOADA0 = 33
SD_YCSB_WKLOADH1 = 34
SD_YCSB_WKLOADH2 = 35
SD_YCSB_WKLOADH3 = 36
SD_YCSB_WKLOADH4 = 37
SD_YCSB_WKLOADH5 = 38
SD_YCSB_WKLOADA00 = 39
SD_YCSB_WKLOADA01 = 40
SD_YCSB_WKLOADC1 = 41
# Second Enum: Dataset Sources (starting from 0)
class ds(Enum):
OSM_USNE = 0
GEOLITE = 1
BERLINMOD02 = 2
YCSB = 3
WIKI = 4
FB = 5
OSM_CELLIDS = 6
# Third Enum: Tree Types (starting from 0)
class db_index(Enum):
BTREE = 0
RTREE = 1
QUADTREE = 2