Newer
Older
Tomáš Oberhuber
committed
#!/usr/bin/env bash
BASE="ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/"
MATRIX_SOLVERS_BENCHMARK="tnl-matrix-solvers-benchmark-dbg"
Tomáš Oberhuber
committed
STOP_TIME="1"
SOLVERS="gmres sor"
SOR_OMEGAS="0.4 0.8 1.2 1.6 2.0"
GMRES_RESTARTINGS="8 16 32 64 128 256"
Tomáš Oberhuber
committed
export CUDA_PROFILE=0
export CUDA_PROFILE_CONFIG="$TNL_SOURCE_DIR/tests/cuda-profiler.conf"
PROCESS_CUDA_PROFILE="$TNL_SOURCE_DIR/tests/process-cuda-profile.pl"
source ./matrix-market
source ./florida-matrix-market
Tomáš Oberhuber
committed
export TNL_SPARSE_MATRIX_CHECK_CFG_DESC_FILE="$TNL_SOURCE_DIR/tests/tnl-sparse-matrix-check.cfg.desc"
#MM_MATRICES=""
#FLORIDA_MM_MATRICES=""
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
benchmark_matrix()
# $1 input file
# $2 input mtx file
# $3 verbose
{
for solver in $SOLVERS;
do
echo "Testing with $solver solver."
if test x$solver == xsor;
then
for omega in $SOR_OMEGAS;
do
echo "Setting sor-omega to $omega"
logfile="$2.results.sor.omega-$omega.log"
if test ! -e $logfile;
then
$MATRIX_SOLVERS_BENCHMARK --input-file $1 \
--input-mtx-file $2 \
--solver-name $solver \
--sor-omega $omega \
--log-file $logfile \
--verbose $3
echo ""
else
echo "Test has already passed."
fi
done
fi
if test x$solver == xgmres;
then
for gmres_restarting in $GMRES_RESTARTINGS;
do
echo "Setting GMRES restarting to $gmres_restarting"
logfile="$2.results.gmres.restarting-$gmres_restarting.log"
if test ! -e $logfile;
then
$MATRIX_SOLVERS_BENCHMARK --input-file $1 \
--input-mtx-file $2 \
--solver-name $solver \
--gmres-restarting $gmres_restarting \
--log-file $logfile \
--verbose $3
echo ""
else
echo "Test has already passed."
fi
done
fi
done
}
write_log_header()
# $1 log file name
{
echo "<html>" > $1
echo " <body>" >> $1
echo " <table border=1>" >> $1
echo " <tr>" >> $1
echo " <td rowspan=4 colspan=3 align=center>Matrix</td>" >> $1
echo " <td rowspan=4 colspan=15 align=center>SOR</td>" >> $1
echo " <td rowspan=4 colspan=18 align=center>GMRES</td>" >> $1
echo " </tr>" >> $1
echo " <tr>" >> $1
echo " <td>Name</td>" >> $1 # Matrix description
echo " <td>Size</td>" >> $1
echo " <td>NonZeros No.</td>" >> $1
echo " <td colspan=3>0.4</td>" >> $1 # SOR Omegas
echo " <td colspan=3>0.8</td>" >> $1 # SOR Omegas
echo " <td colspan=3>1.2</td>" >> $1 # SOR Omegas
echo " <td colspan=3>1.6</td>" >> $1 # SOR Omegas
echo " <td colspan=3>2.0</td>" >> $1 # SOR Omegas
echo " <td colspan=3>8</td>" >> $1 # GMRES restartings
echo " <td colspan=3>16</td>" >> $1 # GMRES restartings
echo " <td colspan=3>32</td>" >> $1 # GMRES restartings
echo " <td colspan=3>64</td>" >> $1 # GMRES restartings
echo " <td colspan=3>128</td>" >> $1 # GMRES restartings
echo " <td colspan=3>256</td>" >> $1 # GMRES restartings
echo " </tr>" >> $1
echo " <tr>" >> $1
echo " <td>Residue</td>" >> $1 # SOR Results omega = 0.4
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # SOR Results omega = 0.8
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # SOR Results omega = 1.2
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # SOR Results omega = 1.6
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # SOR Results omega = 2.0
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # GMRES Results restarting 8
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # GMRES Results restarting 16
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # GMRES Results restarting 32
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # GMRES Results restarting 64
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # GMRES Results restarting 128
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " <td>Residue</td>" >> $1 # GMRES Results restarting 256
echo " <td>Iterations</td>" >> $1
echo " <td>CPU</td>" >> $1
echo " </tr>" >> $1
}
close_log()
# $1 log file name
{
echo " </table>" >> $1
echo " </body>" >> $1
echo "</html>" >> $1
}
write_log_header matrix-solvers-benchmark.log
Tomáš Oberhuber
committed
for link in $MM_MATRICES;
do
echo "###############################################################################################"
matrix=matrices`echo $link | sed 's/ftp:\/\/math.nist.gov\/pub//'`
unzipped_matrix=`echo $matrix | sed 's/.gz//'`
if test ! -e $matrix;
then
echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first."
#echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first." >> sparse-matrix-benchmark.log
else
if test ! -e $unzipped_matrix.double.bin.bz2;
then
echo "Missing $unzipped_matrix.double.bin.bz2 !!! Run the script 'convert-matrices'."
#echo "Missing $unzipped_matrix.double.bin.bz2 !!! Run the script 'convert-matrices'." >> sparse-matrix-benchmark.log
else
gunzip -f $matrix
echo "Checking with the matrix $unzipped_matrix in double precison ..."
export CUDA_PROFILE_LOG=$unzipped_matrix.double.log
benchmark_matrix $unzipped_matrix.double.bin.bz2 $unzipped_matrix 1
Tomáš Oberhuber
committed
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
gzip $unzipped_matrix
fi
fi
done
for link in $FLORIDA_MM_MATRICES;
do
matrix=matrices`echo $link | sed 's/http:\/\/www.cise.ufl.edu\/research\/sparse//'`
if test ! -e $matrix;
then
echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first."
#echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first." >> sparse-matrix-benchmark.log
else
DIRNAME=`dirname $matrix`
FILENAME=`basename $matrix`
cd $DIRNAME
tar zxvf $FILENAME
cd $IWD
SUBDIRNAME=`echo $FILENAME | sed 's/.tar.gz//'`
rm -f $DIRNAME/$SUBDIRNAME/*_b.mtx # these are usualy in array format
for file in $DIRNAME/$SUBDIRNAME/*.mtx;
do
echo "###############################################################################################"
if test ! -e $file.double.bin.bz2;
then
echo "Missing $file.double.bin.bz2 !!! Run the script 'convert-matrices'."
else
echo "Checking with the matrix $file ..."
benchmark_matrix $file.double.bin.bz2 $file 1
Tomáš Oberhuber
committed
fi
rm $file
done
fi
done
close_log matrix-solvers-benchmark.log