diff options
Diffstat (limited to 'baseline')
| -rw-r--r-- | baseline/Makefile | 8 | ||||
| -rwxr-xr-x | baseline/run_baseline_L3_ONLY.sh | 152 | ||||
| -rw-r--r-- | baseline/source/anagram/anagram.c | 6 | ||||
| -rw-r--r-- | baseline/source/anagram/anagram_stdlib.c | 2 | ||||
| -rw-r--r-- | baseline/source/huff_enc/huff_enc.c | 2 | ||||
| -rw-r--r-- | baseline/source/rijndael_dec/rijndael_dec.c | 1 | ||||
| -rwxr-xr-x | baseline/summarize.py | 34 | ||||
| -rw-r--r-- | baseline/tacleNames.txt | 18 |
8 files changed, 22 insertions, 201 deletions
diff --git a/baseline/Makefile b/baseline/Makefile index 40b57f4..1d90c7f 100644 --- a/baseline/Makefile +++ b/baseline/Makefile | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | LIBLITMUS ?= /media/speedy/litmus/liblitmus | 1 | LIBLITMUS ?= /home/litmus/liblitmus |
| 2 | CC ?= gcc | 2 | CC ?= gcc |
| 3 | CFLAGS = -pthread -O2 -I.. | 3 | override CFLAGS = -pthread -O2 -I.. |
| 4 | LDFLAGS = -lrt | 4 | LDFLAGS = -lrt |
| 5 | COMMON = ../extra.h | 5 | COMMON = ../extra.h |
| 6 | 6 | ||
| @@ -11,8 +11,8 @@ endif | |||
| 11 | 11 | ||
| 12 | # Include all the LITMUS^RT headers if we're using it | 12 | # Include all the LITMUS^RT headers if we're using it |
| 13 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) | 13 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) |
| 14 | CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 14 | override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include |
| 15 | LDFLAGS += -L${LIBLITMUS} -llitmus | 15 | override LDFLAGS += -L${LIBLITMUS} -llitmus |
| 16 | endif | 16 | endif |
| 17 | 17 | ||
| 18 | all: bin/cjpeg_wrbmp bin/huff_enc bin/gsm_enc bin/dijkstra bin/h264_dec bin/susan bin/adpcm_enc bin/rijndael_dec bin/huff_dec bin/rijndael_enc bin/gsm_dec bin/anagram bin/epic bin/ammunition bin/g723_enc bin/ndes bin/petrinet bin/statemate bin/cjpeg_transupp bin/mpeg2 bin/fmref bin/audiobeam bin/adpcm_dec | 18 | all: bin/cjpeg_wrbmp bin/huff_enc bin/gsm_enc bin/dijkstra bin/h264_dec bin/susan bin/adpcm_enc bin/rijndael_dec bin/huff_dec bin/rijndael_enc bin/gsm_dec bin/anagram bin/epic bin/ammunition bin/g723_enc bin/ndes bin/petrinet bin/statemate bin/cjpeg_transupp bin/mpeg2 bin/fmref bin/audiobeam bin/adpcm_dec |
diff --git a/baseline/run_baseline_L3_ONLY.sh b/baseline/run_baseline_L3_ONLY.sh deleted file mode 100755 index 4183653..0000000 --- a/baseline/run_baseline_L3_ONLY.sh +++ /dev/null | |||
| @@ -1,152 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | core=$1 | ||
| 4 | maxJobs=$2 | ||
| 5 | userRunID=$3 | ||
| 6 | tacleNames=tacleNames.txt | ||
| 7 | |||
| 8 | if [ $# -lt 3 ]; then | ||
| 9 | echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 10 | exit | ||
| 11 | fi | ||
| 12 | |||
| 13 | if [ $# -gt 3 ]; then | ||
| 14 | echo "Using alternate list of TACLe benchmarks from $4" | ||
| 15 | tacleNames=$4 | ||
| 16 | fi | ||
| 17 | |||
| 18 | if [ "$EUID" -ne 0 ] | ||
| 19 | then | ||
| 20 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 21 | exit | ||
| 22 | fi | ||
| 23 | |||
| 24 | echo "Making sure that binaries are up to date..." | ||
| 25 | while read i; do | ||
| 26 | make bin/$i | ||
| 27 | done < $tacleNames | ||
| 28 | echo "Done. Disabling real-time throttling..." | ||
| 29 | |||
| 30 | # Turn off rt throttling | ||
| 31 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 32 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 33 | |||
| 34 | # Redirect all interrupts to core 0 | ||
| 35 | i=0 | ||
| 36 | for IRQ in /proc/irq/* | ||
| 37 | do | ||
| 38 | # Skip default_smp_affinity | ||
| 39 | if [ -d $IRQ ]; then | ||
| 40 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 41 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 42 | fi | ||
| 43 | i=$(( $i + 1 )) | ||
| 44 | done | ||
| 45 | |||
| 46 | # Read the names of each benchmark | ||
| 47 | j=0 | ||
| 48 | while read i; do | ||
| 49 | tacleProg[$j]=$i | ||
| 50 | j=$(( $j + 1 )) | ||
| 51 | done < $tacleNames | ||
| 52 | |||
| 53 | echo "Done. Checking for wbinvd module..." | ||
| 54 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 55 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 56 | exit | ||
| 57 | fi | ||
| 58 | |||
| 59 | # Enable L3 isolation | ||
| 60 | echo "Done. Enabling L3 isolation..." | ||
| 61 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 62 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 63 | echo $1 > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 64 | # Reset global bandwith control and remove L3 from global | ||
| 65 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 66 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 67 | # Alloc L3 to benchmark | ||
| 68 | echo "L3:0=0000;1=0000;2=0000;3=00ff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 69 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 70 | echo "Done. Verifying configuration with user..." | ||
| 71 | |||
| 72 | # Generate file name string | ||
| 73 | # We append to this as we parse the environment settings | ||
| 74 | runID=$(date +"%b%d-%H") | ||
| 75 | |||
| 76 | # Confirm configuration with user | ||
| 77 | echo "=== Global Config ===" | ||
| 78 | cat /sys/fs/resctrl/schemata | ||
| 79 | echo "=== Core $1 Config ===" | ||
| 80 | cat /sys/fs/resctrl/benchmarks/cpus_list | ||
| 81 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 82 | if [[ $5 == "--contend" ]]; then | ||
| 83 | if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then | ||
| 84 | echo "ERROR: thrasher binary not fonud. Exiting..." | ||
| 85 | exit | ||
| 86 | fi | ||
| 87 | echo "Will run 6 contending tasks" | ||
| 88 | runID=$runID-c | ||
| 89 | else | ||
| 90 | runID=$runID-xc | ||
| 91 | fi | ||
| 92 | if uname -a | grep -q "mc2"; then | ||
| 93 | echo "MC^2 Autodetected. NOT SUPPORTED. Exiting..." | ||
| 94 | exit | ||
| 95 | else | ||
| 96 | echo "MC^2 not detected. 50% L3 allocation enabled." | ||
| 97 | runID=$runID-i3 | ||
| 98 | fi | ||
| 99 | if pwd | grep -qi dis; then | ||
| 100 | echo "Autodetected DIS. Will use script-level looping." | ||
| 101 | fi | ||
| 102 | echo "Results will be saved as $runID-$userRunID.txt" | ||
| 103 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 104 | read | ||
| 105 | |||
| 106 | # Start contending tasks | ||
| 107 | if [[ $5 == "--contend" ]]; then | ||
| 108 | echo "Done. Starting 6 contending tasks..." | ||
| 109 | # Run two contending tasks on each other CCX | ||
| 110 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 111 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 112 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 113 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 114 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 115 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
| 116 | fi | ||
| 117 | sleep 1 # Wait for contending tasks to start | ||
| 118 | echo "Done. Beginning benchmarks..." | ||
| 119 | |||
| 120 | num_tests=$(wc -l < $tacleNames) | ||
| 121 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 122 | do | ||
| 123 | # If using DIS, we have to iterate in the script as DIS won't do it for us | ||
| 124 | pwd | grep -qi dis | ||
| 125 | iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))") | ||
| 126 | for ((k=0;k<=iters;k++)); do | ||
| 127 | # Check if we're using LITMUS^RT or not | ||
| 128 | if [[ -f source/extra.h ]] && grep -q "#define LITMUS 1" source/extra.h; then | ||
| 129 | ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | ||
| 130 | else | ||
| 131 | # Interleave memory allocations between all nodes (only 1 node w/out MC^2) | ||
| 132 | chrt -r 97 numactl --interleave=all taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1 | ||
| 133 | fi | ||
| 134 | done | ||
| 135 | echo COMPLETE: ${tacleProg[$i]} | ||
| 136 | done | ||
| 137 | |||
| 138 | # End contending tasks | ||
| 139 | if [[ $5 == "--contend" ]]; then | ||
| 140 | killall thrasher | ||
| 141 | fi | ||
| 142 | |||
| 143 | # Put smp_affinty back the way it was | ||
| 144 | i=0 | ||
| 145 | for IRQ in /proc/irq/* | ||
| 146 | do | ||
| 147 | if [ -d $IRQ ]; then | ||
| 148 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 149 | fi | ||
| 150 | i=$(( $i + 1 )) | ||
| 151 | done | ||
| 152 | |||
diff --git a/baseline/source/anagram/anagram.c b/baseline/source/anagram/anagram.c index fc8b6a8..feb9784 100644 --- a/baseline/source/anagram/anagram.c +++ b/baseline/source/anagram/anagram.c | |||
| @@ -305,10 +305,10 @@ void anagram_ReadDict( void ) | |||
| 305 | _Pragma( "loopbound min 1 max 5" ) | 305 | _Pragma( "loopbound min 1 max 5" ) |
| 306 | while ( anagram_dictionary[ i ][ strlen ] != 0 ) | 306 | while ( anagram_dictionary[ i ][ strlen ] != 0 ) |
| 307 | strlen ++; | 307 | strlen ++; |
| 308 | len += strlen + 2; | 308 | len += strlen + 3; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len ); | 311 | pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len + 1 ); |
| 312 | 312 | ||
| 313 | _Pragma( "loopbound min 2279 max 2279" ) | 313 | _Pragma( "loopbound min 2279 max 2279" ) |
| 314 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { | 314 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { |
| @@ -346,7 +346,7 @@ void anagram_init( void ) | |||
