-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdarwinScheduler.py
More file actions
73 lines (64 loc) · 1.76 KB
/
darwinScheduler.py
File metadata and controls
73 lines (64 loc) · 1.76 KB
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
64
65
66
67
68
69
70
71
72
73
from subprocess import call
import ctypes
from multiprocessing import Process, Lock, Queue
lock = Lock()
the_queue = Queue()
import sys
array=["astar_biglakes",
"bwaves",
"bzip2_source",
"cactusADM",
"calculix",
"gamess_cytosine",
"gcc_166",
"GemsFDTD",
"gobmk_13x13",
"gromacs",
"h264ref_fbase",
"hmmer_nph3",
"lbm",
"leslie3d",
"libquantum",
"mcf",
"milc",
"namd",
"omnetpp",
"perlbench_checkspam",
"sjeng",
"soplex_pds50",
"tonto",
"zeusmp"]
x=int(sys.argv[1])
val=array[x]
dpoint=sys.argv[2]
def call_c( L ):
bmTester = ctypes.cdll.LoadLibrary('./build/pythonTesting/bmTestAdder.so')
arr = (ctypes.c_char_p * (len(L) + 1))()
bmTester.runMain.restype = ctypes.c_char_p
arr[:-1] = L
arr[ len(L) ] = None
result = bmTester.runMain(len(L),arr)
del bmTester
return result
def f(i):
f = open('workfile'+str(i)+val+dpoint+".txt", 'w')
while not the_queue.empty():
lock.acquire()
if not the_queue.empty():
l = the_queue.get(False)
else:
lock.release()
break
lock.release()
# res=call_c([l[0],"/local/LargeDisk/gem5/takeLogs/pirafix/"+l[0]+".Adder.txt",(l[1]),str(int(l[1])+10)])
# print >>f, "%d %s",(l, res)
call(["./build/test/bmTestAdder.exe",l[0]+".Adder.txt",(l[1]),str(int(l[1])+1),dpoint,l[0]],stdout=f)
for i in range(0,258):
lists=[]
lists.append(val)
# strv="ef"+str(i)+".txt"
lists.append(str(i*5))
# lists.append(strv)
the_queue.put(list(lists))
for i in range(5):
Process(target=f, args=(str(i))).start()