diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-20 13:35:52 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-20 13:41:49 -0400 |
commit | 03412b9f841f140b9b7410a1890298e3ac2835db (patch) | |
tree | 8417ed7fa548a571ab88f139da666787766740f3 /baseline | |
parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) |
TACLe and DIS benchmark fixes
- Use consistent approach to prevent computations from being
optimized out in the DIS benchmarks
- Don't print results in the DIS benchmarks
- Fix a memory corruption in TACLe's "epic" benchmark reflect1()
- Fix return codes for all benchmarks
- Rename run_baseline.sh to run_bench.sh in preperation for this
being the main benchmarking script
Diffstat (limited to 'baseline')
-rwxr-xr-x | baseline/run_baseline.sh | 156 | ||||
-rw-r--r-- | baseline/source/epic/epic.c | 25 | ||||
-rw-r--r-- | baseline/source/rijndael_enc/rijndael_enc.c | 24 |
3 files changed, 30 insertions, 175 deletions
diff --git a/baseline/run_baseline.sh b/baseline/run_baseline.sh deleted file mode 100755 index c5b67b6..0000000 --- a/baseline/run_baseline.sh +++ /dev/null | |||
@@ -1,156 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | core=$1 | ||
4 | maxJobs=$2 | ||
5 | userRunID=$3 | ||
6 | tacleNames=tacleNames.txt | ||
7 | |||
8 | if [ $# -lt 3 ]; then | ||
9 | echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
10 | exit | ||
11 | fi | ||
12 | |||
13 | if [ $# -gt 3 ]; then | ||
14 | echo "Using alternate list of TACLe benchmarks from $4" | ||
15 | tacleNames=$4 | ||
16 | fi | ||
17 | |||
18 | if [ "$EUID" -ne 0 ] | ||
19 | then | ||
20 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
21 | exit | ||
22 | fi | ||
23 | |||
24 | echo "Making sure that binaries are up to date..." | ||
25 | while read i; do | ||
26 | make bin/$i | ||
27 | done < $tacleNames | ||
28 | echo "Done. Disabling real-time throttling..." | ||
29 | |||
30 | # Turn off rt throttling | ||
31 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
32 | echo "Done. Redirecting all interrupts to core 0..." | ||
33 | |||
34 | # Redirect all interrupts to core 0 | ||
35 | i=0 | ||
36 | for IRQ in /proc/irq/* | ||
37 | do | ||
38 | # Skip default_smp_affinity | ||
39 | if [ -d $IRQ ]; then | ||
40 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
41 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
42 | fi | ||
43 | i=$(( $i + 1 )) | ||
44 | done | ||
45 | |||
46 | # Read the names of each benchmark | ||
47 | j=0 | ||
48 | while read i; do | ||
49 | tacleProg[$j]=$i | ||
50 | j=$(( $j + 1 )) | ||
51 | done < $tacleNames | ||
52 | |||
53 | echo "Done. Checking for wbinvd module..." | ||
54 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
55 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
56 | exit | ||
57 | fi | ||
58 | |||
59 | echo "Done. Setting cores $firstCore and $secondCore to 'performance'..." | ||
60 | echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor | ||
61 | echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governo | ||
62 | |||
63 | # Enable L3 isolation | ||
64 | echo "Done. Enabling L3 isolation..." | ||
65 | mount -t resctrl resctrl /sys/fs/resctrl | ||
66 | mkdir -p /sys/fs/resctrl/benchmarks | ||
67 | echo $1 > /sys/fs/resctrl/benchmarks/cpus_list | ||
68 | # Reset global bandwith control and remove L3 from global | ||
69 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
70 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
71 | # Alloc L3 to benchmark | ||
72 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
73 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
74 | echo "Done. Verifying configuration with user..." | ||
75 | |||
76 | # Generate file name string | ||
77 | # We append to this as we parse the environment settings | ||
78 | runID=$(date +"%b%d-%H") | ||
79 | |||
80 | # Confirm configuration with user | ||
81 | echo "=== Global Config ===" | ||
82 | cat /sys/fs/resctrl/schemata | ||
83 | echo "=== Core $1 Config ===" | ||
84 | cat /sys/fs/resctrl/benchmarks/schemata | ||
85 | if [[ $5 == "--contend" ]]; then | ||
86 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
87 | echo "ERROR: thrasher binary not fonud. Exiting..." | ||
88 | exit | ||
89 | fi | ||
90 | echo "Will run 6 contending tasks" | ||
91 | runID=$runID-c | ||
92 | else | ||
93 | runID=$runID-xc | ||
94 | fi | ||
95 | if uname -a | grep -q "mc2"; then | ||
96 | echo "MC^2 Autodetected. Cache coloring and interleaving will be enabled." | ||
97 | runID=$runID-i | ||
98 | else | ||
99 | echo "MC^2 not detected." | ||
100 | runID=$runID-xi | ||
101 | fi | ||
102 | if pwd | grep -qi dis; then | ||
103 | echo "Autodetected DIS. Will use script-level looping." | ||
104 | fi | ||
105 | echo "Results will be saved as $runID-$userRunID.txt" | ||
106 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
107 | read | ||
108 | |||
109 | # Start contending tasks | ||
110 | if [[ $5 == "--contend" ]]; then | ||
111 | echo "Done. Starting 6 contending tasks..." | ||
112 | # Run two contending tasks on each other CCX | ||
113 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
114 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
115 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
116 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
117 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
118 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
119 | fi | ||
120 | sleep 1 # Wait for contending tasks to start | ||
121 | echo "Done. Beginning benchmarks..." | ||
122 | |||
123 | num_tests=$(wc -l < $tacleNames) | ||
124 | for (( i = 0; i < $num_tests ; i++ )) | ||
125 | do | ||
126 | # If using DIS, we have to iterate in the script as DIS won't do it for us | ||
127 | pwd | grep -qi dis | ||
128 | iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))") | ||
129 | for ((k=0;k<=iters;k++)); do | ||
130 | # Check if we're using LITMUS^RT or not | ||
131 | if [[ -f source/extra.h ]] && grep -q "#define LITMUS 1" source/extra.h; then | ||
132 | ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | ||
133 | else | ||
134 | # Interleave memory allocations between all nodes (only 1 node w/out MC^2) | ||
135 | chrt -r 97 numactl --interleave=all taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | ||
136 | #chrt -r 97 numactl -m 0 taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID-NOINTERLEAVE 1 | ||
137 | fi | ||
138 | done | ||
139 | echo COMPLETE: ${tacleProg[$i]} | ||
140 | done | ||
141 | |||
142 | # End contending tasks | ||
143 | if [[ $5 == "--contend" ]]; then | ||
144 | killall thrasher | ||
145 | fi | ||
146 | |||
147 | # Put smp_affinty back the way it was | ||
148 | i=0 | ||
149 | for IRQ in /proc/irq/* | ||
150 | do | ||
151 | if [ -d $IRQ ]; then | ||
152 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
153 | fi | ||
154 | i=$(( $i + 1 )) | ||
155 | done | ||
156 | |||
diff --git a/baseline/source/epic/epic.c b/baseline/source/epic/epic.c index a1e344c..ed08040 100644 --- a/baseline/source/epic/epic.c +++ b/baseline/source/epic/epic.c | |||
@@ -598,7 +598,7 @@ void epic_main( void ); | |||
598 | Declaration of global variables | 598 | Declaration of global variables |
599 | */ | 599 | */ |
600 | 600 | ||
601 | float epic_filtertemp[FILTER_SIZE]; | 601 | float epic_filtertemp[FILTER_SIZE*2]; // *2 to work around memory corruption issue |
602 | float epic_hi_imagetemp[X_SIZE * Y_SIZE / 2]; | 602 | float epic_hi_imagetemp[X_SIZE * Y_SIZE / 2]; |
603 | float epic_lo_imagetemp[X_SIZE * Y_SIZE / 2]; | 603 | float epic_lo_imagetemp[X_SIZE * Y_SIZE / 2]; |
604 | 604 | ||
@@ -1129,13 +1129,18 @@ int epic_return(){ | |||
1129 | 1129 | ||
1130 | int main( int argc, char **argv ) | 1130 | int main( int argc, char **argv ) |
1131 | { | 1131 | { |
1132 | SET_UP | 1132 | int exit_code = -1; |
1133 | for (jobsComplete=0; jobsComplete<maxJobs; jobsComplete++){ | 1133 | SET_UP |
1134 | START_LOOP | 1134 | for (jobsComplete=0; jobsComplete<maxJobs; jobsComplete++){ |
1135 | epic_init(); | 1135 | START_LOOP |
1136 | epic_main(); | 1136 | epic_init(); |
1137 | STOP_LOOP | 1137 | epic_main(); |
1138 | } | 1138 | // This checks the checksum is as expected. |
1139 | WRITE_TO_FILE | 1139 | // This is `&` as only the first job will match |
1140 | return epic_return(); | 1140 | // (image state persists between jobs). |
1141 | exit_code &= epic_return(); | ||
1142 | STOP_LOOP | ||
1143 | } | ||
1144 | WRITE_TO_FILE | ||
1145 | return exit_code; | ||
1141 | } | 1146 | } |
diff --git a/baseline/source/rijndael_enc/rijndael_enc.c b/baseline/source/rijndael_enc/rijndael_enc.c index 6c85eee..21d7e67 100644 --- a/baseline/source/rijndael_enc/rijndael_enc.c +++ b/baseline/source/rijndael_enc/rijndael_enc.c | |||
@@ -68,6 +68,7 @@ void rijndael_enc_init( void ) | |||
68 | rijndael_enc_fin.data = rijndael_enc_data; | 68 | rijndael_enc_fin.data = rijndael_enc_data; |
69 | rijndael_enc_fin.size = 31369; | 69 | rijndael_enc_fin.size = 31369; |
70 | rijndael_enc_fin.cur_pos = 0; | 70 | rijndael_enc_fin.cur_pos = 0; |
71 | rijndael_enc_checksum = 0; | ||
71 | 72 | ||
72 | unsigned i; | 73 | unsigned i; |
73 | volatile int x = 0; | 74 | volatile int x = 0; |
@@ -225,14 +226,19 @@ void _Pragma( "entrypoint" ) rijndael_enc_main( void ) | |||
225 | 226 | ||
226 | int main( int argc, char** argv ) | 227 | int main( int argc, char** argv ) |
227 | { | 228 | { |
228 | SET_UP | 229 | int exit_code = -1; |
229 | for (jobsComplete=0; jobsComplete<maxJobs; jobsComplete++){ | 230 | SET_UP |
230 | START_LOOP | 231 | for (jobsComplete=0; jobsComplete<maxJobs; jobsComplete++){ |
231 | rijndael_enc_init(); | 232 | START_LOOP |
232 | rijndael_enc_main(); | 233 | rijndael_enc_init(); |
233 | STOP_LOOP | 234 | rijndael_enc_main(); |
234 | } | 235 | // This checks the checksum is as expected. |
235 | WRITE_TO_FILE | 236 | // This is `&` as only the first job will match |
236 | return ( rijndael_enc_return() ); | 237 | // (PRNG state persists between jobs). |
238 | exit_code &= rijndael_enc_return(); | ||
239 | STOP_LOOP | ||
240 | } | ||
241 | WRITE_TO_FILE | ||
242 | return ( exit_code ); | ||
237 | } | 243 | } |
238 | 244 | ||