-
Notifications
You must be signed in to change notification settings - Fork 6
/
xtree_plan.py
45 lines (35 loc) · 1.57 KB
/
xtree_plan.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
import multiprocessing as mp
from src.data.get_data import get_all_projects
from src.experiments.experiment1 import Experiment1
from src.experiments.experiment2 import Experiment2
if __name__ == "__main__":
data = get_all_projects()
# # =================================================================
# # ======================= EXPERIMENT 1 ===========================
# # =================================================================
# # -- Initialize the experiment --
# exp = Experiment1(verbose=True, plot_results=False, decrease=False)
# # # -- Serial Execution --
# # for proj, path in data.items():
# # exp.main(proj, path)
# # -- Get CPU core count --
# n_proc = mp.cpu_count()
# # -- Run asynchronously --
# with mp.Pool(processes=n_proc) as pool:
# tasks = pool.starmap(exp.main, tuple(data.items()))
# ================================================================
# ======================= EXPERIMENT 2 ===========================
# ================================================================
# -- Find the bellwether --
bellw = data.pop('lucene')
# -- Initialize the experiment --
exp = Experiment2(bellwether=bellw, verbose=True, plot_results=False,
decrease=False)
# # -- Serial Execution --
# for proj, path in data.items():
# exp.main(proj, path)
# -- Get CPU core count --
n_proc = mp.cpu_count()
# -- Run asynchronously --
with mp.Pool(processes=n_proc) as pool:
tasks = pool.starmap(exp.main, tuple(data.items()))