summaryrefslogtreecommitdiffstats
path: root/dis/run_dis.sh
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2020-10-16 16:55:14 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-16 16:55:14 -0400
commit6ea9939e0610a809f6f47d13ec68df00d1ca0afc (patch)
treefe4a2eee3ddcf77e2367309dcd75a232b76dcd62 /dis/run_dis.sh
parente9285d0cdea756a2830f0ace378e4197b36869aa (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-xdis/run_dis.sh81
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
3core=$1
4maxJobs=$2
5runID=$3
6benchmark=${4,}
7template_input=inputs/$4/in1
8wss_settings=inputs/WSSS
9cache_settings=inputs/caches
10
11if [ $# -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
14fi
15
16if [ $# -gt 4 ]; then
17 echo "Using alternate input template from $5"
18 template_input=$5
19fi
20
21if [ $# -gt 5 ]; then
22 echo "Using alternate WSS settings from $6"
23 wss_settings=$6
24fi
25
26if [ $# -gt 6 ]; then
27 echo "Using alternate cache settings from $7"
28 cache_settings=$7
29fi
30
31echo "Making sure that binary is up to date..."
32make $benchmark
33echo "Done. Disabling real-time throttling..."
34
35# Turn off rt throttling
36echo -1 > /proc/sys/kernel/sched_rt_runtime_us
37echo "Done. Redirecting all interrupts to core 0..."
38
39# TODO: Make this cleaner
40# Redirect all interrupts to core 0
41i=0
42for IRQ in /proc/irq/*
43do
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 ))
50done
51echo "Done. Beginning benchmarks..."
52
53# Setup cache control group
54mount -t resctrl resctrl /sys/fs/resctrl
55mkdir /sys/fs/resctrl/benchmarks
56sleep 1 # Wait a second for the group to initialize
57echo $core > /sys/fs/resctrl/benchmarks/cpus_list
58
59# Execute the benchmark for each WSS and cache config
60while 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
70done < $cache_settings
71
72# Put IRQs back as they were
73i=0
74for IRQ in /proc/irq/*
75do
76 if [ -d $IRQ ]; then
77 echo ${irqList[$i]} > $IRQ/smp_affinity_list
78 fi
79 i=$(( $i + 1 ))
80done
81