-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathgreedy_runner.py
More file actions
32 lines (25 loc) · 950 Bytes
/
greedy_runner.py
File metadata and controls
32 lines (25 loc) · 950 Bytes
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
import io
import os
import subprocess
import threading
import time
threads = []
if not os.path.exists('greedy'):
os.mkdir('greedy')
for seed in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
for day in [365*2]:
for dataset, dispatcher in [('HVLM', 'fifo'), ('LVHM', 'cr')]:
def s(day_, dataset_, dispatcher_):
name_ = f'greedy/greedy_seed{seed}_{day}days_{dataset}_{dispatcher}.txt'
with io.open(name_, 'w') as f:
print(name_)
subprocess.call(['pypy3', 'main.py', '--days', str(day_),
'--dataset', dataset_, '--dispatcher', dispatcher_, '--seed', str(seed),
'--alg', 'l4m'], stdout=f)
t = threading.Thread(target=s, args=(day, dataset, dispatcher))
t.start()
time.sleep(2)
threads.append(t)
for t in threads:
t.join()
print('Done')