summaryrefslogtreecommitdiffstats
path: root/dis
diff options
context:
space:
mode:
Diffstat (limited to 'dis')
-rwxr-xr-xdis/Makefile8
-rwxr-xr-xdis/bin/field_2mb2
-rwxr-xr-xdis/bin/matrix_2mb2
-rwxr-xr-xdis/bin/neighborhood_2mb2
-rwxr-xr-xdis/bin/pointer_2mb2
-rwxr-xr-xdis/bin/transitive_2mb2
-rwxr-xr-xdis/bin/update_2mb2
-rw-r--r--dis/dis2MbInNames.txt6
-rw-r--r--dis/disPairs2MbInNames.txt6
-rwxr-xr-xdis/run_dis.sh92
-rwxr-xr-xdis/setup_mem_and_global.sh22
-rwxr-xr-xdis/summarize.py69
12 files changed, 16 insertions, 199 deletions
diff --git a/dis/Makefile b/dis/Makefile
index df93116..d18761b 100755
--- a/dis/Makefile
+++ b/dis/Makefile
@@ -2,9 +2,9 @@
2# Build the DIS benchmarks with all-pairs or unpaired instrumentation 2# Build the DIS benchmarks with all-pairs or unpaired instrumentation
3# (I know that this Makefile is mildly evil and breaks so many rules 3# (I know that this Makefile is mildly evil and breaks so many rules
4# that a good Makefile should follow. Sorry - at least I have one.) 4# that a good Makefile should follow. Sorry - at least I have one.)
5LIBLITMUS ?= /media/speedy/litmus/liblitmus 5LIBLITMUS ?= /playpen/mc2/liblitmus
6CC ?= gcc 6CC ?= gcc
7CFLAGS += -pthread -O2 -I.. 7override CFLAGS += -pthread -O2 -I..
8LDFLAGS = -lrt -lm 8LDFLAGS = -lrt -lm
9COMMON = ../extra.h 9COMMON = ../extra.h
10 10
@@ -15,8 +15,8 @@ endif
15 15
16# Include all the LITMUS^RT headers if we're using it 16# Include all the LITMUS^RT headers if we're using it
17ifneq ($(shell grep "define LITMUS 1" ../extra.h),) 17ifneq ($(shell grep "define LITMUS 1" ../extra.h),)
18 CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include 18 override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include
19 LDFLAGS += -L${LIBLITMUS} -llitmus 19 override LDFLAGS += -L${LIBLITMUS} -llitmus
20endif 20endif
21 21
22all: baseline 22all: baseline
diff --git a/dis/bin/field_2mb b/dis/bin/field_2mb
deleted file mode 100755
index 31f2a8d..0000000
--- a/dis/bin/field_2mb
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py field inputs/Field/in0 2097152 | ./field $@
diff --git a/dis/bin/matrix_2mb b/dis/bin/matrix_2mb
deleted file mode 100755
index 72710ab..0000000
--- a/dis/bin/matrix_2mb
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py matrix inputs/Matrix/in4 2097152 | ./matrix $@ > /dev/null
diff --git a/dis/bin/neighborhood_2mb b/dis/bin/neighborhood_2mb
deleted file mode 100755
index 226bd98..0000000
--- a/dis/bin/neighborhood_2mb
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 | ./neighborhood $@ > /dev/null
diff --git a/dis/bin/pointer_2mb b/dis/bin/pointer_2mb
deleted file mode 100755
index 3ce8f2b..0000000
--- a/dis/bin/pointer_2mb
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py pointer inputs/Pointer/in0 2097152 | ./pointer $@
diff --git a/dis/bin/transitive_2mb b/dis/bin/transitive_2mb
deleted file mode 100755
index b8bcf5a..0000000
--- a/dis/bin/transitive_2mb
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py transitive inputs/Transitive/in0 2097152 | ./transitive $@
diff --git a/dis/bin/update_2mb b/dis/bin/update_2mb
deleted file mode 100755
index 3bc33f4..0000000
--- a/dis/bin/update_2mb
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py update inputs/Update/in0 2097152 | ./update $@
diff --git a/dis/dis2MbInNames.txt b/dis/dis2MbInNames.txt
new file mode 100644
index 0000000..00e6a22
--- /dev/null
+++ b/dis/dis2MbInNames.txt
@@ -0,0 +1,6 @@
1field ./gen_input.py field inputs/Field/in0 2097152
2matrix ./gen_input.py matrix inputs/Matrix/in0 2097152
3neighborhood ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152
4pointer ./gen_input.py pointer inputs/Pointer/in0 2097152
5transitive ./gen_input.py transitive inputs/Transitive/in0 2097152
6update ./gen_input.py update inputs/Update/in0 2097152
diff --git a/dis/disPairs2MbInNames.txt b/dis/disPairs2MbInNames.txt
new file mode 100644
index 0000000..a45ead4
--- /dev/null
+++ b/dis/disPairs2MbInNames.txt
@@ -0,0 +1,6 @@
1field_all ./gen_input.py field inputs/Field/in0 2097152
2matrix_all ./gen_input.py matrix inputs/Matrix/in0 2097152
3neighborhood_all ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152
4pointer_all ./gen_input.py pointer inputs/Pointer/in0 2097152
5transitive_all ./gen_input.py transitive inputs/Transitive/in0 2097152
6update_all ./gen_input.py update inputs/Update/in0 2097152
diff --git a/dis/run_dis.sh b/dis/run_dis.sh
deleted file mode 100755
index 78745ec..0000000
--- a/dis/run_dis.sh
+++ /dev/null
@@ -1,92 +0,0 @@
1#!/bin/bash
2
3core=$1
4maxJobs=$2
5runID=$3
6benchmark=${4,}
7template_input=inputs/$4/in0
8wss_settings=inputs/WSSS
9cache_settings=inputs/caches
10
11if [ $# -lt 4 ]; then
12 echo "Usage $0 <core ID> <number of iterations> <run ID> <benchmark> [template input] [DIS WSS file] [DIS cache file]"
13 exit
14fi
15
16if [ $# -gt 4 ]; then
17 echo "Using alternate input template from $5"
18 template_input=$5
19fi
20
21if [ $# -gt 5 ]; then
22 echo "Using alternate WSS settings from $6"
23 wss_settings=$6
24fi
25
26if [ $# -gt 6 ]; then
27 echo "Using alternate cache settings from $7"
28 cache_settings=$7
29fi
30
31echo "Making sure that binary is up to date..."
32make $benchmark
33echo "Done. Disabling real-time throttling..."
34
35# Turn off rt throttling
36echo -1 > /proc/sys/kernel/sched_rt_runtime_us
37echo "Done. Redirecting all interrupts to core 0..."
38
39# Redirect all interrupts to core 0
40i=0
41for IRQ in /proc/irq/*
42do
43 # Skip default_smp_affinity
44 if [ -d $IRQ ]; then
45 irqList[$i]=$(cat $IRQ/smp_affinity_list)
46 echo 0 2> /dev/null > $IRQ/smp_affinity_list
47 fi
48 i=$(( $i + 1 ))
49done
50
51echo "Done. Checking for wbinvd module..."
52if [[ ! -f "/proc/wbinvd" ]]; then
53 echo "ERROR: wbinvd module not loaded. Exiting..."
54 exit
55fi
56
57# Enable L3 isolation
58echo "Done. Enabling L3 isolation..."
59mount -t resctrl resctrl /sys/fs/resctrl
60mkdir -p /sys/fs/resctrl/benchmarks
61echo $1 > /sys/fs/resctrl/benchmarks/cpus_list
62# Reset global bandwith control and remove L3 from global
63echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
64echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
65# Alloc L3 to benchmark
66echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
67echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
68echo "Done. Beginning benchmarks..."
69
70# Execute the benchmark for each WSS and cache config
71while read j; do
72 echo $j > /sys/fs/resctrl/benchmarks/schemata
73 while read i; do
74 if grep -q "#define LITMUS 1" ../baseline/source/extra.h; then
75 echo "Using LITMUS-RT!"
76 ./gen_input.py $benchmark $template_input $i | numactl -m 0 ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
77 else
78 ./gen_input.py $benchmark $template_input $i | chrt -r 97 numactl -m 0 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
79 fi
80 done < $wss_settings
81done < $cache_settings
82
83# Put IRQs back as they were
84i=0
85for IRQ in /proc/irq/*
86do
87 if [ -d $IRQ ]; then
88 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
89 fi
90 i=$(( $i + 1 ))
91done
92
diff --git a/dis/setup_mem_and_global.sh b/dis/setup_mem_and_global.sh
deleted file mode 100755
index 6bddb2f..0000000
--- a/dis/setup_mem_and_global.sh
+++ /dev/null
@@ -1,22 +0,0 @@
1# Setup group
2mount -t resctrl resctrl /sys/fs/resctrl
3mkdir -p /sys/fs/resctrl/benchmarks
4echo 15 > /sys/fs/resctrl/benchmarks/cpus_list
5echo 31 > /sys/fs/resctrl/benchmarks/cpus_list
6# Remove mem from global domain and assign to local
7echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
8echo "L3:0=ffff;1=ffff;2=ffff;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
9if [[ $1 == "--bandwith" ]]; then
10 # Remove bandwidth from global domain
11 echo "MB:0=2;1=2;2=2;3=2" > /sys/fs/resctrl/schemata
12 echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
13else
14 # Disable bandwidth control
15 echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
16 echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
17fi
18echo "=== Global Config ==="
19cat /sys/fs/resctrl/schemata
20echo "=== Core 15 & 31 Config ==="
21cat /sys/fs/resctrl/benchmarks/schemata
22
diff --git a/dis/summarize.py b/dis/summarize.py
deleted file mode 100755
index 31dcccc..0000000
--- a/dis/summarize.py
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/python3
2import sys
3
4f = sys.argv[1]
5if len(sys.argv) < 2:
6 print("Usage "+sys.argv[0]+" <filename> --inf-precision")
7res = {}
8mem_res = {}
9memw_res = {}
10samples = {}
11max_res = {}
12
13with open(f) as fp:
14 for line in fp:
15 s = line.split()
16 if s[0] not in res:
17# print(s[0])
18 res[s[0]] = list([int(s[5])])#)int(s[5])
19 mem_res[s[0]] = int(s[8])
20 memw_res[s[0]] = int(s[9])
21 samples[s[0]] = int(s[4])
22 max_res[s[0]] = int(s[5])
23 else:
24 res[s[0]].append(int(s[5]))
25 mem_res[s[0]] += int(s[8])
26 memw_res[s[0]] += int(s[9])
27 max_res[s[0]] = max(int(s[5]), max_res[s[0]])
28## {{{ http://code.activestate.com/recipes/511478/ (r1)
29import math
30import functools
31
32def percentile(N, percent, key=lambda x:x):
33 """
34 Find the percentile of a list of values.
35
36 @parameter N - is a list of values. Note N MUST BE already sorted.
37 @parameter percent - a float value from 0.0 to 1.0.
38 @parameter key - optional key function to compute value from each element of N.
39
40 @return - the percentile of the values
41 """
42 if not N:
43 return None
44 k = (len(N)-1) * percent
45 f = math.floor(k)
46 c = math.ceil(k)
47 if f == c:
48 return key(N[int(k)])
49 d0 = key(N[int(f)]) * (c-k)
50 d1 = key(N[int(c)]) * (k-f)
51 return d0+d1
52## end of http://code.activestate.com/recipes/511478/ }}}
53avg_max = 0
54avg_99th = 0
55avg_avg = 0
56print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t")
57for r in sorted(res.keys()):
58# print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r]))
59 avg_avg += sum(res[r])/len(res[r])
60 avg_max += max(res[r])
61 avg_99th += percentile(sorted(res[r]), 0.99)
62 if len(sys.argv) > 2 and sys.argv[2] == "--inf-precision":
63 print("{:12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r]))
64 else:
65 print("{:12.12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r]))
66
67print("Average average:", avg_avg/len(res.keys()))
68print("Average max:", avg_max/len(res.keys()))
69print("Average 99th:", avg_99th/len(res.keys()))