From ec0512af6bbb8ba05eb13fc1aac7754283dd13aa Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Tue, 20 Oct 2020 18:20:39 -0400 Subject: Unify unpaired timing scripts for DIS, TACLe, and SD-VBS Now supports specifying an input generation command for each benchmark - see dis/dis2MbInNames.txt for an example. --- dis/bin/field_2mb | 2 -- dis/bin/matrix_2mb | 2 -- dis/bin/neighborhood_2mb | 2 -- dis/bin/pointer_2mb | 2 -- dis/bin/transitive_2mb | 2 -- dis/bin/update_2mb | 2 -- dis/dis2MbInNames.txt | 6 ++++ dis/run_dis.sh | 92 ------------------------------------------------ 8 files changed, 6 insertions(+), 104 deletions(-) delete mode 100755 dis/bin/field_2mb delete mode 100755 dis/bin/matrix_2mb delete mode 100755 dis/bin/neighborhood_2mb delete mode 100755 dis/bin/pointer_2mb delete mode 100755 dis/bin/transitive_2mb delete mode 100755 dis/bin/update_2mb create mode 100644 dis/dis2MbInNames.txt delete mode 100755 dis/run_dis.sh (limited to 'dis') 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 @@ -#!/bin/bash -taskset -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 @@ -#!/bin/bash -taskset -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 @@ -#!/bin/bash -taskset -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 @@ -#!/bin/bash -taskset -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 @@ -#!/bin/bash -taskset -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 @@ -#!/bin/bash -taskset -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 @@ +field ./gen_input.py field inputs/Field/in0 2097152 +matrix ./gen_input.py matrix inputs/Matrix/in0 2097152 +neighborhood ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 +pointer ./gen_input.py pointer inputs/Pointer/in0 2097152 +transitive ./gen_input.py transitive inputs/Transitive/in0 2097152 +update ./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 @@ -#!/bin/bash - -core=$1 -maxJobs=$2 -runID=$3 -benchmark=${4,} -template_input=inputs/$4/in0 -wss_settings=inputs/WSSS -cache_settings=inputs/caches - -if [ $# -lt 4 ]; then - echo "Usage $0 [template input] [DIS WSS file] [DIS cache file]" - exit -fi - -if [ $# -gt 4 ]; then - echo "Using alternate input template from $5" - template_input=$5 -fi - -if [ $# -gt 5 ]; then - echo "Using alternate WSS settings from $6" - wss_settings=$6 -fi - -if [ $# -gt 6 ]; then - echo "Using alternate cache settings from $7" - cache_settings=$7 -fi - -echo "Making sure that binary is up to date..." -make $benchmark -echo "Done. Disabling real-time throttling..." - -# Turn off rt throttling -echo -1 > /proc/sys/kernel/sched_rt_runtime_us -echo "Done. Redirecting all interrupts to core 0..." - -# Redirect all interrupts to core 0 -i=0 -for IRQ in /proc/irq/* -do - # Skip default_smp_affinity - if [ -d $IRQ ]; then - irqList[$i]=$(cat $IRQ/smp_affinity_list) - echo 0 2> /dev/null > $IRQ/smp_affinity_list - fi - i=$(( $i + 1 )) -done - -echo "Done. Checking for wbinvd module..." -if [[ ! -f "/proc/wbinvd" ]]; then - echo "ERROR: wbinvd module not loaded. Exiting..." - exit -fi - -# Enable L3 isolation -echo "Done. Enabling L3 isolation..." -mount -t resctrl resctrl /sys/fs/resctrl -mkdir -p /sys/fs/resctrl/benchmarks -echo $1 > /sys/fs/resctrl/benchmarks/cpus_list -# Reset global bandwith control and remove L3 from global -echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata -echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata -# Alloc L3 to benchmark -echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata -echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata -echo "Done. Beginning benchmarks..." - -# Execute the benchmark for each WSS and cache config -while read j; do - echo $j > /sys/fs/resctrl/benchmarks/schemata - while read i; do - if grep -q "#define LITMUS 1" ../baseline/source/extra.h; then - echo "Using LITMUS-RT!" - ./gen_input.py $benchmark $template_input $i | numactl -m 0 ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 - else - ./gen_input.py $benchmark $template_input $i | chrt -r 97 numactl -m 0 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 - fi - done < $wss_settings -done < $cache_settings - -# Put IRQs back as they were -i=0 -for IRQ in /proc/irq/* -do - if [ -d $IRQ ]; then - echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list - fi - i=$(( $i + 1 )) -done - -- cgit v1.2.2 From 859a1095e19eef6a10e429d1a2c58ffba7238a76 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Wed, 21 Oct 2020 14:08:09 -0400 Subject: Remove duplicate summary script and don't output memory info if non present --- dis/summarize.py | 69 -------------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100755 dis/summarize.py (limited to 'dis') 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 @@ -#!/usr/bin/python3 -import sys - -f = sys.argv[1] -if len(sys.argv) < 2: - print("Usage "+sys.argv[0]+" --inf-precision") -res = {} -mem_res = {} -memw_res = {} -samples = {} -max_res = {} - -with open(f) as fp: - for line in fp: - s = line.split() - if s[0] not in res: -# print(s[0]) - res[s[0]] = list([int(s[5])])#)int(s[5]) - mem_res[s[0]] = int(s[8]) - memw_res[s[0]] = int(s[9]) - samples[s[0]] = int(s[4]) - max_res[s[0]] = int(s[5]) - else: - res[s[0]].append(int(s[5])) - mem_res[s[0]] += int(s[8]) - memw_res[s[0]] += int(s[9]) - max_res[s[0]] = max(int(s[5]), max_res[s[0]]) -## {{{ http://code.activestate.com/recipes/511478/ (r1) -import math -import functools - -def percentile(N, percent, key=lambda x:x): - """ - Find the percentile of a list of values. - - @parameter N - is a list of values. Note N MUST BE already sorted. - @parameter percent - a float value from 0.0 to 1.0. - @parameter key - optional key function to compute value from each element of N. - - @return - the percentile of the values - """ - if not N: - return None - k = (len(N)-1) * percent - f = math.floor(k) - c = math.ceil(k) - if f == c: - return key(N[int(k)]) - d0 = key(N[int(f)]) * (c-k) - d1 = key(N[int(c)]) * (k-f) - return d0+d1 -## end of http://code.activestate.com/recipes/511478/ }}} -avg_max = 0 -avg_99th = 0 -avg_avg = 0 -print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t") -for r in sorted(res.keys()): -# print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r])) - avg_avg += sum(res[r])/len(res[r]) - avg_max += max(res[r]) - avg_99th += percentile(sorted(res[r]), 0.99) - if len(sys.argv) > 2 and sys.argv[2] == "--inf-precision": - 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])) - else: - 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])) - -print("Average average:", avg_avg/len(res.keys())) -print("Average max:", avg_max/len(res.keys())) -print("Average 99th:", avg_99th/len(res.keys())) -- cgit v1.2.2 From 4f634d4cd3254dfc68b65e63be32708105032101 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 22 Oct 2020 00:24:34 -0400 Subject: Fix Makefiles so that a custom CFLAGS doesn't break the build --- dis/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dis') diff --git a/dis/Makefile b/dis/Makefile index df93116..88fa7c2 100755 --- a/dis/Makefile +++ b/dis/Makefile @@ -4,7 +4,7 @@ # that a good Makefile should follow. Sorry - at least I have one.) LIBLITMUS ?= /media/speedy/litmus/liblitmus CC ?= gcc -CFLAGS += -pthread -O2 -I.. +override CFLAGS += -pthread -O2 -I.. LDFLAGS = -lrt -lm COMMON = ../extra.h -- cgit v1.2.2 From 601ed25a4c5b66cb75315832c15613a727db2c26 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 22 Oct 2020 01:48:46 -0400 Subject: Remove an old and broken script --- dis/setup_mem_and_global.sh | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100755 dis/setup_mem_and_global.sh (limited to 'dis') 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 @@ -# Setup group -mount -t resctrl resctrl /sys/fs/resctrl -mkdir -p /sys/fs/resctrl/benchmarks -echo 15 > /sys/fs/resctrl/benchmarks/cpus_list -echo 31 > /sys/fs/resctrl/benchmarks/cpus_list -# Remove mem from global domain and assign to local -echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata -echo "L3:0=ffff;1=ffff;2=ffff;3=ffff" > /sys/fs/resctrl/benchmarks/schemata -if [[ $1 == "--bandwith" ]]; then - # Remove bandwidth from global domain - echo "MB:0=2;1=2;2=2;3=2" > /sys/fs/resctrl/schemata - echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata -else - # Disable bandwidth control - echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata - echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata -fi -echo "=== Global Config ===" -cat /sys/fs/resctrl/schemata -echo "=== Core 15 & 31 Config ===" -cat /sys/fs/resctrl/benchmarks/schemata - -- cgit v1.2.2 From 163c440444c74a4e0bbe0a8db3d1ca725413994b Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 22 Oct 2020 03:17:31 -0400 Subject: Make SD-VBS compatible with run_bench.sh and cleanup SD-VBS: - Run silently - Fix some whitespace errors - Don't duplicate extra.h - Auto-detect if building with LITMUS-RT - Disable result checking - Add helper symlinks Misc: - Remove unused code from libextra - Set some missing rt_param fields in libextra - Disable CSV info dump from computeSMTslowdown.sh - Widen scope of .gitignore on .txt files - Include list of 2MB DIS pair benchmarks and inputs --- dis/disPairs2MbInNames.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 dis/disPairs2MbInNames.txt (limited to 'dis') 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 @@ +field_all ./gen_input.py field inputs/Field/in0 2097152 +matrix_all ./gen_input.py matrix inputs/Matrix/in0 2097152 +neighborhood_all ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 +pointer_all ./gen_input.py pointer inputs/Pointer/in0 2097152 +transitive_all ./gen_input.py transitive inputs/Transitive/in0 2097152 +update_all ./gen_input.py update inputs/Update/in0 2097152 -- cgit v1.2.2 From a7c3210215bd1181ae93b23c313941dfb44519fb Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 22 Oct 2020 22:46:39 -0400 Subject: Transform LITMUS-RT support in libextra to imply case-study mode Adds and parameters to benchmarks and disables cache flushing when compiled with LITMUS. Also fixes build with LITMUS enabled on yamaha.cs.unc.edu. Also allows output to be disabled, automatically infers _rt_lock_id, and allows for a specific pair ID for paired tasks. (The pair ID is added to all the semaphore and shared memory names, allowing multiple pairs to run in the system at a time.) --- dis/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dis') diff --git a/dis/Makefile b/dis/Makefile index 88fa7c2..d18761b 100755 --- a/dis/Makefile +++ b/dis/Makefile @@ -2,7 +2,7 @@ # Build the DIS benchmarks with all-pairs or unpaired instrumentation # (I know that this Makefile is mildly evil and breaks so many rules # that a good Makefile should follow. Sorry - at least I have one.) -LIBLITMUS ?= /media/speedy/litmus/liblitmus +LIBLITMUS ?= /playpen/mc2/liblitmus CC ?= gcc override CFLAGS += -pthread -O2 -I.. LDFLAGS = -lrt -lm @@ -15,8 +15,8 @@ endif # Include all the LITMUS^RT headers if we're using it ifneq ($(shell grep "define LITMUS 1" ../extra.h),) - CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include - LDFLAGS += -L${LIBLITMUS} -llitmus + override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include + override LDFLAGS += -L${LIBLITMUS} -llitmus endif all: baseline -- cgit v1.2.2 From e0217a963c6c0e0667d41d075038685956bcfacf Mon Sep 17 00:00:00 2001 From: leochanj Date: Fri, 23 Oct 2020 02:11:48 -0400 Subject: wip --- dis/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dis') diff --git a/dis/Makefile b/dis/Makefile index d18761b..77e0b8a 100755 --- a/dis/Makefile +++ b/dis/Makefile @@ -2,7 +2,7 @@ # Build the DIS benchmarks with all-pairs or unpaired instrumentation # (I know that this Makefile is mildly evil and breaks so many rules # that a good Makefile should follow. Sorry - at least I have one.) -LIBLITMUS ?= /playpen/mc2/liblitmus +LIBLITMUS ?= /home/litmus/liblitmus CC ?= gcc override CFLAGS += -pthread -O2 -I.. LDFLAGS = -lrt -lm -- cgit v1.2.2