-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_generator-solorun.py
executable file
·63 lines (46 loc) · 1.68 KB
/
config_generator-solorun.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
#!/usr/bin/env python3
import argparse
import json
from pathlib import Path
import shutil
PARSEC_LIST = ['streamcluster', 'canneal', 'swaptions', 'x264', 'ferret', 'bodytrack', 'blackscholes',
'dedup', 'facesim', 'fluidanimate', 'freqmine', 'raytrace', 'vips']
RODINIA_LIST = ['nn', 'kmeans', 'cfd', 'particlefilter', 'bfs']
SPEC_LIST = ['lbm', 'libquantum', 'GemsFDTD', 'sphinx', 'gcc', 'zeusmp', 'sjeng']
NPB_LIST = ['CG', 'IS', 'DC', 'EP', 'MG', 'FT', 'SP', 'BT', 'LU', 'UA']
WORKLOAD_LIST = NPB_LIST
JSON_WORKLOAD_TEMPLATE = {
'num_of_threads': 16,
'binding_cores': "16-31",
'numa_nodes': "1",
'cpu_freq': 2.1
}
JSON_TEMPLATE = {
'workloads': [
],
'launcher': {
'hyper-threading': False,
'stops_with_the_first': False,
'post_scripts': [
'avg_csv.py',
'validate_perf.py'
]
}
}
def main():
parser = argparse.ArgumentParser(description='Config generator for benchmark_launcher. (solorun experiment)')
parser.add_argument('dest_dir', metavar='DEST_DIR', type=str, default='.', nargs='?',
help='The directory path where the experiment directories will be created.')
args = parser.parse_args()
workspace = Path(args.dest_dir).absolute()
for wl in WORKLOAD_LIST:
JSON_WORKLOAD_TEMPLATE['name'] = wl
JSON_TEMPLATE['workloads'] = [JSON_WORKLOAD_TEMPLATE]
folder = workspace / str(wl)
if folder.exists():
shutil.rmtree(str(folder))
folder.mkdir(parents=True)
with open(str(folder / 'config.json'), mode='w') as fp:
json.dump(JSON_TEMPLATE, fp, indent='\t')
if __name__ == '__main__':
main()