summaryrefslogtreecommitdiffstats
path: root/baseline
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2020-10-20 13:35:52 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-20 13:41:49 -0400
commit03412b9f841f140b9b7410a1890298e3ac2835db (patch)
tree8417ed7fa548a571ab88f139da666787766740f3 /baseline
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (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-xbaseline/run_baseline.sh156
-rw-r--r--baseline/source/epic/epic.c25
-rw-r--r--baseline/source/rijndael_enc/rijndael_enc.c24
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
3core=$1
4maxJobs=$2
5userRunID=$3
6tacleNames=tacleNames.txt
7
8if [ $# -lt 3 ]; then
9 echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]"
10 exit
11fi
12
13if [ $# -gt 3 ]; then
14 echo "Using alternate list of TACLe benchmarks from $4"
15 tacleNames=$4
16fi
17
18if [ "$EUID" -ne 0 ]
19then
20 echo "You need to be root to enable interrupt isolation and real-time execution!"
21 exit
22fi
23
24echo "Making sure that binaries are up to date..."
25while read i; do
26 make bin/$i
27done < $tacleNames
28echo "Done. Disabling real-time throttling..."
29
30# Turn off rt throttling
31echo -1 > /proc/sys/kernel/sched_rt_runtime_us
32echo "Done. Redirecting all interrupts to core 0..."
33
34# Redirect all interrupts to core 0
35i=0
36for IRQ in /proc/irq/*
37do
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 ))
44done
45
46# Read the names of each benchmark
47j=0
48while read i; do
49 tacleProg[$j]=$i
50 j=$(( $j + 1 ))
51done < $tacleNames
52
53echo "Done. Checking for wbinvd module..."
54if [[ ! -f "/proc/wbinvd" ]]; then
55 echo "ERROR: wbinvd module not loaded. Exiting..."
56 exit
57fi
58
59echo "Done. Setting cores $firstCore and $secondCore to 'performance'..."
60echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor
61echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governo
62
63# Enable L3 isolation
64echo "Done. Enabling L3 isolation..."
65mount -t resctrl resctrl /sys/fs/resctrl
66mkdir -p /sys/fs/resctrl/benchmarks
67echo $1 > /sys/fs/resctrl/benchmarks/cpus_list
68# Reset global bandwith control and remove L3 from global
69echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
70echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
71# Alloc L3 to benchmark
72echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
73echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
74echo "Done. Verifying configuration with user..."
75
76# Generate file name string
77# We append to this as we parse the environment settings
78runID=$(date +"%b%d-%H")
79
80# Confirm configuration with user
81echo "=== Global Config ==="
82cat /sys/fs/resctrl/schemata
83echo "=== Core $1 Config ==="
84cat /sys/fs/resctrl/benchmarks/schemata
85if [[ $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
92else
93 runID=$runID-xc
94fi
95if uname -a | grep -q "mc2"; then
96 echo "MC^2 Autodetected. Cache coloring and interleaving will be enabled."
97 runID=$runID-i
98else
99 echo "MC^2 not detected."
100 runID=$runID-xi
101fi
102if pwd | grep -qi dis; then
103 echo "Autodetected DIS. Will use script-level looping."
104fi
105echo "Results will be saved as $runID-$userRunID.txt"
106echo "Press enter to confirm environment, Ctrl-C to exit..."
107read
108
109# Start contending tasks
110if [[ $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 &
119fi
120sleep 1 # Wait for contending tasks to start
121echo "Done. Beginning benchmarks..."
122
123num_tests=$(wc -l < $tacleNames)
124for (( i = 0; i < $num_tests ; i++ ))
125do
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]}
140done
141
142# End contending tasks
143if [[ $5 == "--contend" ]]; then
144 killall thrasher
145fi
146
147# Put smp_affinty back the way it was
148i=0
149for IRQ in /proc/irq/*
150do
151 if [ -d $IRQ ]; then
152 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
153 fi
154 i=$(( $i + 1 ))
155done
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
601float epic_filtertemp[FILTER_SIZE]; 601float epic_filtertemp[FILTER_SIZE*2]; // *2 to work around memory corruption issue
602float epic_hi_imagetemp[X_SIZE * Y_SIZE / 2]; 602float epic_hi_imagetemp[X_SIZE * Y_SIZE / 2];
603float epic_lo_imagetemp[X_SIZE * Y_SIZE / 2]; 603float epic_lo_imagetemp[X_SIZE * Y_SIZE / 2];
604 604
@@ -1129,13 +1129,18 @@ int epic_return(){
1129 1129
1130int main( int argc, char **argv ) 1130int 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
226int main( int argc, char** argv ) 227int 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