summaryrefslogtreecommitdiffstats
path: root/dis/run_pair_convexity.sh
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2020-10-17 21:22:08 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-17 21:30:01 -0400
commitecf6547fdce39b3ec0f333c9b391b0f1c25deba5 (patch)
treec6f25afe348be22172bed024ffe8881323e74aaf /dis/run_pair_convexity.sh
parent1120161286ee5c855b630bccc9e0b37bb8a3ee65 (diff)
All the DIS runner scripts as used for the (rejected) RTSS'20 submission
DANGER! There's an inconsistency in the input files used for the all-pairs tests and those used for the baseline tests. Baselines: run_all_dis.sh calls run_dis.sh to do all baselines. All-pairs: Uses old TACLe script (not included here). Cache allocation 2nd-order effects on SMT friendliness: run_pair_convexity.sh
Diffstat (limited to 'dis/run_pair_convexity.sh')
-rw-r--r--dis/run_pair_convexity.sh184
1 files changed, 184 insertions, 0 deletions
diff --git a/dis/run_pair_convexity.sh b/dis/run_pair_convexity.sh
new file mode 100644
index 0000000..a4e204f
--- /dev/null
+++ b/dis/run_pair_convexity.sh
@@ -0,0 +1,184 @@
1#!/bin/bash
2
3firstCore=$1
4secondCore=$2
5maxJobs=$3
6userRunID=$4
7#template_input=$9
8tacleNames=tacleNames.txt
9
10if [ $# -lt 7 ]; then
11 echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [bench names file] [WSS setings] [cache settings] [--contend]" # [input file]"
12 exit
13fi
14
15if [ $# -gt 4 ]; then
16 echo "Using list of benchmarks from $5"
17 tacleNames=$5
18fi
19
20if [ $# -gt 5 ]; then
21 echo "Using WSS settings from $6"
22 wss_settings=$6
23fi
24
25if [ $# -gt 6 ]; then
26 echo "Using cache settings from $7"
27 cache_settings=$7
28fi
29#echo "Using template input from $9"
30
31if [ "$EUID" -ne 0 ]
32then
33 echo "You need to be root to enable interrupt isolation and real-time execution!"
34 exit
35fi
36
37echo "Making sure that binaries are up to date..."
38while read i; do
39 make bin/$i
40done < $tacleNames
41echo "Done. Disabling real-time throttling..."
42
43# Turn off rt throttling
44echo -1 > /proc/sys/kernel/sched_rt_runtime_us
45echo "Done. Redirecting all interrupts to core 0..."
46
47# Redirect all interrupts to core 0
48i=0
49for IRQ in /proc/irq/*
50do
51 # Skip default_smp_affinity
52 if [ -d $IRQ ]; then
53 irqList[$i]=$(cat $IRQ/smp_affinity_list)
54 echo 0 2> /dev/null > $IRQ/smp_affinity_list
55 fi
56 i=$(( $i + 1 ))
57done
58
59# Read the names of each benchmark
60j=0
61while read i; do
62 tacleProg[$j]=$i
63 j=$(( $j + 1 ))
64done < $tacleNames
65
66echo "Done. Checking for wbinvd module..."
67if [[ ! -f "/proc/wbinvd" ]]; then
68 echo "ERROR: wbinvd module not loaded. Exiting..."
69 exit
70fi
71
72echo "Done. Setting cores $firstCore and $secondCore to 'performance'..."
73echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor
74echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governor
75
76# Enable L3 isolation
77echo "Done. Enabling L3 isolation..."
78mount -t resctrl resctrl /sys/fs/resctrl
79mkdir -p /sys/fs/resctrl/benchmarks
80mkdir -p /sys/fs/resctrl/benchmarks2
81echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list
82echo $secondCore > /sys/fs/resctrl/benchmarks2/cpus_list
83# Reset global bandwith control and remove L3 from global
84echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
85echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
86# Alloc L3 to benchmark
87echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
88echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks2/schemata
89echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
90echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks2/schemata
91echo "Done. Verifying configuration with user..."
92
93# Generate file name string
94# We append to this as we parse the environment settings
95runID=$(date +"%b%d-%H")
96
97# Confirm configuration with user
98echo "=== Global Config ==="
99cat /sys/fs/resctrl/schemata
100echo "=== Core $firstCore and $secondCore Config ==="
101cat /sys/fs/resctrl/benchmarks/schemata
102if [[ $8 == "--contend" ]]; then
103 if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then
104 echo "ERROR: thrasher binary not fonud. Exiting..."
105 exit
106 fi
107 echo "Will run 6 contending tasks"
108 runID=$runID-c
109else
110 runID=$runID-xc
111fi
112if uname -a | grep -q "mc2"; then
113 echo "MC^2 Autodetected. Cache coloring will be enabled."
114 runID=$runID-i
115else
116 echo "MC^2 not detected. This benchmark requires MC^2! Exiting..."
117 exit
118fi
119echo "Results will be saved as $runID-$userRunID-A.txt and $runID-$userRunID-B.txt"
120echo "Press enter to confirm environment, Ctrl-C to exit..."
121read
122
123# Start contending tasks
124if [[ $8 == "--contend" ]]; then
125 echo "Done. Starting 6 contending tasks..."
126 # Run two contending tasks on each other CCX
127 taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher &
128 taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher &
129 taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher &
130 taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher &
131 taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher &
132 taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher &
133fi
134sleep 1 # Wait for contending tasks to start
135echo "Done. Beginning benchmarks..."
136
137num_tests=$(wc -l < $tacleNames)
138for (( ii = 0; ii < $num_tests ; ii++ ))
139do
140 for (( jj = $ii+1; jj < $num_tests ; jj++ )) #loop through programs
141 do
142# Execute the benchmark for each WSS and cache config
143while read k; do
144 echo $k > /sys/fs/resctrl/benchmarks/schemata
145 while read j; do
146 echo $j > /sys/fs/resctrl/benchmarks2/schemata
147 while read i; do
148 ./gen_input.py matrix inputs/Matrix/in0 $i | chrt -r 97 numactl -m 0 taskset -c $firstCore ./${tacleProg[$ii]} ${tacleProg[$ii]}-$i-$k $maxJobs $firstCore $secondCore ${tacleProg[$jj]}-$i-$j $runID-$userRunID-A 1 > /dev/null & PID1=$!;
149 ./gen_input.py transitive inputs/Transitive/in0 $i | chrt -r 97 numactl -m 1 taskset -c $secondCore ./${tacleProg[$jj]} ${tacleProg[$jj]}-$i-$j $maxJobs $secondCore $firstCore ${tacleProg[$ii]}-$i-$k $runID-$userRunID-B 2 > /dev/null & PID2=$!;
150 wait $PID1 $PID2
151 done < $wss_settings
152 echo "Done with $k $j"
153 done < $cache_settings
154done < $cache_settings
155
156# ./gen_input.py $benchmark $template_input $i | chrt -r 97 numactl -m 0 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
157# chrt -r 97 numactl -m 0 taskset -c $firstCore ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $firstCore $secondCore ${tacleProg[$j]} $runID-$userRunID"-A" 1 & PID1=$!;
158# chrt -r 97 numactl -m 1 taskset -c $secondCore ./bin/${tacleProg[$j]} ${tacleProg[$j]} $maxJobs $secondCore $firstCore ${tacleProg[$i]} $runID-$userRunID"-B" 2 & PID2=$!;
159# wait $PID1 $PID2
160 echo ${tacleProg[$i]} ${tacleProg[$j]}
161 done
162 echo COMPLETE: ${tacleProg[$i]}
163done
164
165# End contending tasks
166if [[ $8 == "--contend" ]]; then
167 killall thrasher
168fi
169
170# Remove semaphores from system
171# Leaving them won't hurt these tests, but would be messy and is bad practice
172# TODO: Do this directly in the benchmarks. They should clean up after themselves
173./bin/cleanupSemaphores
174
175# Put smp_affinty back the way it was
176i=0
177for IRQ in /proc/irq/*
178do
179 if [ -d $IRQ ]; then
180 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
181 fi
182 i=$(( $i + 1 ))
183done
184