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 | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 10 | local tmp avg1=1 stddev1=1 avg2=1 stddev2=1 p=4 |
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 | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 19 | test_output="/dev/null" print_runtime_ratio $VG --tool=none "$@" -p1 |
| 20 | |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 21 | test_output="${1}.out" measure_runtime "$@" -p2 | avgstddev > "$tmp" |
| 22 | read avg1 stddev1 < "$tmp" |
| 23 | echo "Average time: ${avg1} +/- ${stddev1} seconds" |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 24 | |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 25 | test_output="${1}.out" measure_runtime "$@" -p4 | avgstddev > "$tmp" |
| 26 | read avg1 stddev1 < "$tmp" |
| 27 | echo "Average time: ${avg1} +/- ${stddev1} seconds" |
bart | d1763bc | 2008-06-08 14:44:41 +0000 | [diff] [blame] | 28 | |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 29 | test_output="/dev/null" print_runtime_ratio $VG --tool=none "$@" -p4 |
| 30 | |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 31 | test_output="${1}-drd-with-stack-var-${p}.out" \ |
| 32 | print_runtime_ratio $VG --tool=exp-drd --check-stack-var=yes "$@" -p$p |
| 33 | |
| 34 | test_output="${1}-drd-without-stack-var-${p}.out" \ |
| 35 | print_runtime_ratio $VG --tool=exp-drd --check-stack-var=no "$@" -p$p |
| 36 | |
| 37 | test_output="${1}-helgrind-${p}.out" \ |
| 38 | print_runtime_ratio $VG --tool=helgrind "$@" -p$p |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 39 | |
| 40 | echo '' |
| 41 | |
| 42 | rm -f "$tmp" |
| 43 | } |
| 44 | |
| 45 | |
bart | 9cdd178 | 2008-06-08 11:22:23 +0000 | [diff] [blame] | 46 | ######################## |
| 47 | # Script body # |
| 48 | ######################## |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 49 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 50 | DRD_SCRIPTS_DIR="$(dirname $0)" |
bart | 7acf380 | 2008-06-06 10:17:26 +0000 | [diff] [blame] | 51 | if [ "${DRD_SCRIPTS_DIR:0:1}" != "/" ]; then |
| 52 | DRD_SCRIPTS_DIR="$PWD/$DRD_SCRIPTS_DIR" |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 53 | fi |
| 54 | |
| 55 | SPLASH2="${DRD_SCRIPTS_DIR}/../splash2" |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 56 | if [ ! -e "${SPLASH2}" ]; then |
| 57 | echo "Error: splash2 directory not found (${SPLASH2})." |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 58 | exit 1 |
| 59 | fi |
| 60 | |
| 61 | if [ "$VG" = "" ]; then |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 62 | VG="${DRD_SCRIPTS_DIR}/../../vg-in-place" |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 63 | fi |
| 64 | |
| 65 | if [ ! -e "$VG" ]; then |
| 66 | echo "Could not find $VG." |
| 67 | exit 1 |
| 68 | fi |
| 69 | |
bart | d7e6ba7 | 2008-06-17 15:00:55 +0000 | [diff] [blame] | 70 | ############################################################################### |
| 71 | # Results: native native none none DRD DRD HG ITC ITC |
| 72 | # -p1 -p2 -p4 -p1 -p4 -p4 -p4+f -p4 -p4 -p4+f |
| 73 | # ............................................................................. |
| 74 | # Cholesky 0.29 0.21 4.46 8.5 0.7 5 4 2 239 82 |
| 75 | # FFT 0.19 0.12 0.12 5.2 8.5 82 54 4237 90 41 |
| 76 | # LU, contiguous 0.76 0.47 0.47 7.7 12.8 66 61 155 428 128 |
| 77 | # LU, non-contiguous 0.80 0.45 0.48 7.4 13.1 88 86 102 428 128 |
| 78 | # Ocean, contiguous 19.45 12.59 12.65 2.7 4.1 57 49 86 90 28 |
| 79 | # Ocean, non-contiguous 0.30 0.18 0.19 4.4 7.3 39 46 85 90 28 |
| 80 | # Radiosity 3.14 3.11 3.11 16.4 16.4 164 60 58 485 163 |
| 81 | # Radix 4.07 2.12 2.12 5.7 10.9 30 27 147 222 56 |
| 82 | # Raytrace 2.22 2.19 2.20 7.8 7.9 166 55 93 172 53 |
| 83 | # Water-n2 0.18 0.17 0.17 11.4 11.5 126 34 52 189 39 |
| 84 | # Water-sp 0.19 0.18 0.18 10.4 10.2 96 34 51 183 34 |
| 85 | # ............................................................................. |
bart | b08ca70 | 2008-06-12 13:50:40 +0000 | [diff] [blame] | 86 | # Hardware: dual-core Intel Xeon 5130, 2.0 GHz, 4 MB L2 cache, 4 GB RAM. |
| 87 | # Software: Ubuntu 7.10 server, 64-bit, gcc 4.3.1, xload -update 1 running. |
bart | d7e6ba7 | 2008-06-17 15:00:55 +0000 | [diff] [blame] | 88 | ############################################################################### |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 89 | # Results: native native DRD DRD HG ITC ITC |
bart | d032b53 | 2008-06-16 20:23:23 +0000 | [diff] [blame] | 90 | # -p1 -p2 -p4 -p4 -p4, f -p4 -p4 -p4, f |
bart | d7e6ba7 | 2008-06-17 15:00:55 +0000 | [diff] [blame] | 91 | # ............................................................................. |
bart | d032b53 | 2008-06-16 20:23:23 +0000 | [diff] [blame] | 92 | # Cholesky 0.21 0.14 4.49 4 3 2 239 82 |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 93 | # FFT - 1 0.11 0.08 0.07 138 66 380 90 41 |
bart | d032b53 | 2008-06-16 20:23:23 +0000 | [diff] [blame] | 94 | # LU, contiguous 0.56 0.34 0.34 72 68 96 428 128 |
| 95 | # LU, non-contiguous 0.59 0.32 0.35 92 109 60 428 128 |
| 96 | # Ocean, contiguous 14.30 9.54 9.56 61 48 89 90 28 |
| 97 | # Ocean, non-contiguous 0.20 0.12 0.12 45 51 93 90 28 |
| 98 | # Radiosity 2.33 2.32 2.33 175 61 60 485 163 |
| 99 | # Radix 2.81 1.45 1.46 32 29 153 222 56 |
| 100 | # Raytrace 1.65 1.64 1.64 230 55 89 172 53 |
| 101 | # Water-n2 0.14 0.12 0.12 129 35 55 189 39 |
| 102 | # Water-sp 0.14 0.12 0.12 121 36 54 183 34 |
bart | d7e6ba7 | 2008-06-17 15:00:55 +0000 | [diff] [blame] | 103 | # ............................................................................. |
bart | cf80135 | 2008-06-15 09:13:28 +0000 | [diff] [blame] | 104 | # Hardware: dual-core Intel Core2 Duo E6750, 2.66 GHz, 4 MB L2 cache, 2 GB RAM. |
| 105 | # Software: openSUSE 10.3, 64-bit, gcc 4.3.1, runlevel 5, X screensaver: blank |
bart | d7e6ba7 | 2008-06-17 15:00:55 +0000 | [diff] [blame] | 106 | ############################################################################### |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 107 | |
bart | 66bb75c | 2008-06-17 06:19:29 +0000 | [diff] [blame] | 108 | cache_size=$(get_cache_size) |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 109 | log2_cache_size=$(log2 ${cache_size}) |
| 110 | |
| 111 | # Cholesky |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 112 | ( |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 113 | cd ${SPLASH2}/codes/kernels/cholesky/inputs |
| 114 | for f in *Z |
| 115 | do |
| 116 | gzip -cd <$f >${f%.Z} |
| 117 | done |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 118 | run_test ../CHOLESKY -C$((cache_size)) tk29.O |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 119 | ) |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 120 | |
| 121 | # FFT |
bart | a995283 | 2008-06-17 14:20:26 +0000 | [diff] [blame] | 122 | run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l$((log2_cache_size)) -m18 |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 123 | |
| 124 | # LU, contiguous blocks. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 125 | run_test ${SPLASH2}/codes/kernels/lu/contiguous_blocks/LU -n1024 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 126 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 127 | # LU, non-contiguous blocks. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 128 | run_test ${SPLASH2}/codes/kernels/lu/non_contiguous_blocks/LU -n1024 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 129 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 130 | # Ocean |
| 131 | run_test ${SPLASH2}/codes/apps/ocean/contiguous_partitions/OCEAN -n2050 |
| 132 | run_test ${SPLASH2}/codes/apps/ocean/non_contiguous_partitions/OCEAN -n258 |
| 133 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 134 | # Radiosity. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 135 | run_test ${SPLASH2}/codes/apps/radiosity/RADIOSITY -batch -room |
| 136 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 137 | # Radix |
| 138 | run_test ${SPLASH2}/codes/kernels/radix/RADIX -n$((2**24)) |
| 139 | |
| 140 | # Raytrace |
| 141 | ( |
| 142 | cd ${SPLASH2}/codes/apps/raytrace/inputs |
| 143 | rm -f *.env *.geo *.rl |
| 144 | for f in *Z |
| 145 | do |
| 146 | gzip -cd <$f >${f%.Z} |
| 147 | done |
| 148 | run_test ../RAYTRACE balls4.env |
| 149 | ) |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 150 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 151 | # Water-n2 |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 152 | ( |
| 153 | cd ${SPLASH2}/codes/apps/water-nsquared |
| 154 | test_input=input run_test ./WATER-NSQUARED |
| 155 | ) |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 156 | |
| 157 | # Water-sp |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 158 | ( |
| 159 | cd ${SPLASH2}/codes/apps/water-spatial |
| 160 | test_input=input run_test ./WATER-SPATIAL |
| 161 | ) |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 162 | |
| 163 | |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 164 | |
| 165 | # Local variables: |
| 166 | # compile-command: "./run-splash2" |
| 167 | # End: |