diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-16 16:55:14 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-16 16:55:14 -0400 |
commit | 6ea9939e0610a809f6f47d13ec68df00d1ca0afc (patch) | |
tree | fe4a2eee3ddcf77e2367309dcd75a232b76dcd62 /dis/run_dis.sh | |
parent | e9285d0cdea756a2830f0ace378e4197b36869aa (diff) |
Move the DIS benchmarks up a directory and update hardcoded paths
Note that this repo does not attempt to keep a copy of the original
DIS benchmark distributions. UNC real-time has another repo for that.
Diffstat (limited to 'dis/run_dis.sh')
-rwxr-xr-x | dis/run_dis.sh | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/dis/run_dis.sh b/dis/run_dis.sh new file mode 100755 index 0000000..3e82bfb --- /dev/null +++ b/dis/run_dis.sh | |||
@@ -0,0 +1,81 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | core=$1 | ||
4 | maxJobs=$2 | ||
5 | runID=$3 | ||
6 | benchmark=${4,} | ||
7 | template_input=inputs/$4/in1 | ||
8 | wss_settings=inputs/WSSS | ||
9 | cache_settings=inputs/caches | ||
10 | |||
11 | if [ $# -lt 4 ]; then | ||
12 | echo "Usage $0 <core ID> <number of iterations> <run ID> <benchmark> [template input] [DIS WSS file] [DIS cache file]" | ||
13 | exit | ||
14 | fi | ||
15 | |||
16 | if [ $# -gt 4 ]; then | ||
17 | echo "Using alternate input template from $5" | ||
18 | template_input=$5 | ||
19 | fi | ||
20 | |||
21 | if [ $# -gt 5 ]; then | ||
22 | echo "Using alternate WSS settings from $6" | ||
23 | wss_settings=$6 | ||
24 | fi | ||
25 | |||
26 | if [ $# -gt 6 ]; then | ||
27 | echo "Using alternate cache settings from $7" | ||
28 | cache_settings=$7 | ||
29 | fi | ||
30 | |||
31 | echo "Making sure that binary is up to date..." | ||
32 | make $benchmark | ||
33 | echo "Done. Disabling real-time throttling..." | ||
34 | |||
35 | # Turn off rt throttling | ||
36 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
37 | echo "Done. Redirecting all interrupts to core 0..." | ||
38 | |||
39 | # TODO: Make this cleaner | ||
40 | # Redirect all interrupts to core 0 | ||
41 | i=0 | ||
42 | for IRQ in /proc/irq/* | ||
43 | do | ||
44 | # Skip default_smp_affinity | ||
45 | if [ -d $IRQ ]; then | ||
46 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
47 | echo 0 > $IRQ/smp_affinity_list | ||
48 | fi | ||
49 | i=$(( $i + 1 )) | ||
50 | done | ||
51 | echo "Done. Beginning benchmarks..." | ||
52 | |||
53 | # Setup cache control group | ||
54 | mount -t resctrl resctrl /sys/fs/resctrl | ||
55 | mkdir /sys/fs/resctrl/benchmarks | ||
56 | sleep 1 # Wait a second for the group to initialize | ||
57 | echo $core > /sys/fs/resctrl/benchmarks/cpus_list | ||
58 | |||
59 | # Execute the benchmark for each WSS and cache config | ||
60 | while read j; do | ||
61 | echo $j > /sys/fs/resctrl/benchmarks/schemata | ||
62 | while read i; do | ||
63 | if grep -q "#define LITMUS 1" ../../baseline/source/extra.h; then | ||
64 | echo "Using LITMUS-RT!" | ||
65 | ./gen_input.py $benchmark $template_input $i | ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 | ||
66 | else | ||
67 | ./gen_input.py $benchmark $template_input $i | chrt -r 97 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 | ||
68 | fi | ||
69 | done < $wss_settings | ||
70 | done < $cache_settings | ||
71 | |||
72 | # Put IRQs back as they were | ||
73 | i=0 | ||
74 | for IRQ in /proc/irq/* | ||
75 | do | ||
76 | if [ -d $IRQ ]; then | ||
77 | echo ${irqList[$i]} > $IRQ/smp_affinity_list | ||
78 | fi | ||
79 | i=$(( $i + 1 )) | ||
80 | done | ||
81 | |||