summaryrefslogtreecommitdiffstats
path: root/all_pairs/run_all_pairs.sh
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2019-10-07 19:13:39 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2019-10-07 19:13:39 -0400
commit386b7d3366f1359a265da207a9cafa3edf553b64 (patch)
treec76120c2c138faed822e4ae386be6ef22a738a78 /all_pairs/run_all_pairs.sh
parent54a3f7091a2146b29c73a6fdc4b62a5c4ad7a3d8 (diff)
Reorganize and commit all the modified TACLeBench code and run scripts
Diffstat (limited to 'all_pairs/run_all_pairs.sh')
-rwxr-xr-xall_pairs/run_all_pairs.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/all_pairs/run_all_pairs.sh b/all_pairs/run_all_pairs.sh
new file mode 100755
index 0000000..d48f211
--- /dev/null
+++ b/all_pairs/run_all_pairs.sh
@@ -0,0 +1,77 @@
1#!/bin/bash
2
3firstCore=$1
4secondCore=$2
5maxJobs=$3
6runID=$4
7tacleNames=tacleNames.txt
8
9if [ $# -lt 4 ]; then
10 echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file]"
11 exit
12fi
13
14if [ $# -gt 4 ]; then
15 echo "Using alternate list of TACLe benchmarks from $5"
16 tacleNames=$5
17fi
18
19echo "Making sure that binaries are up to date..."
20while read i; do
21 make bin/$i
22done < $tacleNames
23echo "Done. Disabling real-time throttling..."
24
25# Turn off rt throttling
26echo -1 > /proc/sys/kernel/sched_rt_runtime_us
27echo "Done. Redirecting all interrupts to core 0..."
28
29# Redirect all interrupts to core 0
30i=0
31for IRQ in /proc/irq/*
32do
33 # Skip default_smp_affinity
34 if [ -d $IRQ ]; then
35 irqList[$i]=$(cat $IRQ/smp_affinity_list)
36 echo 0 > $IRQ/smp_affinity_list
37 fi
38 i=$(( $i + 1 ))
39done
40echo "Done. Beginning benchmarks..."
41
42# Read the names of each benchmark
43j=0
44while read i; do
45 tacleProg[$j]=$i
46 j=$(( $j + 1 ))
47done < $tacleNames
48
49
50num_tests=$(wc -l < $tacleNames)
51for (( i = 0; i < $num_tests ; i++ ))
52do
53 for (( j = $i; j < $num_tests ; j++ )) #loop through programs
54 do
55 chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $firstCore $secondCore ${tacleProg[$j]} $runID"-A" 1 & \
56 chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$j]} ${tacleProg[$j]} $maxJobs $secondCore $firstCore ${tacleProg[$i]} $runID"-B" 2 &
57 wait
58 echo ${tacleProg[$i]} ${tacleProg[$j]}
59 done
60 echo COMPLETE: ${tacleProg[$i]}
61done
62
63# Remove semaphores from system
64# Leaving them won't hurt these tests, but would be messy and is bad practice
65# TODO: Do this directly in the benchmarks. They should clean up after themselves
66./bin/cleanupSemaphores
67
68# Put smp_affinty back the way it was
69i=0
70for IRQ in /proc/irq/*
71do
72 if [ -d $IRQ ]; then
73 echo ${irqList[$i]} > $IRQ/smp_affinity_list
74 fi
75 i=$(( $i + 1 ))
76done
77