bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | ######################## |
| 4 | # Function definitions # |
| 5 | ######################## |
| 6 | |
bart | f33ce89 | 2008-06-07 11:40:14 +0000 | [diff] [blame] | 7 | source "$(dirname $0)/measurement-functions" |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 8 | |
| 9 | function run_test { |
bart | ee17ad6 | 2008-06-18 13:31:05 +0000 | [diff] [blame^] | 10 | local tmp avg1 stddev1 avg2 stddev2 avg4 stddev4 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 11 | |
| 12 | tmp="/tmp/test-timing.$$" |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 13 | rm -f "${tmp}" |
| 14 | |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 15 | test_output="${1}.out" measure_runtime "$@" -p1 | avgstddev > "$tmp" |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 16 | read avg1 stddev1 < "$tmp" |
| 17 | echo "Average time: ${avg1} +/- ${stddev1} seconds" |
| 18 | |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 19 | test_output="${1}.out" measure_runtime "$@" -p2 | avgstddev > "$tmp" |
bart | f16de38 | 2008-06-18 08:47:06 +0000 | [diff] [blame] | 20 | read avg2 stddev2 < "$tmp" |
| 21 | echo "Average time: ${avg2} +/- ${stddev2} seconds" |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 22 | |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 23 | test_output="${1}.out" measure_runtime "$@" -p4 | avgstddev > "$tmp" |
bart | f16de38 | 2008-06-18 08:47:06 +0000 | [diff] [blame] | 24 | read avg4 stddev4 < "$tmp" |
| 25 | echo "Average time: ${avg4} +/- ${stddev4} seconds" |
bart | d1763bc | 2008-06-08 14:44:41 +0000 | [diff] [blame] | 26 | |
bart | f16de38 | 2008-06-18 08:47:06 +0000 | [diff] [blame] | 27 | 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 |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 32 | |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 33 | test_output="${1}-drd-with-stack-var-${p}.out" \ |
bart | f16de38 | 2008-06-18 08:47:06 +0000 | [diff] [blame] | 34 | print_runtime_ratio ${avg4} ${stddev4} \ |
bart | ee17ad6 | 2008-06-18 13:31:05 +0000 | [diff] [blame^] | 35 | $VG --tool=exp-drd --check-stack-var=yes "$@" -p4 |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 36 | |
| 37 | test_output="${1}-drd-without-stack-var-${p}.out" \ |
bart | f16de38 | 2008-06-18 08:47:06 +0000 | [diff] [blame] | 38 | print_runtime_ratio ${avg4} ${stddev4} \ |
bart | ee17ad6 | 2008-06-18 13:31:05 +0000 | [diff] [blame^] | 39 | $VG --tool=exp-drd --check-stack-var=no "$@" -p4 |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 40 | |
| 41 | test_output="${1}-helgrind-${p}.out" \ |
bart | ee17ad6 | 2008-06-18 13:31:05 +0000 | [diff] [blame^] | 42 | print_runtime_ratio ${avg4} ${stddev4} $VG --tool=helgrind "$@" -p4 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 43 | |
| 44 | echo '' |
| 45 | |
| 46 | rm -f "$tmp" |
| 47 | } |
| 48 | |
| 49 | |
bart | 9cdd178 | 2008-06-08 11:22:23 +0000 | [diff] [blame] | 50 | ######################## |
| 51 | # Script body # |
| 52 | ######################## |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 53 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 54 | DRD_SCRIPTS_DIR="$(dirname $0)" |
bart | 7acf380 | 2008-06-06 10:17:26 +0000 | [diff] [blame] | 55 | if [ "${DRD_SCRIPTS_DIR:0:1}" != "/" ]; then |
| 56 | DRD_SCRIPTS_DIR="$PWD/$DRD_SCRIPTS_DIR" |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 57 | fi |
| 58 | |
| 59 | SPLASH2="${DRD_SCRIPTS_DIR}/../splash2" |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 60 | if [ ! -e "${SPLASH2}" ]; then |
| 61 | echo "Error: splash2 directory not found (${SPLASH2})." |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 62 | exit 1 |
| 63 | fi |
| 64 | |
| 65 | if [ "$VG" = "" ]; then |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 66 | VG="${DRD_SCRIPTS_DIR}/../../vg-in-place" |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 67 | fi |
| 68 | |
| 69 | if [ ! -e "$VG" ]; then |
| 70 | echo "Could not find $VG." |
| 71 | exit 1 |
| 72 | fi |
| 73 | |
bart | ee17ad6 | 2008-06-18 13:31:05 +0000 | [diff] [blame^] | 74 | ###################################################################################################################### |
| 75 | # Results: native 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.37 ..... 0.25 ..... 0.20 ..... 8.3 .... 17.3 .... 173 .... 118 .... 57 .... 239 82 |
| 79 | # FFT 0.23 ..... 0.14 ..... 0.10 ..... 7.5 .... 16.2 .... 119 .... 80 .... 2336 .... 90 41 |
| 80 | # LU, contiguous 0.95 ..... 0.64 ..... 0.43 ..... 7.9 .... 18.0 .... 119 .... 113 .... 223 .... 428 128 |
| 81 | # LU, non-contiguous 1.18 ..... 0.69 ..... 0.41 ..... 6.7 .... 19.5 .... 204 .... 187 .... 164 .... 428 128 |
| 82 | # Ocean, contiguous 24.53 ..... 13.97 ..... 9.28 ..... 2.4 .... 6.5 .... 89 .... 76 .... 147 .... 90 28 |
| 83 | # Ocean, non-contiguous 0.36 ..... 0.19 ..... 0.17 ..... 4.2 .... 10.0 .... 56 .... 68 .... 121 .... 90 28 |
| 84 | # Radiosity 4.77 ..... 4.77 ..... 4.75 ..... 16.6 .... 16.6 .... 116 .... .. .... .. .... 485 163 |
| 85 | # Radix .... ..... .... ..... .... ..... ... .... .... .... .. .... .. .... ... .... 222 56 |
| 86 | # Raytrace .... ..... .... ..... .... ..... ... .... ... .... ... .... .. .... .. .... 172 53 |
| 87 | # Water-n2 .... ..... .... ..... .... ..... .... .... .... .... ... .... .. .... .. .... 189 39 |
| 88 | # Water-sp .... ..... .... ..... .... ..... .... .... .... .... .. .... .. .... .. .... 183 34 |
| 89 | # .................................................................................................................... |
| 90 | # Hardware: Two quad-core Intel Xeon L5130, 1.6 GHz, 4 MB L2 cache, 16 GB RAM. |
| 91 | # Software: Ubuntu 8.04 server, 64-bit, gcc 4.3.1. |
| 92 | ###################################################################################################################### |
| 93 | # Results: native native native none none DRD DRD HG ITC ITC |
| 94 | # -p1 -p2 -p4 -p1 -p4 -p4 -p4+f -p4 -p4 -p4+f |
| 95 | # .................................................................................................................... |
| 96 | # Cholesky 0.29 10968 0.21 63669 4.60 70621 8.6 2.21 1.0 1.75 5 2.05 4 2.16 2 3.22 239 82 |
| 97 | # FFT 0.19 ..... 0.12 ..... 0.12 ..... 7.0 1.01 11.3 1.01 87 1.02 59 1.02 .... .... 90 41 |
| 98 | # LU, contiguous 0.79 ..... 0.54 ..... 0.53 ..... 8.3 4.27 11.7 2.33 79 .... 75 .... 148 .... 428 128 |
| 99 | # LU, non-contiguous 0.86 ..... 0.47 ..... 0.49 ..... 7.5 .... 12.6 .... 136 .... 124 .... 109 .... 428 128 |
| 100 | # Ocean, contiguous 19.46 ..... 12.59 ..... 12.61 ..... 2.4 .... 3.7 .... 53 .... 47 .... 86 .... 90 28 |
| 101 | # Ocean, non-contiguous 0.30 ..... 0.19 ..... 0.19 ..... 4.0 .... 6.8 .... 38 .... 47 .... 84 .... 90 28 |
| 102 | # Radiosity 3.86 ..... 3.84 ..... 3.84 ..... 16.3 .... 16.4 .... ... .... .. .... .. .... 485 163 |
| 103 | # Radix 4.07 ..... 2.12 ..... 2.12 ..... 5.7 .... 10.9 .... .. .... .. .... ... .... 222 56 |
| 104 | # Raytrace 2.22 ..... 2.19 ..... 2.20 ..... 7.8 .... 7.9 .... ... .... .. .... .. .... 172 53 |
| 105 | # Water-n2 0.18 ..... 0.17 ..... 0.17 ..... 11.4 .... 11.5 .... ... .... .. .... .. .... 189 39 |
| 106 | # Water-sp 0.19 ..... 0.18 ..... 0.18 ..... 10.4 .... 10.2 .... .. .... .. .... .. .... 183 34 |
| 107 | # .................................................................................................................... |
bart | b08ca70 | 2008-06-12 13:50:40 +0000 | [diff] [blame] | 108 | # Hardware: dual-core Intel Xeon 5130, 2.0 GHz, 4 MB L2 cache, 4 GB RAM. |
| 109 | # Software: Ubuntu 7.10 server, 64-bit, gcc 4.3.1, xload -update 1 running. |
bart | ee17ad6 | 2008-06-18 13:31:05 +0000 | [diff] [blame^] | 110 | ###################################################################################################################### |
| 111 | # Results: native native native none none DRD DRD HG ITC ITC |
| 112 | # -p1 -p2 -p4 -p1 -p4 -p4 -p4+f -p4 -p4 -p4+f |
| 113 | # .................................................................................................................... |
| 114 | # Cholesky 0.21 ..... 0.14 ..... 4.49 ..... .... .... .... .... 4 .... 3 .... 2 .... 239 82 |
| 115 | # FFT 0.11 ..... 0.08 ..... 0.07 ..... .... .... .... .... 138 .... 66 .... 380 .... 90 41 |
| 116 | # LU, contiguous 0.56 ..... 0.34 ..... 0.34 ..... .... .... .... .... 72 .... 68 .... 96 .... 428 128 |
| 117 | # LU, non-contiguous 0.59 ..... 0.32 ..... 0.35 ..... .... .... .... .... 92 .... 109 .... 60 .... 428 128 |
| 118 | # Ocean, contiguous 14.30 ..... 9.54 ..... 9.56 ..... .... .... .... .... 61 .... 48 .... 89 .... 90 28 |
| 119 | # Ocean, non-contiguous 0.20 ..... 0.12 ..... 0.12 ..... .... .... .... .... 45 .... 51 .... 93 .... 90 28 |
| 120 | # Radiosity 2.33 ..... 2.32 ..... 2.33 ..... .... .... .... .... 175 .... 61 .... 60 .... 485 163 |
| 121 | # Radix 2.81 ..... 1.45 ..... 1.46 ..... .... .... .... .... 32 .... 29 .... 153 .... 222 56 |
| 122 | # Raytrace 1.65 ..... 1.64 ..... 1.64 ..... .... .... .... .... 230 .... 55 .... 89 .... 172 53 |
| 123 | # Water-n2 0.14 ..... 0.12 ..... 0.12 ..... .... .... .... .... 129 .... 35 .... 55 .... 189 39 |
| 124 | # Water-sp 0.14 ..... 0.12 ..... 0.12 ..... .... .... .... .... 121 .... 36 .... 54 .... 183 34 |
| 125 | # .................................................................................................................... |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 126 | # Hardware: dual-core Intel Core2 Duo E6750, 2.66 GHz, 4 MB L2 cache, 2 GB RAM. |
| 127 | # Software: openSUSE 10.3, 64-bit, gcc 4.3.1, runlevel 5, X screensaver: blank |
bart | ee17ad6 | 2008-06-18 13:31:05 +0000 | [diff] [blame^] | 128 | ###################################################################################################################### |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 129 | |
bart | 66bb75c | 2008-06-17 06:19:29 +0000 | [diff] [blame] | 130 | cache_size=$(get_cache_size) |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 131 | log2_cache_size=$(log2 ${cache_size}) |
| 132 | |
| 133 | # Cholesky |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 134 | ( |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 135 | cd ${SPLASH2}/codes/kernels/cholesky/inputs |
| 136 | for f in *Z |
| 137 | do |
| 138 | gzip -cd <$f >${f%.Z} |
| 139 | done |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 140 | run_test ../CHOLESKY -C$((cache_size)) tk29.O |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 141 | ) |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 142 | |
| 143 | # FFT |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 144 | run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size)) -m18 |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 145 | |
| 146 | # LU, contiguous blocks. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 147 | run_test ${SPLASH2}/codes/kernels/lu/contiguous_blocks/LU -n1024 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 148 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 149 | # LU, non-contiguous blocks. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 150 | run_test ${SPLASH2}/codes/kernels/lu/non_contiguous_blocks/LU -n1024 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 151 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 152 | # Ocean |
| 153 | run_test ${SPLASH2}/codes/apps/ocean/contiguous_partitions/OCEAN -n2050 |
| 154 | run_test ${SPLASH2}/codes/apps/ocean/non_contiguous_partitions/OCEAN -n258 |
| 155 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 156 | # Radiosity. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 157 | run_test ${SPLASH2}/codes/apps/radiosity/RADIOSITY -batch -room |
| 158 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 159 | # Radix |
| 160 | run_test ${SPLASH2}/codes/kernels/radix/RADIX -n$((2**24)) |
| 161 | |
| 162 | # Raytrace |
| 163 | ( |
| 164 | cd ${SPLASH2}/codes/apps/raytrace/inputs |
| 165 | rm -f *.env *.geo *.rl |
| 166 | for f in *Z |
| 167 | do |
| 168 | gzip -cd <$f >${f%.Z} |
| 169 | done |
| 170 | run_test ../RAYTRACE balls4.env |
| 171 | ) |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 172 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 173 | # Water-n2 |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 174 | ( |
| 175 | cd ${SPLASH2}/codes/apps/water-nsquared |
| 176 | test_input=input run_test ./WATER-NSQUARED |
| 177 | ) |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 178 | |
| 179 | # Water-sp |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 180 | ( |
| 181 | cd ${SPLASH2}/codes/apps/water-spatial |
| 182 | test_input=input run_test ./WATER-SPATIAL |
| 183 | ) |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 184 | |
| 185 | |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 186 | |
| 187 | # Local variables: |
| 188 | # compile-command: "./run-splash2" |
| 189 | # End: |