diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
| commit | 386b7d3366f1359a265da207a9cafa3edf553b64 (patch) | |
| tree | c76120c2c138faed822e4ae386be6ef22a738a78 /all_pairs/run_all_pairs.sh | |
| parent | 54a3f7091a2146b29c73a6fdc4b62a5c4ad7a3d8 (diff) | |
Reorganize and commit all the modified TACLeBench code and run scripts
Diffstat (limited to 'all_pairs/run_all_pairs.sh')
| -rwxr-xr-x | all_pairs/run_all_pairs.sh | 77 |
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 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | runID=$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]" | ||
| 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 | echo "Making sure that binaries are up to date..." | ||
| 20 | while read i; do | ||
| 21 | make bin/$i | ||
| 22 | done < $tacleNames | ||
| 23 | echo "Done. Disabling real-time throttling..." | ||
| 24 | |||
| 25 | # Turn off rt throttling | ||
| 26 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 27 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 28 | |||
| 29 | # Redirect all interrupts to core 0 | ||
| 30 | i=0 | ||
| 31 | for IRQ in /proc/irq/* | ||
| 32 | do | ||
| 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 )) | ||
| 39 | done | ||
| 40 | echo "Done. Beginning benchmarks..." | ||
| 41 | |||
| 42 | # Read the names of each benchmark | ||
| 43 | j=0 | ||
| 44 | while read i; do | ||
| 45 | tacleProg[$j]=$i | ||
| 46 | j=$(( $j + 1 )) | ||
| 47 | done < $tacleNames | ||
| 48 | |||
| 49 | |||
| 50 | num_tests=$(wc -l < $tacleNames) | ||
| 51 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 52 | do | ||
| 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]} | ||
| 61 | done | ||
| 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 | ||
| 69 | i=0 | ||
| 70 | for IRQ in /proc/irq/* | ||
| 71 | do | ||
| 72 | if [ -d $IRQ ]; then | ||
| 73 | echo ${irqList[$i]} > $IRQ/smp_affinity_list | ||
| 74 | fi | ||
| 75 | i=$(( $i + 1 )) | ||
| 76 | done | ||
| 77 | |||
