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