summaryrefslogtreecommitdiffstats
path: root/baseline
diff options
context:
space:
mode:
Diffstat (limited to 'baseline')
-rw-r--r--baseline/Makefile8
-rwxr-xr-xbaseline/run_baseline_L3_ONLY.sh152
-rw-r--r--baseline/source/anagram/anagram.c6
-rw-r--r--baseline/source/anagram/anagram_stdlib.c2
-rw-r--r--baseline/source/huff_enc/huff_enc.c2
-rw-r--r--baseline/source/rijndael_dec/rijndael_dec.c1
-rwxr-xr-xbaseline/summarize.py34
-rw-r--r--baseline/tacleNames.txt18
8 files changed, 22 insertions, 201 deletions
diff --git a/baseline/Makefile b/baseline/Makefile
index 40b57f4..a929bc6 100644
--- a/baseline/Makefile
+++ b/baseline/Makefile
@@ -1,6 +1,6 @@
1LIBLITMUS ?= /media/speedy/litmus/liblitmus 1LIBLITMUS ?= /playpen/mc2/liblitmus
2CC ?= gcc 2CC ?= gcc
3CFLAGS = -pthread -O2 -I.. 3override CFLAGS = -pthread -O2 -I..
4LDFLAGS = -lrt 4LDFLAGS = -lrt
5COMMON = ../extra.h 5COMMON = ../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
13ifneq ($(shell grep "define LITMUS 1" ../extra.h),) 13ifneq ($(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
16endif 16endif
17 17
18all: 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 18all: 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
3core=$1
4maxJobs=$2
5userRunID=$3
6tacleNames=tacleNames.txt
7
8if [ $# -lt 3 ]; then
9 echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]"
10 exit
11fi
12
13if [ $# -gt 3 ]; then
14 echo "Using alternate list of TACLe benchmarks from $4"
15 tacleNames=$4
16fi
17
18if [ "$EUID" -ne 0 ]
19then
20 echo "You need to be root to enable interrupt isolation and real-time execution!"
21 exit
22fi
23
24echo "Making sure that binaries are up to date..."
25while read i; do
26 make bin/$i
27done < $tacleNames
28echo "Done. Disabling real-time throttling..."
29
30# Turn off rt throttling
31echo -1 > /proc/sys/kernel/sched_rt_runtime_us
32echo "Done. Redirecting all interrupts to core 0..."
33
34# Redirect all interrupts to core 0
35i=0
36for IRQ in /proc/irq/*
37do
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 ))
44done
45
46# Read the names of each benchmark
47j=0
48while read i; do
49 tacleProg[$j]=$i
50 j=$(( $j + 1 ))
51done < $tacleNames
52
53echo "Done. Checking for wbinvd module..."
54if [[ ! -f "/proc/wbinvd" ]]; then
55 echo "ERROR: wbinvd module not loaded. Exiting..."
56 exit
57fi
58
59# Enable L3 isolation
60echo "Done. Enabling L3 isolation..."
61mount -t resctrl resctrl /sys/fs/resctrl
62mkdir -p /sys/fs/resctrl/benchmarks
63echo $1 > /sys/fs/resctrl/benchmarks/cpus_list
64# Reset global bandwith control and remove L3 from global
65echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
66echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
67# Alloc L3 to benchmark
68echo "L3:0=0000;1=0000;2=0000;3=00ff" > /sys/fs/resctrl/benchmarks/schemata
69echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
70echo "Done. Verifying configuration with user..."
71
72# Generate file name string
73# We append to this as we parse the environment settings
74runID=$(date +"%b%d-%H")
75
76# Confirm configuration with user
77echo "=== Global Config ==="
78cat /sys/fs/resctrl/schemata
79echo "=== Core $1 Config ==="
80cat /sys/fs/resctrl/benchmarks/cpus_list
81cat /sys/fs/resctrl/benchmarks/schemata
82if [[ $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
89else
90 runID=$runID-xc
91fi
92if uname -a | grep -q "mc2"; then
93 echo "MC^2 Autodetected. NOT SUPPORTED. Exiting..."
94 exit
95else
96 echo "MC^2 not detected. 50% L3 allocation enabled."
97 runID=$runID-i3
98fi
99if pwd | grep -qi dis; then
100 echo "Autodetected DIS. Will use script-level looping."
101fi
102echo "Results will be saved as $runID-$userRunID.txt"
103echo "Press enter to confirm environment, Ctrl-C to exit..."
104read
105
106# Start contending tasks
107if [[ $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 &
116fi
117sleep 1 # Wait for contending tasks to start
118echo "Done. Beginning benchmarks..."
119
120num_tests=$(wc -l < $tacleNames)
121for (( i = 0; i < $num_tests ; i++ ))
122do
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]}
136done
137
138# End contending tasks
139if [[ $5 == "--contend" ]]; then
140 killall thrasher
141fi
142
143# Put smp_affinty back the way it was
144i=0
145for IRQ in /proc/irq/*
146do
147 if [ -d $IRQ ]; then
148 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
149 fi
150 i=$(( $i + 1 ))
151done
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 )
346int anagram_return( void ) 346int anagram_return( void )
347{ 347{
348 int i; 348 int i;
349 char const *answer = "duke rip amy"; 349 char const *answer = "duke yip arm";
350 350
351 for ( i = 0; i < 12; i++ ) 351 for ( i = 0; i < 12; i++ )
352 if ( answer[ i ] != anagram_buffer[ i ] ) 352 if ( answer[ i ] != anagram_buffer[ i ] )
diff --git a/baseline/source/anagram/anagram_stdlib.c b/baseline/source/anagram/anagram_stdlib.c
index c766a5e..5c9f3fc 100644
--- a/baseline/source/anagram/anagram_stdlib.c
+++ b/baseline/source/anagram/anagram_stdlib.c
@@ -126,7 +126,7 @@ void anagram_qsort( void *va, unsigned long n, unsigned long es )
126 126
127 127
128/* This must be redefined for each new benchmark */ 128/* This must be redefined for each new benchmark */
129#define ANAGRAM_HEAP_SIZE 18000 129#define ANAGRAM_HEAP_SIZE 20388
130 130
131static char anagram_simulated_heap[ANAGRAM_HEAP_SIZE]; 131static char anagram_simulated_heap[ANAGRAM_HEAP_SIZE];
132static unsigned int anagram_freeHeapPos; 132static unsigned int anagram_freeHeapPos;
diff --git a/baseline/source/huff_enc/huff_enc.c b/baseline/source/huff_enc/huff_enc.c
index f2db552..6a0b901 100644
--- a/baseline/source/huff_enc/huff_enc.c
+++ b/baseline/source/huff_enc/huff_enc.c
@@ -153,6 +153,8 @@ void huff_enc_init( void )
153{ 153{
154 huff_enc_input_pos = 0; 154 huff_enc_input_pos = 0;
155 huff_enc_output_pos = 0; 155 huff_enc_output_pos = 0;
156 huff_enc_byte_nb_to_write = 0;
157 huff_enc_val_to_write = 0;
156} 158}
157 159
158 160
diff --git a/baseline/source/rijndael_dec/rijndael_dec.c b/baseline/source/rijndael_dec/rijndael_dec.c
index c8f606b..5c0bea8 100644
--- a/baseline/source/rijndael_dec/rijndael_dec.c
+++ b/baseline/source/rijndael_dec/rijndael_dec.c
@@ -68,6 +68,7 @@ void rijndael_dec_init( void )
68 rijndael_dec_fin.data = rijndael_dec_data; 68 rijndael_dec_fin.data = rijndael_dec_data;
69 rijndael_dec_fin.size = 32768; 69 rijndael_dec_fin.size = 32768;
70 rijndael_dec_fin.cur_pos = 0; 70 rijndael_dec_fin.cur_pos = 0;
71 rijndael_dec_checksum = 0;
71 72
72 unsigned i; 73 unsigned i;
73 volatile int x = 0; 74 volatile int x = 0;
diff --git a/baseline/summarize.py b/baseline/summarize.py
deleted file mode 100755
index 82f82d9..0000000
--- a/baseline/summarize.py
+++ /dev/null
@@ -1,34 +0,0 @@
1#!/usr/bin/python3
2import sys
3
4f = sys.argv[1]
5res = {}
6mem_res = {}
7memw_res = {}
8samples = {}
9
10with open(f) as fp:
11 for line in fp:
12 s = line.split()
13 if s[0] not in res:
14 print(s[0])
15 res[s[0]] = int(s[5])
16 mem_res[s[0]] = int(s[8])
17 memw_res[s[0]] = int(s[9])
18 samples[s[0]] =int(s[4])
19 else:
20 res[s[0]] += int(s[5])
21 mem_res[s[0]] += int(s[8])
22 memw_res[s[0]] += int(s[9])
23
24print("Average times:")
25for r in res.keys():
26 print(res[r]/samples[r])
27
28print("Average memory read:")
29for r in mem_res.keys():
30 print(mem_res[r]/samples[r])
31
32print("Average memory write:")
33for r in memw_res.keys():
34 print(memw_res[r]/samples[r])
diff --git a/baseline/tacleNames.txt b/baseline/tacleNames.txt
index 8f4845a..2e02966 100644
--- a/baseline/tacleNames.txt
+++ b/baseline/tacleNames.txt
@@ -1,19 +1,23 @@
1petrinet 1petrinet
2ndes
3statemate 2statemate
4adpcm_dec 3ndes
4h264_dec
5huff_dec
5cjpeg_wrbmp 6cjpeg_wrbmp
7fmref
8audiobeam
9adpcm_dec
6adpcm_enc 10adpcm_enc
11g723_enc
12huff_enc
13gsm_dec
7cjpeg_transupp 14cjpeg_transupp
8dijkstra
9epic 15epic
10fmref 16anagram
11gsm_dec
12h264_dec
13huff_enc
14rijndael_enc 17rijndael_enc
15rijndael_dec 18rijndael_dec
16gsm_enc 19gsm_enc
17susan 20susan
21dijkstra
18ammunition 22ammunition
19mpeg2 23mpeg2