-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Yates
committed
Nov 23, 2018
1 parent
60cd7a3
commit ab44bfc
Showing
141 changed files
with
19,017 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -z $GHC_COMPILERS ]]; then | ||
GHC_COMPILERS=$HOME/ghc-8 | ||
fi | ||
|
||
# Figure, Label , benchmark, compiler , code , htm options | ||
# ------------------------------------------------------------------------------- | ||
# 1(a) , mut-hybrid , rbtree , hybrid , mut , (2,t) | ||
# 1(a) , tvar-hybrid , rbtree , hybrid , tvar , (2,t) | ||
# 1(a) , tstruct-hybrid , rbtree , hybrid , tstruct , (2,t) | ||
# 1(a) , mut-fine-hybrid , rbtree , fine , mut , (t,t) | ||
# 1(a) , tvar-fine , rbtree , fine , tvar , (t,t) | ||
# 1(a) , tstruct-fine-hybrid , rbtree , fine , tstruct , (t,t) | ||
# 1(a) , mut-fine , rbtree , fine , mut , (0,0) | ||
# 1(a) , tvar-fine , rbtree , fine , tvar , (0,0) | ||
# 1(a) , tstruct-fine , rbtree , fine , tstruct , (0,0) | ||
|
||
# 1(b) , mut-hybrid , hamt , hybrid , mut , (2,t) | ||
# 1(b) , tvar-hybrid , hamt , hybrid , tvar , (2,t) | ||
# 1(b) , tstruct-hybrid , hamt , hybrid , tstruct , (2,t) | ||
# 1(b) , mut-fine-hybrid , hamt , fine , mut , (t,t) | ||
# 1(b) , tvar-fine , hamt , fine , tvar , (t,t) | ||
# 1(b) , tstruct-fine-hybrid , hamt , fine , tstruct , (t,t) | ||
# 1(b) , mut-fine , hamt , fine , mut , (0,0) | ||
# 1(b) , tvar-fine , hamt , fine , tvar , (0,0) | ||
# 1(b) , tstruct-fine , hamt , fine , tstruct , (0,0) | ||
|
||
# 1(c) , mut-hybrid , treap , hybrid , mut , (2,t) | ||
# 1(c) , tvar-hybrid , treap , hybrid , tvar , (2,t) | ||
# 1(c) , mut-fine-hybrid , treap , fine , mut , (t,t) | ||
# 1(c) , tvar-fine , treap , fine , tvar , (t,t) | ||
# 1(c) , mut-fine , treap , fine , mut , (0,0) | ||
# 1(c) , tvar-fine , treap , fine , tvar , (0,0) | ||
|
||
# 2(a) , mut-hard , treap , hybrid , mut , (2,t) | ||
# 2(a) , tvar-hard , treap , hybrid , tvar , (2,t) | ||
# 2(a) , mut-fall , treap , hybrid , mut , (2,t) | ||
# 2(a) , tvar-fall , treap , hybrid , tvar , (2,t) | ||
# 2(a) , mut-lock , treap , hybrid , mut , (2,t) | ||
# 2(a) , tvar-lock , treap , hybrid , tvar , (2,t) | ||
|
||
# 2(b) , hamt-late , hamt , hybrid , mut , (2,t) | ||
# 2(b) , hamt-early , hamt , hybrid-early , mut , (2,t) | ||
# 2(b) , rbtree-late , rbtree , hybrid , mut , (2,t) | ||
# 2(b) , rbtree-early , rbtree , hybrid-early , mut , (2,t) | ||
# 2(b) , treap-late , treap , hybrid , mut , (2,t) | ||
# 2(b) , treap-early , treap , hybrid-early , mut , (2,t) | ||
|
||
# 2(c) , (2,t) , treap , hybrid , mut , (2,t) | ||
# 2(c) , (t,t) , treap , hybrid , mut , (t,t) | ||
# 2(c) , (2,2) , treap , hybrid , mut , (2,2) | ||
# 2(c) , (2,0) , treap , hybrid , mut , (2,0) | ||
|
||
# Compiler versions: | ||
# hybrid -- supports: | ||
# - full hybrid (2,t), (t,t), (2,2) | ||
# - lock-elision on fallback lock (0,t), (0,2) | ||
# - coarse-grain STM (0,0) | ||
# - late lock subscription | ||
# hybrid-lock -- Same as hybrid, but with early lock subscription. | ||
# fine -- supports: | ||
# - fine hybrid (t,t) (htm used for the commit of the fine-grain TM) | ||
# - fine-grain STM (0,0) (equivalant to main branch of GHC when used with TVar code) | ||
# | ||
# All versions support mutable-fields extensions. | ||
|
||
# Code variations: | ||
# mut -- Mutable fields. | ||
# tvar -- TVar-based (equivalant to main branch of GHC). | ||
# tstruct -- TStruct-based code. | ||
|
||
deps="-isrc/focus-0.1.5.2/library" | ||
deps="$deps -isrc/hashable-1.2.6.1" | ||
deps="$deps -isrc/base-prelude-1.2.0.1/library" | ||
deps="$deps -isrc/loch-th-0.2.1" | ||
deps="$deps -isrc/primitive-0.6.3.0" | ||
deps="$deps -isrc/transformers-base-0.4.4/src" | ||
deps="$deps -isrc/transformers-compat-0.5.1.4/src" | ||
deps="$deps -isrc/entropy-0.4" | ||
|
||
flags="" | ||
flags="$flags -XBangPatterns" | ||
flags="$flags -XConstraintKinds" | ||
flags="$flags -XDataKinds" | ||
flags="$flags -XDefaultSignatures" | ||
flags="$flags -XDeriveDataTypeable" | ||
flags="$flags -XDeriveFunctor" | ||
flags="$flags -XDeriveGeneric" | ||
flags="$flags -XEmptyDataDecls" | ||
flags="$flags -XFlexibleContexts" | ||
flags="$flags -XFlexibleInstances" | ||
flags="$flags -XFunctionalDependencies" | ||
flags="$flags -XGADTs" | ||
flags="$flags -XGeneralizedNewtypeDeriving" | ||
flags="$flags -XLambdaCase" | ||
flags="$flags -XMultiParamTypeClasses" | ||
flags="$flags -XMultiWayIf" | ||
flags="$flags -XNoMonomorphismRestriction" | ||
flags="$flags -XPatternGuards" | ||
flags="$flags -XPolyKinds" | ||
flags="$flags -XQuasiQuotes" | ||
flags="$flags -XRankNTypes" | ||
flags="$flags -XStandaloneDeriving" | ||
flags="$flags -XTemplateHaskell" | ||
flags="$flags -XTupleSections" | ||
flags="$flags -XTypeFamilies" | ||
flags="$flags -XTypeOperators" | ||
|
||
cbits="src/cbits/gettime.c" | ||
cbits="$cbits src/hashable-1.2.6.1/cbits/fnv.c" | ||
cbits="$cbits src/entropy-0.4/cbits/rdrand.c" | ||
cbits="$cbits src/primitive-0.6.3.0/cbits/primitive-memops.c" | ||
|
||
for compiler in hybrid hybrid-early fine; do | ||
ghc=$GHC_COMPILERS/$compiler/bin/ghc | ||
for bench in RBTREE HAMT TREAP; do | ||
for code in MUT TVAR TSTRUCT; do | ||
if [ "$bench" == "RBTREE" ]; then | ||
a="" | ||
elif [ "$bench" == "HAMT" ]; then | ||
a="" | ||
elif [ "$bench" == "TREAP" ]; then | ||
if [ "$code" == "TSTRUCT" ]; then | ||
continue | ||
fi | ||
fi | ||
|
||
n=$bench-$code-$compiler | ||
opts="-O2 -rtsopts -threaded -fno-omit-yields -msse4.2 $flags" | ||
buildopts="-no-user-package-db -outputdir .build-$n -isrc $deps" | ||
cppflags="-DBYTECOUNTER -D$bench -D$code" | ||
ccflags="--optc='-O2'" | ||
|
||
echo $ghc src/Main.hs -o bin/$n $cppflags | ||
$ghc src/Main.hs $cbits $opts $buildopts -o bin/$n $cppflags | ||
done | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
rm -rf .build-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -z $GHC_COMPILERS ]]; then | ||
GHC_COMPILERS=$HOME/ghc-8 | ||
fi | ||
|
||
run=$GHC_COMPILERS/hybrid/bin/runhaskell | ||
|
||
if [[ ! -x $run ]]; then | ||
echo "Did not find ghc here: $run" | ||
echo "GHC_COMPILERS=$GHC_COMPILERS" | ||
echo "Check that GHC_COMPILERS points to the right place." | ||
exit 1 | ||
fi | ||
|
||
N=`nproc` | ||
|
||
n=100000 | ||
m=90 | ||
q=-qatopo-cores-sockets-threads-$N | ||
s=1000 | ||
|
||
function threads() | ||
{ | ||
if [[ $1 == "t" ]]; then | ||
if [[ $2 -le 10 ]]; then | ||
count=10 | ||
else | ||
count=$2 | ||
fi | ||
else | ||
count=$1 | ||
fi | ||
} | ||
|
||
# mut-hybrid RBTREE HYBRID MUT 2 t | ||
function doBenchmark() | ||
{ | ||
label=$1 | ||
bench=$2 | ||
compiler=$3 | ||
code=$4 | ||
htm=$5 | ||
hle=$6 | ||
|
||
name=$bench-$code-$compiler | ||
exe=./bin/$name | ||
log="logs/$bench-$label.log" | ||
logs="$logs $log" | ||
echo "Benchmarking $name." | ||
rm -f "$log" &> /dev/null | ||
|
||
for t in `seq 1 $N`; do | ||
threads $htm $t | ||
thtm=$count | ||
threads $hle $t | ||
thle=$count | ||
retry="--htm-retry=$thtm --hle-retry=$thle" | ||
cmd="$exe -e $n -t $t -m $m -s $s +RTS --stm-stats $q -N$t -ki4k -kc64k -kb4k -A1m $retry" | ||
echo $cmd | ||
echo "command: $cmd" &>> $log | ||
$cmd &>> $log | ||
done | ||
} | ||
|
||
for p in a b c; do | ||
logs="" | ||
input="fig-1$p.txt" | ||
while IFS= read -r var | ||
do | ||
doBenchmark $var | ||
done < "$input" | ||
|
||
$run plot.hs "Figure 1($p)" "output/fig-1$p.html" $logs | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -z $GHC_COMPILERS ]]; then | ||
GHC_COMPILERS=$HOME/ghc-8 | ||
fi | ||
|
||
run=$GHC_COMPILERS/hybrid/bin/runhaskell | ||
|
||
N=`nproc` | ||
|
||
n=100000 | ||
m=90 | ||
q=-qatopo-cores-sockets-threads-$N | ||
s=1000 | ||
|
||
function threads() | ||
{ | ||
if [[ $1 == "t" ]]; then | ||
if [[ $2 -le 10 ]]; then | ||
count=10 | ||
else | ||
count=$2 | ||
fi | ||
else | ||
count=$1 | ||
fi | ||
} | ||
|
||
# mut-hybrid RBTREE HYBRID MUT 2 t | ||
function doBenchmark() | ||
{ | ||
label=$1 | ||
bench=$2 | ||
compiler=$3 | ||
code=$4 | ||
htm=$5 | ||
hle=$6 | ||
|
||
name=$bench-$code-$compiler | ||
exe=./bin/$name | ||
log="logs/$bench-$label.log" | ||
logs="$logs $log" | ||
echo "Benchmarking $name." | ||
rm -f "$log" &> /dev/null | ||
|
||
for t in `seq 1 $N`; do | ||
threads $htm $t | ||
thtm=$count | ||
threads $hle $t | ||
thle=$count | ||
retry="--htm-retry=$thtm --hle-retry=$thle" | ||
cmd="$exe -e $n -t $t -m $m -s $s +RTS --stm-stats $q -N$t -ki4k -kc64k -kb4k -A1m $retry" | ||
echo $cmd | ||
$cmd &>> $log | ||
echo "command: $cmd" &>> $log | ||
done | ||
} | ||
|
||
for p in a; do | ||
logs="" | ||
input="fig-2$p.txt" | ||
while IFS= read -r var | ||
do | ||
doBenchmark $var | ||
done < "$input" | ||
|
||
$run plot-stats.hs "Figure 2($p)" "output/fig-2$p.html" $logs | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -z $GHC_COMPILERS ]]; then | ||
GHC_COMPILERS=$HOME/ghc-8 | ||
fi | ||
|
||
run=$GHC_COMPILERS/hybrid/bin/runhaskell | ||
|
||
N=`nproc` | ||
|
||
n=100000 | ||
m=90 | ||
q=-qatopo-cores-sockets-threads-$N | ||
s=1000 | ||
|
||
function threads() | ||
{ | ||
if [[ $1 == "t" ]]; then | ||
if [[ $2 -le 10 ]]; then | ||
count=10 | ||
else | ||
count=$2 | ||
fi | ||
else | ||
count=$1 | ||
fi | ||
} | ||
|
||
# mut-hybrid RBTREE HYBRID MUT 2 t | ||
function doBenchmark() | ||
{ | ||
label=$1 | ||
bench=$2 | ||
compiler=$3 | ||
code=$4 | ||
htm=$5 | ||
hle=$6 | ||
|
||
name=$bench-$code-$compiler | ||
exe=./bin/$name | ||
log="logs/$bench-$label.log" | ||
logs="$logs $log" | ||
echo "Benchmarking $name." | ||
rm -f "$log" &> /dev/null | ||
|
||
for t in `seq 1 $N`; do | ||
threads $htm $t | ||
thtm=$count | ||
threads $hle $t | ||
thle=$count | ||
retry="--htm-retry=$thtm --hle-retry=$thle" | ||
cmd="$exe -e $n -t $t -m $m -s $s +RTS --stm-stats $q -N$t -ki4k -kc64k -kb4k -A1m $retry" | ||
echo $cmd | ||
$cmd &>> $log | ||
echo "command: $cmd" &>> $log | ||
done | ||
} | ||
|
||
for p in b c; do | ||
logs="" | ||
input="fig-2$p.txt" | ||
while IFS= read -r var | ||
do | ||
doBenchmark $var | ||
done < "$input" | ||
|
||
$run plot.hs "Figure 2($p)" "output/fig-2$p.html" $logs | ||
done | ||
|
Oops, something went wrong.