forked from cmuparlay/pbbsbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runall
executable file
·159 lines (125 loc) · 4.9 KB
/
runall
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/usr/bin/python
#
# run all tests
#
import os
import sys
os.system("echo HOSTNAME: `hostname`")
tests = [
#["nBody/parallelCK",True],
#["rayCast/kdTree",True],
#["suffixArray/serialKS",False],
#["suffixArray/serialDivsufsort",False],
#["suffixArray/parallelKS",True],
#["suffixArray/parallelRange",True],
#["convexHull/quickHull",True],
["convexHull/serialHull",False],
#["delaunayTriangulation/serialDelaunay",False],
#["delaunayTriangulation/incrementalDelaunay",True],
#["delaunayRefine/incrementalRefine",True],
# ["minSpanningForest/serialMST",False],
# ["minSpanningForest/parallelKruskal",True],
# ["minSpanningForest/parallelFilterKruskal",True],
# ["spanningForest/serialST",False],
# ["spanningForest/incrementalST",True],
# ["spanningForest/ndST",True],
# ["breadthFirstSearch/serialBFS",False],
# ["breadthFirstSearch/ndBFS",True],
# ["breadthFirstSearch/deterministicBFS",True],
# #["maximalMatching/serialMatching",False],
# #["maximalMatching/ndMatching",True],
# ["maximalMatching/incrementalMatching",True],
# ["maximalIndependentSet/serialMIS",False],
# ["maximalIndependentSet/ndMIS",True],
# ["maximalIndependentSet/incrementalMIS",True],
# ["integerSort/serialRadixSort",False],
# ["integerSort/parallelRadixSort",True],
#["removeDuplicates/serialHash",False],
#["removeDuplicates/deterministicHash",True],
#["dictionary/serialHash",False],
#["dictionary/deterministicHash",True],
# ["comparisonSort/serialSort",False],
# ["comparisonSort/stlParallelSort",False],
# ["comparisonSort/ips4o",True],
# ["comparisonSort/sampleSort",True],
# ["comparisonSort/quickSort",True],
# ["comparisonSort/mergeSort",True],
# ["comparisonSort/stableSampleSort",True],
# ["nearestNeighbors/octTreeNeighbors",True],
#["nearestNeighbors/octTree2Neighbors",True],
#["setCover/manis",True],
#["setCover/serialDFG",False],
#["spmv/pSPMV",True],
#["spmv/sSPMV",False],
# ["nearestNeighbor/callahanKosaraju",True],
# ["lassoRegression/parallelShootingLasso",True],
#["lassoRegression/parallelShootingLasso2",True]
]
if (sys.argv.count("-only") > 0):
filteredTests = [l for l in tests if sys.argv.count(l[0]) == 1]
tests = filteredTests
print("Running only: ", tests)
def detectCPUs():
"""
Detects the number of CPUs on a system. Cribbed from pp.
"""
# Linux, Unix and MacOS:
if hasattr(os, "sysconf"):
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
# Linux & Unix:
ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
if isinstance(ncpus, int) and ncpus > 0:
return ncpus
else: # OSX:
return int(os.popen2("sysctl -n hw.ncpu")[1].read())
# Windows:
if os.environ.has_key("NUMBER_OF_PROCESSORS"):
ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]);
if ncpus > 0:
return ncpus
return 1 # Default
maxcpus = detectCPUs()
if maxcpus <= 16:
processors = [1]+range(2,maxcpus+1,2)
elif maxcpus <= 32:
processors = [1,2]+range(4,maxcpus+1,4)
elif maxcpus <= 64:
processors = [1,2,4]+range(8,maxcpus+1,8)
elif maxcpus == 144:
processors = [1,4,16,32,72,108,144]
elif maxcpus == 256:
processors = [1,4,16,32,64,128,256]
else:
processors = [1,2,4,8]+range(16,maxcpus+1,16)
print(processors)
def runtest(dir,options,numactl) :
ss = "cd " + dir + " ; make -s cleanall ; make -s"
if numactl:
sc = "cd " + dir + " ; numactl -i all ./testInputs " + options
else:
sc = "cd " + dir + " ; ./testInputs " + options
os.system("echo")
os.system("echo " + dir)
os.system(ss)
x = os.system(sc)
if (x) :
raise NameError(" " + sc)
usenumactl = True
try :
for test in tests :
if (test[1]) :
for p in processors :
if (p == 1) :
runtest(test[0], "-x -r 1 -p " + `p`, False)
elif (p < 16) :
runtest(test[0], "-x -r 3 -p " + `p`, usenumactl)
elif (p < 64) :
runtest(test[0], "-x -r 5 -p " + `p`, usenumactl)
else :
runtest(test[0], "-x -r 7 -p " + `p`, usenumactl)
runtest(test[0],"-r 1 -p " + `processors[-1]`, usenumactl)
else :
runtest(test[0], "-r 1 -p 1", False)
except NameError,v :
x, = v
print "TEST TERMINATED ABNORMALLY:\n"+x