-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrunall
executable file
·141 lines (109 loc) · 4.25 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
#!/usr/bin/python
#
# run all tests
#
import os
import sys
os.system("echo HOSTNAME: `hostname`")
os.system("svn info")
tests = [
["nBody/parallelCK",True],
["rayCast/kdTree",True],
["suffixArray/serialKS",False],
["suffixArray/parallelKS",True],
["suffixArray/parallelRange",True],
["convexHull/quickHull",True],
["convexHull/serialHull",False],
["delaunayTriangulation/serialDelaunay",False],
["delaunayTriangulation/incrementalDelaunay",True],
["delaunayRefine/incrementalRefine",True],
["minSpanningTree/serialMST",False],
["minSpanningTree/parallelKruskal",True],
["spanningTree/serialST",False],
["spanningTree/incrementalST",True],
["spanningTree/newST",True],
#["spanningTree/ndST",True], loops forever
["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/blockRadixSort",True],
["removeDuplicates/serialHash",False],
["removeDuplicates/deterministicHash",True],
["dictionary/serialHash",False],
["dictionary/deterministicHash",True],
["comparisonSort/serialSort",False],
["comparisonSort/stlParallelSort",False],
["comparisonSort/sampleSort",True],
#["comparisonSort/quickSort",True],
["nearestNeighbors/octTreeNeighbors",True],
["nearestNeighbors/octTree2Neighbors",True],
["setCover/manis",True],
["setCover/setCover/serialSetCover",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 = int(os.getenv('PBBSMAXCPUS', detectCPUs()))
if maxcpus <= 16:
processors = [1]+range(2,maxcpus+1,2)
elif maxcpus <= 32:
processors = [1,2]+range(4,maxcpus+1,4)
else:
processors = [1,2,4]+range(8,maxcpus+1,8)
print(processors)
def runtest(dir,options) :
ss = "make -s -C " + dir
sc = "cd "+dir+" ; ./testInputs " + options
os.system("echo")
os.system(ss)
x = os.system(sc)
if (x) :
raise NameError(" " + sc)
try :
for test in tests :
if (test[1]) :
for p in processors :
if (p == 1) :
runtest(test[0], "-x -d -r 1 -p " + `p`)
elif (p < 16) :
runtest(test[0], "-x -d -r 3 -p " + `p`)
else :
runtest(test[0], "-x -d -r 5 -p " + `p`)
runtest(test[0],"-r 1 -p " + `processors[-1]`)
else :
runtest(test[0], "-r 3 -p 0")
except NameError,v :
x, = v
print "TEST TERMINATED ABNORMALLY:\n"+x