From a100a322fe414021a1e5878b910a84e9df37df61 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Fri, 12 Jun 2020 01:32:55 +0000 Subject: Add inital testing infrastructure Works for three-way WSS/cache size/execution time comparisons --- dis/original/WSS_DOCS.md | 83 ++++++++++++++++++++++ dis/original/clean.sh | 1 + dis/original/gen_input.py | 113 ++++++++++++++++++++++++++++++ dis/original/inputs/WSSS | 12 ++++ dis/original/inputs/WSSS_maxstride4mb | 16 +++++ dis/original/inputs/caches | 7 ++ dis/original/inputs/caches_maxstride2ways | 11 +++ dis/original/postproc.sh | 3 + dis/original/run_dis.sh | 81 +++++++++++++++++++++ dis/original/setup_mem_and_global.sh | 13 ++++ 10 files changed, 340 insertions(+) create mode 100644 dis/original/WSS_DOCS.md create mode 100755 dis/original/clean.sh create mode 100755 dis/original/gen_input.py create mode 100644 dis/original/inputs/WSSS create mode 100644 dis/original/inputs/WSSS_maxstride4mb create mode 100644 dis/original/inputs/caches create mode 100644 dis/original/inputs/caches_maxstride2ways create mode 100755 dis/original/postproc.sh create mode 100755 dis/original/run_dis.sh create mode 100755 dis/original/setup_mem_and_global.sh diff --git a/dis/original/WSS_DOCS.md b/dis/original/WSS_DOCS.md new file mode 100644 index 0000000..da5e066 --- /dev/null +++ b/dis/original/WSS_DOCS.md @@ -0,0 +1,83 @@ +# Documentation Mapping DIS Stressmark Parameters to WSS + +## Field +1 allocation in main() +f = 1st input param + +sizeof(unsigned char) * f + +## Matrix +6 allocations in main(), 7 allocations in biConjugateGradient() + +*Allocations in main()* +dim = 2nd input param +numberNonzero = 3nd input param + +sizeof(double) * (dim^2+3dim+numberNonzero) + sizeof(int) * (2dim+1+numberNonzero) + +*Allocations in biConjugateGradient()* +sizeof(double) * 7dim + +## Neighborhood +1 allocation in createImage, 2 allocations in neighborhoodCalculation + +*Allocations in createImage()* +dimension = 3rd input param + +sizeof(short int) * dimension^2 + +*Allocations in neighborhoodCalculation()* +bitDepth = 2nd param + +sizeof(int) * (2^(bitDepth + 1) - 1) + +## Pointer +n = 5th input param +f = 1st input param + +sizeof(unsigned int) * 4n + sizeof(int) * f + +## Transitive +n = 1st input param + +sizeof(unsigned int) * 2n^2 + +## Update +f = 1st input param + +sizeof(int) * f + +## Testplan +*Problem!* Larger WSS = more computations +Use testcase #1 for non-specified parameters +Below math computed for x86_64 +- Test WSS at powers of 2: 16 KiB, 32, 64, 128, 256, 512, 1MiB, 2, 4, 8, 16, 32 +- For each WSS, measure cache allocation of 0, 1, 2, 4, 8, 16 + +### Field +Just vary first param + +f = WSS + +### Matrix +0.3 - 16% number nonzero +- Fixed at 8% +Just vary dim (matrix size) + +sizeof(double) * (dim^2+10dim+numberNonzero) + sizeof(int) * (2dim+1+numberNonzero) = WSS + + +### Neighborhood +8 or 15 bit depth +- Fix at 12? +Just vary dim (image size) + +### Pointer +10 for n +Just vary f + +### Transitive +Just vary n + +### Update +Just vary f diff --git a/dis/original/clean.sh b/dis/original/clean.sh new file mode 100755 index 0000000..7c58295 --- /dev/null +++ b/dis/original/clean.sh @@ -0,0 +1 @@ +tail -n +2 $1 | tr "-" " " | sed "s/L3:0=0000;1=0000;2=0000;3=0000/0/" | sed "s/L3:0=0000;1=0000;2=0000;3=0001/1/" | sed "s/L3:0=0000;1=0000;2=0000;3=0003/2/" | sed "s/L3:0=0000;1=0000;2=0000;3=0007/3/" | sed "s/L3:0=0000;1=0000;2=0000;3=000f/4/" | sed "s/L3:0=0000;1=0000;2=0000;3=003f/6/" | sed "s/L3:0=0000;1=0000;2=0000;3=00ff/8/" | sed "s/L3:0=0000;1=0000;2=0000;3=03ff/10/" | sed "s/L3:0=0000;1=0000;2=0000;3=0fff/12/" | sed "s/L3:0=0000;1=0000;2=0000;3=3fff/14/" | sed "s/L3:0=0000;1=0000;2=0000;3=ffff/16/" > $1.clean diff --git a/dis/original/gen_input.py b/dis/original/gen_input.py new file mode 100755 index 0000000..c7821b0 --- /dev/null +++ b/dis/original/gen_input.py @@ -0,0 +1,113 @@ +#!/usr/bin/python3 +##### +# Copyright 2020 Joshua Bakita +# +# This program generates input data for the DIS benchmark suite on stdout +# given a requested working set size. +##### + + +from ctypes import sizeof, c_double, c_int, c_short +from math import sqrt, floor +import sys # For argv and stderr + +USAGE = """Usage: {}