-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathfilter.py
executable file
·62 lines (46 loc) · 1.54 KB
/
filter.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
#!/usr/bin/env python3.6
import os
import time
import re
import argparse
import sys
import numpy as np
from extract import extract_stat
from specify import specify_stat
from check_ready import get_rand_list
from paths import *
def cat(x, y):
return os.path.join(os.path.expanduser(x), y)
possible_dirs = [
# part all:
#'~/dyn_part_all2',
#'~/dyn_bpp2',
'~/dyn_64_lsq_special3',
# share tlb:
#'~/dyn_share_tlb',
#'~/dyn_share_tlb2',
# share bp:
#'~/dyn_share_bp',
]
#file_name = './stat/pred_ipc_error_share_tlb.txt'
#file_name = './stat/pred_ipc_error_share_bp.txt'
#file_name = './stat/pred_ipc_error_part_all.txt'
def gen_stat_path(p, hpt, lpt):
return cat(cat(p, hpt+'_'+lpt), 'stats.txt')
result = []
threshold = 0.9
for line in get_rand_list('./rand.txt'):
hpt, lpt = line
for pd in possible_dirs:
if os.path.isfile(gen_stat_path(pd, hpt, lpt)):
pred_qos = float(specify_stat(gen_stat_path(pd, hpt, lpt),
False, 'system.cpu.HPTQoS'))
smt_ipc = float(specify_stat(gen_stat_path(pd, hpt, lpt),
False, 'cpu.ipc::0'))
st_ipc = float(specify_stat(cat(cat(st_stat_dir,
hpt + '_perlbench'),
'stats.txt'),
False, 'system.cpu.HPTpredIPC::0'))
real_qos = smt_ipc/st_ipc
if real_qos < threshold:
print(hpt, lpt) #, real_qos