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 { |
| 10 | local tmp avg1=1 stddev1=1 avg2=1 stddev2=1 |
| 11 | |
| 12 | tmp="/tmp/test-timing.$$" |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 13 | rm -f "${tmp}" |
| 14 | |
bart | f33ce89 | 2008-06-07 11:40:14 +0000 | [diff] [blame] | 15 | test_output="${1}.out" measure_runtime "$@" | 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 | 9cdd178 | 2008-06-08 11:22:23 +0000 | [diff] [blame^] | 19 | for p in 4 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 20 | do |
bart | f33ce89 | 2008-06-07 11:40:14 +0000 | [diff] [blame] | 21 | test_output="${1}-drd-with-stack-var-${p}.out" \ |
| 22 | print_runtime_ratio $VG --tool=exp-drd --check-stack-var=yes "$@" -p$p |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 23 | |
bart | f33ce89 | 2008-06-07 11:40:14 +0000 | [diff] [blame] | 24 | test_output="${1}-drd-without-stack-var-${p}.out" \ |
| 25 | print_runtime_ratio $VG --tool=exp-drd --check-stack-var=no "$@" -p$p |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 26 | done |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 27 | |
| 28 | echo '' |
| 29 | |
| 30 | rm -f "$tmp" |
| 31 | } |
| 32 | |
| 33 | |
bart | 9cdd178 | 2008-06-08 11:22:23 +0000 | [diff] [blame^] | 34 | ######################## |
| 35 | # Script body # |
| 36 | ######################## |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 37 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 38 | DRD_SCRIPTS_DIR="$(dirname $0)" |
bart | 7acf380 | 2008-06-06 10:17:26 +0000 | [diff] [blame] | 39 | if [ "${DRD_SCRIPTS_DIR:0:1}" != "/" ]; then |
| 40 | DRD_SCRIPTS_DIR="$PWD/$DRD_SCRIPTS_DIR" |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 41 | fi |
| 42 | |
| 43 | SPLASH2="${DRD_SCRIPTS_DIR}/../splash2" |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 44 | if [ ! -e "${SPLASH2}" ]; then |
| 45 | echo "Error: splash2 directory not found (${SPLASH2})." |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 46 | exit 1 |
| 47 | fi |
| 48 | |
| 49 | if [ "$VG" = "" ]; then |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 50 | VG="${DRD_SCRIPTS_DIR}/../../vg-in-place" |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 51 | fi |
| 52 | |
| 53 | if [ ! -e "$VG" ]; then |
| 54 | echo "Could not find $VG." |
| 55 | exit 1 |
| 56 | fi |
| 57 | |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 58 | ############################################################################## |
| 59 | # Results: (-p1) (-p2) (-p4) ITC (-p4) ITC (-p4) |
| 60 | # original w/ filter |
| 61 | # ............................................................................ |
| 62 | # Cholesky 40 47 82 239 82 |
| 63 | # FFT 16 17 47 90 41 |
| 64 | # LU, contiguous blocks 39 41 45 428 128 |
| 65 | # LU, non-contiguous blocks 39 41 49 428 128 |
| 66 | # Ocean, contiguous partitions 17 19 25 90 28 |
| 67 | # Ocean, non-continguous partns 18 21 30 90 28 |
| 68 | # Radiosity 78 78 78 485 163 |
| 69 | # Radix 10 12 15 222 56 |
| 70 | # Raytrace 56 56 56 172 53 |
| 71 | # Water-n2 34 34 34 189 39 |
| 72 | # Water-sp 33 33 33 183 34 |
| 73 | # ............................................................................ |
| 74 | # Hardware: dual-core Intel Xeon 5130, 2.0 GHz, 4 MB L2 cache, 4 GB RAM. |
bart | 9cdd178 | 2008-06-08 11:22:23 +0000 | [diff] [blame^] | 75 | # Software: Ubuntu 7.10 server, 64-bit, gcc 4.1.3. |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 76 | ############################################################################## |
| 77 | # Results: native DRD (-p4) DRD (-p4) ITC (-p4) ITC (-p4) |
| 78 | # time original w/ filter original w/ filter |
| 79 | # ............................................................................ |
bart | 9cdd178 | 2008-06-08 11:22:23 +0000 | [diff] [blame^] | 80 | # Cholesky 0.21 107 70 239 82 |
| 81 | # FFT 0.11 90 17 90 41 |
| 82 | # LU, contiguous blocks 0.56 53 46 428 128 |
| 83 | # LU, non-contiguous blocks 0.59 57 49 428 128 |
| 84 | # Ocean, contiguous partitions 14.32 34 24 90 28 |
| 85 | # Ocean, non-continguous partns 0.21 28 30 90 28 |
bart | f33ce89 | 2008-06-07 11:40:14 +0000 | [diff] [blame] | 86 | # Radiosity 2.35 .. 76 485 163 |
| 87 | # Radix 2.80 .. 16 222 56 |
| 88 | # Raytrace 90.79 .. 54 172 53 |
| 89 | # Water-n2 0.15 .. 27 189 39 |
| 90 | # Water-sp 0.15 .. 26 183 34 |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 91 | # ............................................................................ |
| 92 | # Hardware: dual-core Intel Core2 Duo E6750, 2.66 GHz, 4 MB L2 cache, 2 GB RAM. |
bart | 9cdd178 | 2008-06-08 11:22:23 +0000 | [diff] [blame^] | 93 | # Software: openSUSE 10.3, 64-bit, gcc 4.2.1, runlevel 5, X screensaver: blank |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 94 | ############################################################################## |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 95 | |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 96 | cache_size=$(($(get_cache_size)/2)) |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 97 | log2_cache_size=$(log2 ${cache_size}) |
| 98 | |
| 99 | # Cholesky |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 100 | ( |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 101 | cd ${SPLASH2}/codes/kernels/cholesky/inputs |
| 102 | for f in *Z |
| 103 | do |
| 104 | gzip -cd <$f >${f%.Z} |
| 105 | done |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 106 | run_test ../CHOLESKY -C${cache_size} tk29.O |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 107 | ) |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 108 | |
| 109 | # FFT |
bart | 0d4e5c2 | 2008-06-07 10:42:52 +0000 | [diff] [blame] | 110 | run_test ${SPLASH2}/codes/kernels/fft/FFT -t -l${log2_cache_size} -m18 |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 111 | |
| 112 | # LU, contiguous blocks. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 113 | run_test ${SPLASH2}/codes/kernels/lu/contiguous_blocks/LU -n1024 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 114 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 115 | # LU, non-contiguous blocks. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 116 | run_test ${SPLASH2}/codes/kernels/lu/non_contiguous_blocks/LU -n1024 |
bart | 8785c12 | 2008-05-29 08:34:27 +0000 | [diff] [blame] | 117 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 118 | # Ocean |
| 119 | run_test ${SPLASH2}/codes/apps/ocean/contiguous_partitions/OCEAN -n2050 |
| 120 | run_test ${SPLASH2}/codes/apps/ocean/non_contiguous_partitions/OCEAN -n258 |
| 121 | |
bart | 3281150 | 2008-06-03 15:12:59 +0000 | [diff] [blame] | 122 | # Radiosity. |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 123 | run_test ${SPLASH2}/codes/apps/radiosity/RADIOSITY -batch -room |
| 124 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 125 | # Radix |
| 126 | run_test ${SPLASH2}/codes/kernels/radix/RADIX -n$((2**24)) |
| 127 | |
| 128 | # Raytrace |
| 129 | ( |
| 130 | cd ${SPLASH2}/codes/apps/raytrace/inputs |
| 131 | rm -f *.env *.geo *.rl |
| 132 | for f in *Z |
| 133 | do |
| 134 | gzip -cd <$f >${f%.Z} |
| 135 | done |
| 136 | run_test ../RAYTRACE balls4.env |
| 137 | ) |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 138 | |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 139 | # Water-n2 |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 140 | ( |
| 141 | cd ${SPLASH2}/codes/apps/water-nsquared |
| 142 | test_input=input run_test ./WATER-NSQUARED |
| 143 | ) |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 144 | |
| 145 | # Water-sp |
bart | 334db5e | 2008-06-05 10:14:53 +0000 | [diff] [blame] | 146 | ( |
| 147 | cd ${SPLASH2}/codes/apps/water-spatial |
| 148 | test_input=input run_test ./WATER-SPATIAL |
| 149 | ) |
bart | 868d73a | 2008-06-04 13:02:22 +0000 | [diff] [blame] | 150 | |
| 151 | |
bart | c4a174f | 2008-06-03 11:41:19 +0000 | [diff] [blame] | 152 | |
| 153 | # Local variables: |
| 154 | # compile-command: "./run-splash2" |
| 155 | # End: |