blob: e691fde8033d1071a0555e497dac7d575d63683f [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 {
bartcf801352008-06-15 09:13:28 +000010 local tmp avg1=1 stddev1=1 avg2=1 stddev2=1 p=4
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"
20 read avg1 stddev1 < "$tmp"
21 echo "Average time: ${avg1} +/- ${stddev1} seconds"
bart0d4e5c22008-06-07 10:42:52 +000022
bartcf801352008-06-15 09:13:28 +000023 test_output="${1}.out" measure_runtime "$@" -p4 | avgstddev > "$tmp"
24 read avg1 stddev1 < "$tmp"
25 echo "Average time: ${avg1} +/- ${stddev1} seconds"
bartd1763bc2008-06-08 14:44:41 +000026
bartcf801352008-06-15 09:13:28 +000027 test_output="${1}-drd-with-stack-var-${p}.out" \
28 print_runtime_ratio $VG --tool=exp-drd --check-stack-var=yes "$@" -p$p
29
30 test_output="${1}-drd-without-stack-var-${p}.out" \
31 print_runtime_ratio $VG --tool=exp-drd --check-stack-var=no "$@" -p$p
32
33 test_output="${1}-helgrind-${p}.out" \
34 print_runtime_ratio $VG --tool=helgrind "$@" -p$p
bart8785c122008-05-29 08:34:27 +000035
36 echo ''
37
38 rm -f "$tmp"
39}
40
41
bart9cdd1782008-06-08 11:22:23 +000042########################
43# Script body #
44########################
bart8785c122008-05-29 08:34:27 +000045
bart32811502008-06-03 15:12:59 +000046DRD_SCRIPTS_DIR="$(dirname $0)"
bart7acf3802008-06-06 10:17:26 +000047if [ "${DRD_SCRIPTS_DIR:0:1}" != "/" ]; then
48 DRD_SCRIPTS_DIR="$PWD/$DRD_SCRIPTS_DIR"
bart32811502008-06-03 15:12:59 +000049fi
50
51SPLASH2="${DRD_SCRIPTS_DIR}/../splash2"
bartc4a174f2008-06-03 11:41:19 +000052if [ ! -e "${SPLASH2}" ]; then
53 echo "Error: splash2 directory not found (${SPLASH2})."
bart8785c122008-05-29 08:34:27 +000054 exit 1
55fi
56
57if [ "$VG" = "" ]; then
bart32811502008-06-03 15:12:59 +000058 VG="${DRD_SCRIPTS_DIR}/../../vg-in-place"
bart8785c122008-05-29 08:34:27 +000059fi
60
61if [ ! -e "$VG" ]; then
62 echo "Could not find $VG."
63 exit 1
64fi
65
bart0d4e5c22008-06-07 10:42:52 +000066##############################################################################
bart66bb75c2008-06-17 06:19:29 +000067# Results: native DRD DRD HG ITC ITC
68# -p1 -p2 -p4 -p4 -p4, f -p4 -p4 -p4, f
bart0d4e5c22008-06-07 10:42:52 +000069# ............................................................................
bart66bb75c2008-06-17 06:19:29 +000070# Cholesky 0.29 0.21 4.51 5 4 2 239 82
71# FFT 0.20 0.12 0.12 82 54 963 90 41
72# LU, contiguous 0.76 0.47 0.47 66 62 155 428 128
73# LU, non-contiguous 0.80 0.45 0.48 85 82 102 428 128
74# Ocean, contiguous 19.46 12.62 12.74 57 49 86 90 28
75# Ocean, non-contiguous 0.18 0.19 7.49 40 47 85 90 28
76# Radiosity 3.14 3.11 3.11 164 60 58 485 163
77# Radix 4.07 2.13 2.15 29 27 147 222 56
78# Raytrace 2.22 2.20 2.20 168 54 93 172 53
79# Water-n2 0.18 0.17 0.17 127 35 52 189 39
80# Water-sp 0.19 0.18 0.18 99 35 51 183 34
bartb08ca702008-06-12 13:50:40 +000081# ............................................................................
82# Hardware: dual-core Intel Xeon 5130, 2.0 GHz, 4 MB L2 cache, 4 GB RAM.
83# Software: Ubuntu 7.10 server, 64-bit, gcc 4.3.1, xload -update 1 running.
bart0d4e5c22008-06-07 10:42:52 +000084##############################################################################
bartd032b532008-06-16 20:23:23 +000085# Results: native DRD DRD HG ITC ITC
86# -p1 -p2 -p4 -p4 -p4, f -p4 -p4 -p4, f
bart0d4e5c22008-06-07 10:42:52 +000087# ............................................................................
bartd032b532008-06-16 20:23:23 +000088# Cholesky 0.21 0.14 4.49 4 3 2 239 82
89# FFT 0.11 0.08 0.07 138 66 380 90 41
90# LU, contiguous 0.56 0.34 0.34 72 68 96 428 128
91# LU, non-contiguous 0.59 0.32 0.35 92 109 60 428 128
92# Ocean, contiguous 14.30 9.54 9.56 61 48 89 90 28
93# Ocean, non-contiguous 0.20 0.12 0.12 45 51 93 90 28
94# Radiosity 2.33 2.32 2.33 175 61 60 485 163
95# Radix 2.81 1.45 1.46 32 29 153 222 56
96# Raytrace 1.65 1.64 1.64 230 55 89 172 53
97# Water-n2 0.14 0.12 0.12 129 35 55 189 39
98# Water-sp 0.14 0.12 0.12 121 36 54 183 34
bartcf801352008-06-15 09:13:28 +000099# ............................................................................
100# Hardware: dual-core Intel Core2 Duo E6750, 2.66 GHz, 4 MB L2 cache, 2 GB RAM.
101# Software: openSUSE 10.3, 64-bit, gcc 4.3.1, runlevel 5, X screensaver: blank
102##############################################################################
bart8785c122008-05-29 08:34:27 +0000103
bart66bb75c2008-06-17 06:19:29 +0000104cache_size=$(get_cache_size)
bart32811502008-06-03 15:12:59 +0000105log2_cache_size=$(log2 ${cache_size})
106
107# Cholesky
bart32811502008-06-03 15:12:59 +0000108(
bart868d73a2008-06-04 13:02:22 +0000109 cd ${SPLASH2}/codes/kernels/cholesky/inputs
110 for f in *Z
111 do
112 gzip -cd <$f >${f%.Z}
113 done
bart66bb75c2008-06-17 06:19:29 +0000114 run_test ../CHOLESKY -C$((cache_size/2)) tk29.O
bart32811502008-06-03 15:12:59 +0000115)
bart32811502008-06-03 15:12:59 +0000116
117# FFT
bart66bb75c2008-06-17 06:19:29 +0000118run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size - 0)) -m18
119
120run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size - 1)) -m18
121
122run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size - 2)) -m18
123
124run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size - 3)) -m18
125
126run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size - 4)) -m18
127
128run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size - 5)) -m18
bart32811502008-06-03 15:12:59 +0000129
130# LU, contiguous blocks.
bartc4a174f2008-06-03 11:41:19 +0000131run_test ${SPLASH2}/codes/kernels/lu/contiguous_blocks/LU -n1024
bart8785c122008-05-29 08:34:27 +0000132
bart32811502008-06-03 15:12:59 +0000133# LU, non-contiguous blocks.
bartc4a174f2008-06-03 11:41:19 +0000134run_test ${SPLASH2}/codes/kernels/lu/non_contiguous_blocks/LU -n1024
bart8785c122008-05-29 08:34:27 +0000135
bart868d73a2008-06-04 13:02:22 +0000136# Ocean
137run_test ${SPLASH2}/codes/apps/ocean/contiguous_partitions/OCEAN -n2050
138run_test ${SPLASH2}/codes/apps/ocean/non_contiguous_partitions/OCEAN -n258
139
bart32811502008-06-03 15:12:59 +0000140# Radiosity.
bart66bb75c2008-06-17 06:19:29 +0000141run_test ${SPLASH2}/codes/apps/radiosity/RADIOSITY -batch
142
bartc4a174f2008-06-03 11:41:19 +0000143run_test ${SPLASH2}/codes/apps/radiosity/RADIOSITY -batch -room
144
bart868d73a2008-06-04 13:02:22 +0000145# Radix
146run_test ${SPLASH2}/codes/kernels/radix/RADIX -n$((2**24))
147
148# Raytrace
149(
150 cd ${SPLASH2}/codes/apps/raytrace/inputs
151 rm -f *.env *.geo *.rl
152 for f in *Z
153 do
154 gzip -cd <$f >${f%.Z}
155 done
156 run_test ../RAYTRACE balls4.env
157)
bart334db5e2008-06-05 10:14:53 +0000158
bart868d73a2008-06-04 13:02:22 +0000159# Water-n2
bart334db5e2008-06-05 10:14:53 +0000160(
161 cd ${SPLASH2}/codes/apps/water-nsquared
162 test_input=input run_test ./WATER-NSQUARED
163)
bart868d73a2008-06-04 13:02:22 +0000164
165# Water-sp
bart334db5e2008-06-05 10:14:53 +0000166(
167 cd ${SPLASH2}/codes/apps/water-spatial
168 test_input=input run_test ./WATER-SPATIAL
169)
bart868d73a2008-06-04 13:02:22 +0000170
171
bartc4a174f2008-06-03 11:41:19 +0000172
173# Local variables:
174# compile-command: "./run-splash2"
175# End: