forked from jegonzal/PowerGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.sh
executable file
·324 lines (294 loc) · 10.7 KB
/
runtests.sh
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
#!/bin/bash
function quit_if_bad_retvalue {
if [ $? -eq 0 ]; then
echo "PASS"
else
echo "FAIL. Program returned with failure"
exit 1
fi
}
function test_rpc_prog {
echo "Testing $1 ..."
echo "---------$1-------------" >> $stdoutfname
echo "---------$1-------------" >> $stderrfname
mpiexec -n 2 -host $localhostname ./$1 >> $stdoutfname 2>> $stderrfname
if [ $? -ne 0 ]; then
echo "FAIL. Program returned with failure"
exit 1
fi
str="mpiexec -n 2 -host $localhostname ./$1 2> /dev/null | grep \"$2\""
#echo $str
e=`eval $str`
if [ -z "$e" ] ; then
echo "Expected program output not obtained"
exit 1
fi
}
stdoutfname=$PWD/stdout.log
stderrfname=$PWD/stderr.log
echo $PWD | grep debug > /dev/null
dbgpath=$?
echo $PWD | grep release > /dev/null
relpath=$?
echo $PWD | grep profile > /dev/null
propath=$?
if [ $dbgpath -eq 1 ]; then
if [ $relpath -eq 1 ]; then
if [ $propath -eq 1 ]; then
echo "This test must be run from either ./release/tests/, ./debug/tests/, or ./profile/tests/ in Graphlab root folder"
echo "Please compile GraphLab first, using the instructions on http://graphlab.org/download.html and try again from the approprite folder"
exit 1
fi
fi
fi
rm -f $stdoutfname $stderrfname
if [ $# -eq 0 ]; then
echo "Running Standard unit tests"
echo "==========================="
ctest -O testlog.txt
./anytests
./anytests_loader
# delete extra generated files
rm -f dg*
fi
echo | tee -a $stdoutfname
echo "Running application tests"| tee -a $stdoutfname
echo "========================="| tee -a $stdoutfname
echo "GraphLab collaborative filtering library"| tee -a $stdoutfname
somefailed=0
if [ -f ../demoapps/pmf/pmf ]; then
pushd . > /dev/null
cd ../demoapps/pmf
echo "---------PMF-------------" >> $stdoutfname
OUTFILE=smalltest.out
./pmf --show_version=true
if [ $? -eq 2 ]; then
echo "detected Eigen based pmf"| tee -a $stdoutfname
OUTFILE=smalltest_eigen.out
else
echo "detected it++ based pmf"| tee -a $stdoutfname
fi
echo "********************TEST1************************" >> $stdoutfname
./pmf --unittest 1 --ncpus=1 --debug=true >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 1 (Alternating least squares)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=1"| tee -a $stdoutfname
fi
echo "********************TEST2************************" >> $stdoutfname
./pmf --unittest 71 --ncpus=1 --debug=true >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 2 (Lanczos)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=71 (Lanczos)"| tee -a $stdoutfname
fi
echo "********************TEST4************************" >> $stdoutfname
./pmf --unittest 91 --ncpus=1 --debug=true >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 3 (Weighted ALS)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=91 (weighted alternating least squares)"| tee -a $stdoutfname
fi
echo "********************TEST5************************" >> $stdoutfname
./pmf --unittest 101 --ncpus=1 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 4 (CoSaMP)"| tee -a $stdoutfname
else
echo "FAIL --unittest=101 (CoSaMP)"| tee -a $stdoutfname
somefailed=1
fi
echo "********************TEST6************************" >> $stdoutfname
./pmf --unittest 131 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 5 (SVD)"| tee -a $stdoutfname
else
echo "FAIL --unittest=131 (SVD)"| tee -a $stdoutfname
somefailed=1
fi
popd > /dev/null
else
echo "PMF not found. "| tee -a $stdoutfname
fi
echo
echo "GraphLab clustring library"| tee -a $stdoutfname
if [ -f ../demoapps/clustering/glcluster ]; then
pushd . > /dev/null
cd ../demoapps/clustering
echo "---------CLUSTERING-------------" >> $stdoutfname
echo "---------CLUSTERING-------------" >> $stderrfname
echo "********************TEST1************************" >> $stdoutfname
./glcluster --unittest 1 $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 1 (Math functions)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=1 (Math functions)"| tee -a $stdoutfname
fi
echo "********************TEST2************************" >> $stdoutfname
./glcluster --unittest 2 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 2 (Distance functions)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=2 (Distance functions)"| tee -a $stdoutfname
fi
echo "********************TEST3************************" >> $stdoutfname
./glcluster --unittest 4 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 3 (Floating point math functions)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=3 (Floating point math functions)"| tee -a $stdoutfname
fi
popd > /dev/null
else
echo "Clustering library not found. "| tee -a $stdoutfname
fi
echo | tee -a $stdoutfname
echo "GraphLab Linear Solvers Library"| tee -a $stdoutfname
if [ -f ../demoapps/gabp/gabp ]; then
pushd . > /dev/null
cd ../demoapps/gabp
echo "---------GABP-------------" >> $stdoutfname
echo "********************TEST1************************" >> $stdoutfname
./gabp --unittest=1 --ncpus=1 --debug=true >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 1 (GaBP non-square)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=1 (GabP non-square)"| tee -a $stdoutfname
fi
echo "********************TEST2************************" >> $stdoutfname
./gabp --unittest=2 --ncpus=1 --debug=true >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 2 (GaBP square)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest 2 (GaBP square)" | tee -a $stdoutfname
fi
echo "********************TEST3************************" >> $stdoutfname
./gabp --unittest=3 --ncpus=1 --debug=true >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 3 (Jacobi)"| tee -a $stdoutfname
else
somefailed=1
echo "FAIL --unittest=3 (Jacobi)"| tee -a $stdoutfname
fi
echo "********************TEST4************************" >> $stdoutfname
./gabp --unittest=4 --ncpus=1 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 4 (Conjugate Gradient - square)"| tee -a $stdoutfname
else
echo "FAIL --unittest=4 (Conjugate Gradient - square)"| tee -a $stdoutfname
somefailed=1
fi
echo "********************TEST5************************" >> $stdoutfname
./gabp --unittest=5 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 5 (Conjugate Gradient - non square)"| tee -a $stdoutfname
else
echo "FAIL --unittest=5 (Conjugate Gradient- non square)"| tee -a $stdoutfname
somefailed=1
fi
echo "********************TEST6************************" >> $stdoutfname
./gabp --unittest=51 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 6 (Conjugate Gradient, matrix market format)"| tee -a $stdoutfname
else
echo "FAIL --unittest=6 (Conjugate Gradient- matrix market)"| tee -a $stdoutfname
somefailed=1
fi
echo "********************TEST7************************" >> $stdoutfname
./gabp --unittest=21 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 7 (GaBP, matrix market format, square, regularization)"| tee -a $stdoutfname
else
echo "FAIL --unittest=7 (gaBP, matrix market format, square, regularization)"| tee -a $stdoutfname
somefailed=1
fi
echo "********************TEST8************************" >> $stdoutfname
./gabp --unittest=22 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 8 (Jacobi, matrix market format, symmetric)"| tee -a $stdoutfname
else
echo "FAIL --unittest=8 (Jacobi, matrix market format, symmetric)"| tee -a $stdoutfname
somefailed=1
fi
echo "********************TEST9************************" >> $stdoutfname
./gabp --unittest=23 >> $stdoutfname 2>& 1
if [ $? -eq 0 ]; then
echo "PASS TEST 9 (Conjugate Gradient, matrix market format, symmetric)"| tee -a $stdoutfname
else
echo "FAIL --unittest=9 (Conjugate Gradient, matrix market, symmetric)"| tee -a $stdoutfname
somefailed=1
fi
popd > /dev/null
else
echo "Linear solver library not found. "| tee -a $stdoutfname
fi
echo
if [ $somefailed == 1 ]; then
echo "**** FAILURE LOG **************" >> $stdoutfname
cat $stderrfname >> $stdoutfname
echo "**** CONFIGURE.DEPS **************" >> $stdoutfname
cat ../../configure.deps >> $stdoutfname
echo "**** CONFIG.LOG **************" >> $stdoutfname
cat ../../config.log >> $stdoutfname
echo "**** SYSTEM STATS **************" >> $stdoutfname
echo `date` >> $stdoutfname
echo `uname -a` >> $stdoutfname
echo `echo $USER` >> $stdoutfname
echo "Some of the tests failed".
echo "Please email stdout.log to danny.bickson@gmail.com"
echo "Thanks for helping improve GraphLab!"
fi
if [ -f ../demoapps/demo/demo ]; then
pushd . > /dev/null
cd ../demoapps/demo
echo "Demo..."
echo "---------demo-------------" >> $stdoutfname
echo "---------demo-------------" >> $stderrfname
./demo >> $stdoutfname 2>> $stderrfname
quit_if_bad_retvalue
popd > /dev/null
else
echo "demo not found. "
fi
echo
echo "RPC Tests"
echo "========="
echo "Testing for availability of an MPI daemon"
localhostname=`hostname`
mpdtrace
if [ $? -eq 0 ]; then
echo "MPI available"
else
echo "MPI not available. Distributed/RPC tests not running."
exit 1
fi
test_rpc_prog rpc_example1 "5 plus 1 is : 6\\|11 plus 1 is : 12"
test_rpc_prog rpc_example2 "hello world!\\|1, 2, 1,"
test_rpc_prog rpc_example3 "1.a = 10\\|10.b = 0\\|string = hello world!"
test_rpc_prog rpc_example4 "1.a = 10\\|10.b = 0\\|string = hello world!"
test_rpc_prog rpc_example5 "1 + 2.000000 = three"
test_rpc_prog rpc_example6 "10\\|15\\|hello world\\|10.5\\|10"
test_rpc_prog rpc_example7 "set from 1\\|set from 1\\|set from 0\\|set from 0\\|set from 1\\|set from 1\\|set from 0\\|set from 0"
echo
echo "Distributed GraphLab Tests"
echo "=========================="
echo "Testing Distributed disk graph construction..."
echo "---------distributed_dg_construction_test-------------" >> $stdoutfname
echo "---------distributed_dg_construction_test-------------" >> $stderrfname
mpiexec -n 2 -host $localhostname ./distributed_dg_construction_test >> $stdoutfname 2>> $stderrfname
quit_if_bad_retvalue
rm -f dg*
echo "Testing Distributed Graph ..."
echo "---------distributed_graph_test-------------" >> $stdoutfname
echo "---------distributed_graph_test-------------" >> $stderrfname
./distributed_graph_test -g
mpiexec -n 2 -host $localhostname ./distributed_graph_test -b >> $stdoutfname 2>> $stderrfname
quit_if_bad_retvalue
rm -f dg*