forked from SymbioticLab/Tiresias
-
Notifications
You must be signed in to change notification settings - Fork 2
/
execute.py
executable file
·59 lines (53 loc) · 1.8 KB
/
execute.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
from subprocess import Popen
import os
import time
def do_once(scheme, schedule, num_queue, num_buffer):
# cluster_spec = 'n4g4'
# trace_file = '60'
# scheme = 'yarn'
num_nodes_p_switch = 32
num_switch = 4
# schedule = 'fifo'
migrate = True
trace_file = 'month'
log_sub_dir = "thesis_fitted_"+str(num_buffer)+"_nodes_p_s"+str(num_nodes_p_switch) + "_job_" + trace_file
log_path = os.path.join(log_sub_dir, f"{scheme}_{schedule}")
if schedule == 'horus+':
log_path = os.path.join(log_path, "k"+str(num_queue))
python_ex = 'python.exe' if os.name == 'nt' else 'python3'
cmd = [
python_ex, 'run_sim.py',
'--num_node_p_switch', str(num_nodes_p_switch),
'--num_switch', str(num_switch),
# '--cluster_spec', cluster_spec+'.csv',
'--scheme', scheme,
'--trace_file', os.path.join("data",trace_file+'.csv'),
'--num_queue', str(num_queue),
'--num_buffer', str(num_buffer),
'--schedule', schedule,
'--enable_network_costs', 'False',
'--enable_migration', str(migrate),
'--log_path', log_path
]
p = Popen(cmd)
poll = None
pid = p.pid
print("process pid %d: " % pid)
try:
while poll is None:
time.sleep(5)
poll = p.poll()
except KeyboardInterrupt:
p.kill()
return
def main():
schemes = ['horus+', 'horus+', 'horus+','horus','gandiva', 'yarn']
queues = [3, 4, 5,1,1,1]
schedules = ['horus+', 'horus+', 'horus+', 'horus', 'gandiva', 'fifo']
buffers = [15, 15, 15, 1, 1, 1]
for scheme, schedule, queue in zip(schemes, schedules, queues):
for buff in buffers:
for _ in range(0, 3):
do_once(scheme, schedule, queue, buff)
if __name__ == "__main__":
main()