blob: 493163852a361def377dbb394f554f9b1a48fb42 [file] [log] [blame]
bart8785c122008-05-29 08:34:27 +00001#!/bin/bash
2
3########################
4# Function definitions #
5########################
6
bartf33ce892008-06-07 11:40:14 +00007source "$(dirname $0)/measurement-functions"
bart8785c122008-05-29 08:34:27 +00008
9function run_test {
bartf16de382008-06-18 08:47:06 +000010 local tmp avg1 stddev1 avg2 stddev2 avg4 stddev4 p
bart8785c122008-05-29 08:34:27 +000011
12 tmp="/tmp/test-timing.$$"
bart334db5e2008-06-05 10:14:53 +000013 rm -f "${tmp}"
14
bartcf801352008-06-15 09:13:28 +000015 test_output="${1}.out" measure_runtime "$@" -p1 | avgstddev > "$tmp"
bart8785c122008-05-29 08:34:27 +000016 read avg1 stddev1 < "$tmp"
17 echo "Average time: ${avg1} +/- ${stddev1} seconds"
18
bartcf801352008-06-15 09:13:28 +000019 test_output="${1}.out" measure_runtime "$@" -p2 | avgstddev > "$tmp"
bartf16de382008-06-18 08:47:06 +000020 read avg2 stddev2 < "$tmp"
21 echo "Average time: ${avg2} +/- ${stddev2} seconds"
bart0d4e5c22008-06-07 10:42:52 +000022
bartcf801352008-06-15 09:13:28 +000023 test_output="${1}.out" measure_runtime "$@" -p4 | avgstddev > "$tmp"
bartf16de382008-06-18 08:47:06 +000024 read avg4 stddev4 < "$tmp"
25 echo "Average time: ${avg4} +/- ${stddev4} seconds"
bartd1763bc2008-06-08 14:44:41 +000026
bartf16de382008-06-18 08:47:06 +000027 test_output="/dev/null" \
28 print_runtime_ratio ${avg1} ${stddev1} $VG --tool=none "$@" -p1
29
30 test_output="/dev/null" \
31 print_runtime_ratio ${avg4} ${stddev4} $VG --tool=none "$@" -p4
barta9952832008-06-17 14:20:26 +000032
bartcf801352008-06-15 09:13:28 +000033 test_output="${1}-drd-with-stack-var-${p}.out" \
bartf16de382008-06-18 08:47:06 +000034 print_runtime_ratio ${avg4} ${stddev4} \
35 $VG --tool=exp-drd --check-stack-var=yes "$@" -p$p
bartcf801352008-06-15 09:13:28 +000036
37 test_output="${1}-drd-without-stack-var-${p}.out" \
bartf16de382008-06-18 08:47:06 +000038 print_runtime_ratio ${avg4} ${stddev4} \
39 $VG --tool=exp-drd --check-stack-var=no "$@" -p$p
bartcf801352008-06-15 09:13:28 +000040
41 test_output="${1}-helgrind-${p}.out" \
bartf16de382008-06-18 08:47:06 +000042 print_runtime_ratio ${avg4} ${stddev4} $VG --tool=helgrind "$@" -p$p
bart8785c122008-05-29 08:34:27 +000043
44 echo ''
45
46 rm -f "$tmp"
47}
48
49
bart9cdd1782008-06-08 11:22:23 +000050########################
51# Script body #
52########################
bart8785c122008-05-29 08:34:27 +000053
bart32811502008-06-03 15:12:59 +000054DRD_SCRIPTS_DIR="$(dirname $0)"
bart7acf3802008-06-06 10:17:26 +000055if [ "${DRD_SCRIPTS_DIR:0:1}" != "/" ]; then
56 DRD_SCRIPTS_DIR="$PWD/$DRD_SCRIPTS_DIR"
bart32811502008-06-03 15:12:59 +000057fi
58
59SPLASH2="${DRD_SCRIPTS_DIR}/../splash2"
bartc4a174f2008-06-03 11:41:19 +000060if [ ! -e "${SPLASH2}" ]; then
61 echo "Error: splash2 directory not found (${SPLASH2})."
bart8785c122008-05-29 08:34:27 +000062 exit 1
63fi
64
65if [ "$VG" = "" ]; then
bart32811502008-06-03 15:12:59 +000066 VG="${DRD_SCRIPTS_DIR}/../../vg-in-place"
bart8785c122008-05-29 08:34:27 +000067fi
68
69if [ ! -e "$VG" ]; then
70 echo "Could not find $VG."
71 exit 1
72fi
73
bartd7e6ba72008-06-17 15:00:55 +000074###############################################################################
75# Results: native native none none DRD DRD HG ITC ITC
76# -p1 -p2 -p4 -p1 -p4 -p4 -p4+f -p4 -p4 -p4+f
77# .............................................................................
78# Cholesky 0.29 0.21 4.46 8.5 0.7 5 4 2 239 82
79# FFT 0.19 0.12 0.12 5.2 8.5 82 54 4237 90 41
80# LU, contiguous 0.76 0.47 0.47 7.7 12.8 66 61 155 428 128
81# LU, non-contiguous 0.80 0.45 0.48 7.4 13.1 88 86 102 428 128
82# Ocean, contiguous 19.45 12.59 12.65 2.7 4.1 57 49 86 90 28
83# Ocean, non-contiguous 0.30 0.18 0.19 4.4 7.3 39 46 85 90 28
84# Radiosity 3.14 3.11 3.11 16.4 16.4 164 60 58 485 163
85# Radix 4.07 2.12 2.12 5.7 10.9 30 27 147 222 56
86# Raytrace 2.22 2.19 2.20 7.8 7.9 166 55 93 172 53
87# Water-n2 0.18 0.17 0.17 11.4 11.5 126 34 52 189 39
88# Water-sp 0.19 0.18 0.18 10.4 10.2 96 34 51 183 34
89# .............................................................................
bartb08ca702008-06-12 13:50:40 +000090# Hardware: dual-core Intel Xeon 5130, 2.0 GHz, 4 MB L2 cache, 4 GB RAM.
91# Software: Ubuntu 7.10 server, 64-bit, gcc 4.3.1, xload -update 1 running.
bartd7e6ba72008-06-17 15:00:55 +000092###############################################################################
barta9952832008-06-17 14:20:26 +000093# Results: native native DRD DRD HG ITC ITC
bartd032b532008-06-16 20:23:23 +000094# -p1 -p2 -p4 -p4 -p4, f -p4 -p4 -p4, f
bartd7e6ba72008-06-17 15:00:55 +000095# .............................................................................
bartd032b532008-06-16 20:23:23 +000096# Cholesky 0.21 0.14 4.49 4 3 2 239 82
barta9952832008-06-17 14:20:26 +000097# FFT - 1 0.11 0.08 0.07 138 66 380 90 41
bartd032b532008-06-16 20:23:23 +000098# LU, contiguous 0.56 0.34 0.34 72 68 96 428 128
99# LU, non-contiguous 0.59 0.32 0.35 92 109 60 428 128
100# Ocean, contiguous 14.30 9.54 9.56 61 48 89 90 28
101# Ocean, non-contiguous 0.20 0.12 0.12 45 51 93 90 28
102# Radiosity 2.33 2.32 2.33 175 61 60 485 163
103# Radix 2.81 1.45 1.46 32 29 153 222 56
104# Raytrace 1.65 1.64 1.64 230 55 89 172 53
105# Water-n2 0.14 0.12 0.12 129 35 55 189 39
106# Water-sp 0.14 0.12 0.12 121 36 54 183 34
bartd7e6ba72008-06-17 15:00:55 +0000107# .............................................................................
bartcf801352008-06-15 09:13:28 +0000108# Hardware: dual-core Intel Core2 Duo E6750, 2.66 GHz, 4 MB L2 cache, 2 GB RAM.
109# Software: openSUSE 10.3, 64-bit, gcc 4.3.1, runlevel 5, X screensaver: blank
bartd7e6ba72008-06-17 15:00:55 +0000110###############################################################################
bart8785c122008-05-29 08:34:27 +0000111
bart66bb75c2008-06-17 06:19:29 +0000112cache_size=$(get_cache_size)
bart32811502008-06-03 15:12:59 +0000113log2_cache_size=$(log2 ${cache_size})
114
115# Cholesky
bart32811502008-06-03 15:12:59 +0000116(
bart868d73a2008-06-04 13:02:22 +0000117 cd ${SPLASH2}/codes/kernels/cholesky/inputs
118 for f in *Z
119 do
120 gzip -cd <$f >${f%.Z}
121 done
barta9952832008-06-17 14:20:26 +0000122 run_test ../CHOLESKY -C$((cache_size)) tk29.O
bart32811502008-06-03 15:12:59 +0000123)
bart32811502008-06-03 15:12:59 +0000124
125# FFT
barta9952832008-06-17 14:20:26 +0000126run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size)) -m18
bart32811502008-06-03 15:12:59 +0000127
128# LU, contiguous blocks.
bartc4a174f2008-06-03 11:41:19 +0000129run_test ${SPLASH2}/codes/kernels/lu/contiguous_blocks/LU -n1024
bart8785c122008-05-29 08:34:27 +0000130
bart32811502008-06-03 15:12:59 +0000131# LU, non-contiguous blocks.
bartc4a174f2008-06-03 11:41:19 +0000132run_test ${SPLASH2}/codes/kernels/lu/non_contiguous_blocks/LU -n1024
bart8785c122008-05-29 08:34:27 +0000133
bart868d73a2008-06-04 13:02:22 +0000134# Ocean
135run_test ${SPLASH2}/codes/apps/ocean/contiguous_partitions/OCEAN -n2050
136run_test ${SPLASH2}/codes/apps/ocean/non_contiguous_partitions/OCEAN -n258
137
bart32811502008-06-03 15:12:59 +0000138# Radiosity.
bartc4a174f2008-06-03 11:41:19 +0000139run_test ${SPLASH2}/codes/apps/radiosity/RADIOSITY -batch -room
140
bart868d73a2008-06-04 13:02:22 +0000141# Radix
142run_test ${SPLASH2}/codes/kernels/radix/RADIX -n$((2**24))
143
144# Raytrace
145(
146 cd ${SPLASH2}/codes/apps/raytrace/inputs
147 rm -f *.env *.geo *.rl
148 for f in *Z
149 do
150 gzip -cd <$f >${f%.Z}
151 done
152 run_test ../RAYTRACE balls4.env
153)
bart334db5e2008-06-05 10:14:53 +0000154
bart868d73a2008-06-04 13:02:22 +0000155# Water-n2
bart334db5e2008-06-05 10:14:53 +0000156(
157 cd ${SPLASH2}/codes/apps/water-nsquared
158 test_input=input run_test ./WATER-NSQUARED
159)
bart868d73a2008-06-04 13:02:22 +0000160
161# Water-sp
bart334db5e2008-06-05 10:14:53 +0000162(
163 cd ${SPLASH2}/codes/apps/water-spatial
164 test_input=input run_test ./WATER-SPATIAL
165)
bart868d73a2008-06-04 13:02:22 +0000166
167
bartc4a174f2008-06-03 11:41:19 +0000168
169# Local variables:
170# compile-command: "./run-splash2"
171# End: