diff options
| author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-17 21:22:08 -0400 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-17 21:30:01 -0400 |
| commit | ecf6547fdce39b3ec0f333c9b391b0f1c25deba5 (patch) | |
| tree | c6f25afe348be22172bed024ffe8881323e74aaf /smt_analysis_rtss20 | |
| parent | 1120161286ee5c855b630bccc9e0b37bb8a3ee65 (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 'smt_analysis_rtss20')
| -rwxr-xr-x | smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh | 175 |
1 files changed, 175 insertions, 0 deletions
diff --git a/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh b/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh new file mode 100755 index 0000000..2ac3fc1 --- /dev/null +++ b/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh | |||
| @@ -0,0 +1,175 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | userRunID=$4 | ||
| 7 | tacleNames=tacleNames.txt | ||
| 8 | |||
| 9 | if [ $# -lt 4 ]; then | ||
| 10 | echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | |||
| 14 | if [ $# -gt 4 ]; then | ||
| 15 | echo "Using alternate list of TACLe benchmarks from $5" | ||
| 16 | tacleNames=$5 | ||
| 17 | fi | ||
| 18 | |||
| 19 | if [ "$EUID" -ne 0 ] | ||
| 20 | then | ||
| 21 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 22 | exit | ||
| 23 | fi | ||
| 24 | |||
| 25 | echo "Making sure that binaries are up to date..." | ||
| 26 | while read i; do | ||
| 27 | make bin/$i | ||
| 28 | done < $tacleNames | ||
| 29 | echo "Done. Disabling real-time throttling..." | ||
| 30 | |||
| 31 | # Turn off rt throttling | ||
| 32 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 33 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 34 | |||
| 35 | # Redirect all interrupts to core 0 | ||
| 36 | i=0 | ||
| 37 | for IRQ in /proc/irq/* | ||
| 38 | do | ||
| 39 | # Skip default_smp_affinity | ||
| 40 | if [ -d $IRQ ]; then | ||
| 41 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 42 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 43 | fi | ||
| 44 | i=$(( $i + 1 )) | ||
| 45 | done | ||
| 46 | |||
| 47 | # Read the names of each benchmark | ||
| 48 | j=0 | ||
| 49 | while read i; do | ||
| 50 | tacleProg[$j]=$i | ||
| 51 | j=$(( $j + 1 )) | ||
| 52 | done < $tacleNames | ||
| 53 | |||
| 54 | echo "Done. Checking for wbinvd module..." | ||
| 55 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 56 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 57 | exit | ||
| 58 | fi | ||
| 59 | |||
| 60 | # Enable L3 isolation | ||
| 61 | echo "Done. Enabling L3 isolation..." | ||
| 62 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 63 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 64 | echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 65 | echo $secondCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 66 | # Reset global bandwith control and remove L3 from global | ||
| 67 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 68 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 69 | # Alloc L3 to benchmark | ||
| 70 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 71 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 72 | echo "Done. Verifying configuration with user..." | ||
| 73 | |||
| 74 | # Generate file name string | ||
| 75 | # We append to this as we parse the environment settings | ||
| 76 | runID=$(date +"%b%d-%H") | ||
| 77 | |||
| 78 | # Confirm configuration with user | ||
| 79 | echo "=== Global Config ===" | ||
| 80 | cat /sys/fs/resctrl/schemata | ||
| 81 | echo "=== Core $firstCore and $secondCore Config ===" | ||
| 82 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 83 | if [[ $6 == "--contend" ]]; then | ||
| 84 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 85 | echo "ERROR: thrasher binary not fonud. Exiting..." | ||
| 86 | exit | ||
| 87 | fi | ||
| 88 | echo "Will run 6 contending tasks" | ||
| 89 | runID=$runID-c | ||
| 90 | else | ||
| 91 | runID=$runID-xc | ||
| 92 | fi | ||
| 93 | if uname -a | grep -q "mc2"; then | ||
| 94 | echo "MC^2 Autodetected. Cache coloring will be DISABLED." | ||
| 95 | runID=$runID-i | ||
| 96 | else | ||
| 97 | echo "MC^2 not detected. Cache coloring will be DISABLED." | ||
| 98 | runID=$runID-xi | ||
| 99 | fi | ||
| 100 | echo "Results will be saved as $runID-$userRunID-LC-DIS.txt" | ||
| 101 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 102 | read | ||
| 103 | |||
| 104 | # Start contending tasks | ||
| 105 | if [[ $6 == "--contend" ]]; then | ||
| 106 | echo "Done. Starting 6 contending tasks..." | ||
| 107 | # Run two contending tasks on each other CCX | ||
| 108 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 109 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 110 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 111 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 112 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 113 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 114 | fi | ||
| 115 | sleep 1 # Wait for contending tasks to start | ||
| 116 | echo "Done. Beginning benchmarks..." | ||
| 117 | |||
| 118 | num_tests=$(wc -l < $tacleNames) | ||
| 119 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 120 | do | ||
| 121 | # For level-C analysis, we must run all vs all | ||
| 122 | for (( j = 0; j < $num_tests ; j++ )) #loop through programs | ||
| 123 | do | ||
| 124 | # Autodetect MC^2 | ||
| 125 | # Get DIS to loop continuously in the background by infinite restarts | ||
| 126 | if uname -a | grep -q "mc2"; then | ||
| 127 | bash -c "while true; do chrt -r 97 numactl --interleave=all taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 &> /dev/null; done" & PID1=$!; | ||
| 128 | else | ||
| 129 | bash -c "while true; do chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 &> /dev/null; done" & PID1=$!; | ||
| 130 | fi | ||
| 131 | # Each sample runs in its own process | ||
| 132 | for ((k=0;k<=maxJobs;k++)); do | ||
| 133 | if uname -a | grep -q "mc2"; then | ||
| 134 | chrt -r 97 numactl --interleave=all taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-DIS 1 & PID2=$!; | ||
| 135 | else | ||
| 136 | chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-DIS 1 & PID2=$!; | ||
| 137 | fi | ||
| 138 | done | ||
| 139 | # The paired task runs continuously in this configuration, so we have | ||
| 140 | # to kill it once the task that we're measuring finishes. | ||
| 141 | wait $PID2 | ||
| 142 | kill $PID1 | ||
| 143 | # Killing bash will not kill its children by default - work aronud that here | ||
| 144 | killall transitive &> /dev/null | ||
| 145 | killall matrix &> /dev/null | ||
| 146 | killall pointer &> /dev/null | ||
| 147 | killall field &> /dev/null | ||
| 148 | killall neighborhood &> /dev/null | ||
| 149 | killall update &> /dev/null | ||
| 150 | killall gen_input.py &> /dev/null | ||
| 151 | echo ${tacleProg[$i]} ${tacleProg[$j]} | ||
| 152 | done | ||
| 153 | echo COMPLETE: ${tacleProg[$i]} | ||
| 154 | done | ||
| 155 | |||
| 156 | # End contending tasks | ||
| 157 | if [[ $6 == "--contend" ]]; then | ||
| 158 | killall thrasher | ||
| 159 | fi | ||
| 160 | |||
| 161 | # Remove semaphores from system | ||
| 162 | # Leaving them won't hurt these tests, but would be messy and is bad practice | ||
| 163 | # TODO: Do this directly in the benchmarks. They should clean up after themselves | ||
| 164 | ./bin/cleanupSemaphores | ||
| 165 | |||
| 166 | # Put smp_affinty back the way it was | ||
| 167 | i=0 | ||
| 168 | for IRQ in /proc/irq/* | ||
| 169 | do | ||
| 170 | if [ -d $IRQ ]; then | ||
| 171 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 172 | fi | ||
| 173 | i=$(( $i + 1 )) | ||
| 174 | done | ||
| 175 | |||
