Commit f39fa127 authored by Philipp Götze's avatar Philipp Götze
Browse files

🔨 Adapted scripts a bit (e.g., added arguments)

parent 2a41ebea
......@@ -3,8 +3,8 @@
### LOCATIONS ###
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/bytesWritten.csv
DATA="tree_bench.data"
OUTPUT_FILE=$PWD/results/insertTx.csv
### Create header ###
if [ ! -s $OUTPUT_FILE ]; then
......@@ -16,9 +16,14 @@ bsize=512
depth=0
keypos=('first' 'middle' 'last')
LEAF_SIZES=( 256 512 1024 2048 4096 )
TREE="BitPBP" #FP/PBP/wBP
TREE_BASE="PBP" # for namespace and numKeys determination
SUFFIX="" # in case of binary vs. linear
if [ $# != 2 ]; then
TREE="UnsortedPBP" #FP/PBP/UnsortedPBP/wBP
hybrid="false"
echo "Usage: $0 [<tree-prefix> <is-hybrid>]"
else
TREE=$1
hybrid=$3
fi
### Do not change anything following here!!! ###
......@@ -29,22 +34,22 @@ fillratio=1.0
sed -i'' -e 's/\(.*BRANCH_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$bsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*DEPTH = \)\([0-9]\+\)\(.*\)/\1'"$depth"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*\"\).*\(Tree.hpp\"\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #include
sed -i'' -e 's/\(.*dbis::\).*\(tree;\)/\1'"${TREE_BASE,,}"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #namespace
sed -i'' -e 's/\(.*LEAFKEYS = getLeafKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*BRANCHKEYS = getBranchKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*TreeType = \).*\(Tree.*\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #type
sed -i'' -e 's/\(.*gPmemPath + \"\).*\(\";\)/\1'"$DATA"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #path
echo -n "Running benchmarks for ${Tree}Tree..."
for pos in "${keypos[@]}"
do
echo -en "\nKey Position: $pos - "
KEYPOS='2'
KEYPOS='(ELEMENTS+1)\/2'
if [ $pos == "first" ];then
KEYPOS='ELEMENTS'
elif [ $pos == "last" ]; then
KEYPOS='1'
elif [ $pos == "last" ]; then
KEYPOS='ELEMENTS'
fi
sed -i'' -e 's/\(.*KEYPOS = ELEMENTS\/\)\(.\+\)\(;.*\)/\1'"$KEYPOS"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*KEYPOS = \)\(.\+\)\(;.*\)/\1'"$KEYPOS"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
for lsize in "${LEAF_SIZES[@]}"
do
echo -n "$lsize "
......@@ -54,11 +59,11 @@ do
for r in {1..5}
do
rm -rf $DATA
OUTPUT="$(sh -c 'bench/tree_insert --benchmark_format=csv --benchmark_min_time=0.005' 2> /dev/null | tail -4)"
OUTPUT="$(sh -c 'bench/tree_insert --benchmark_repetitions=5 --benchmark_format=csv --benchmark_min_time=0.005' 2> /dev/null | tail -11)"
writes="$(echo "$OUTPUT" | head -1 | cut -d ':' -f2)"
elements="$(echo "$OUTPUT" | tail -3 | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -1 | cut -d ',' -f4)"
echo "${TREE}Tree$SUFFIX,$elements,$lsize,$bsize,$depth,$fillratio,$pos,$time,$writes" >> $OUTPUT_FILE
elements="$(echo "$OUTPUT" | tail -10 | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -3 | head -1 | cut -d ',' -f4)"
echo "${TREE}Tree,$elements,$lsize,$bsize,$depth,$fillratio,$pos,$time,$writes" >> $OUTPUT_FILE
done
popd > /dev/null
done
......
......@@ -3,47 +3,72 @@
### LOCATIONS ###
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/testing.csv
DATA=/mnt/pmem0/test/tree_benchL.data
OUTPUT_FILE=$PWD/results/lookup.csv
### CUSTOMIZABLE PARAMETERS ###
bsize=512
depth=1
keypos=('first' 'middle' 'last')
LEAF_SIZES=( 256 512 1024 2048 4096 )
TREE="PBP" #FP/PBP/Unsorted/wBP
TREE_BASE="PBP" #FP/PBP/wBP
SUFFIX="" # in case of binary vs. linear
### Do not change anything following here!!! ###
if [ $# != 2 ]; then
TREE="UnsortedPBP" #FP/PBP/UnsortedPBP/HPBP/wBP/wHBP
hybrid="false"
echo "Usage: $0 [<tree-prefix> <is-hybrid>]"
else
TREE=$1
hybrid=$2
fi
### needs manual adaption ###
fillratio=1.0
keypos="last" #first/middle/last
### adapting Tree usage ###
TREE_BASE=PBP
if [[ "$TREE" =~ ^(wBP|wHBP)$ ]]; then
TREE_BASE=wBP
elif [[ "$TREE" =~ ^(FP)$ ]]; then
TREE_BASE=FP
elif [[ "$TREE" =~ ^(BitPBP)$ ]]; then
TREE_BASE=BitPBP
fi
sed -i'' -e 's/\(.*BRANCH_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$bsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*DEPTH = \)\([0-9]\+\)\(.*\)/\1'"$depth"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -E -e 's/(.*HYBRID = )(0|1|false|true)(.*)/\1'"$hybrid"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*\"\).*\(Tree.hpp\"\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #include
sed -i'' -e 's/\(.*dbis::\).*\(tree;\)/\1'"${TREE_BASE,,}"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #namespace
sed -i'' -e 's/\(.*LEAFKEYS = getLeafKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*BRANCHKEYS = getBranchKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*TreeType = \).*\(Tree.*\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #type
echo -n "Running benchmarks for ${Tree}Tree..."
for lsize in "${LEAF_SIZES[@]}"
echo -n "Running benchmarks for ${TREE}Tree..."
for pos in "${keypos[@]}"
do
echo -en "\nLeaf size: $lsize"
sed -i'' -e 's/\(.*LEAF_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$lsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
rm -rf $DATA
pushd $BUILD_DIR > /dev/null
make tree_get > /dev/null
for r in {1..3}
echo -en "\nKey Position: $pos - "
KEYPOS='(LEAFKEYS+1)\/2'
if [ $pos == "first" ];then
KEYPOS='1'
elif [ $pos == "last" ]; then
KEYPOS='LEAFKEYS'
fi
sed -i'' -e 's/\(.*KEYPOS = \)\(.\+\)\(;.*\)/\1'"$KEYPOS"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
for lsize in "${LEAF_SIZES[@]}"
do
OUTPUT="$(sh -c 'bench/tree_get --benchmark_format=csv' 2> /dev/null | tail -3)"
elements="$(echo "$OUTPUT" | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -1 | cut -d ',' -f4)"
echo "${TREE}Tree$SUFFIX,$elements,$lsize,$bsize,$depth,$fillratio,$keypos,$time" >> $OUTPUT_FILE
echo -en "\nLeaf size: $lsize"
sed -i'' -e 's/\(.*LEAF_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$lsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
rm -rf $DATA
pushd $BUILD_DIR > /dev/null
make tree_get > /dev/null
for r in {1..5}
do
OUTPUT="$(sh -c 'bench/tree_get --benchmark_repetitions=5 --benchmark_format=csv' 2> /dev/null | tail -10)"
elements="$(echo "$OUTPUT" | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -3 | head -1 | cut -d ',' -f4)"
echo "${TREE}Tree,$elements,$lsize,$bsize,$depth,$fillratio,$pos,$time" >> $OUTPUT_FILE
done
popd > /dev/null
done
popd > /dev/null
done
echo -e "\nFinished. Results in $OUTPUT_FILE"
......@@ -3,57 +3,56 @@
### LOCATIONS ###
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/scanTest.csv
DATA="tree_benchS.data"
OUTPUT_FILE=$PWD/results/scan.csv
### CUSTOMIZABLE PARAMETERS ###
keypos="first" #first/middle/last
lsize=512
BRANCH_SIZES=( 256 512 1024 2048 4096 )
DEPTHS=(1 2 3 4)
TREE="PBP" #FP/PBP/wBP/wHBP
TREE_BASE="PBP" # for namespace and numKeys determination
SUFFIX="" # in case of binary vs. linear
depth=1
BRANCH_SIZES=( 256 512 1024 2048 4096 2048 1024 512 256 )
LEAF_SIZES=( 256 512 1024 2048 4096 2048 1024 512 256 )
if [ $# != 2 ]; then
TREE="UnsortedPBP" #FP/PBP/UnsortedPBP/wBP
hybrid="false"
echo "Usage: $0 [<tree-prefix> <is-hybrid>]"
else
TREE=$1
hybrid=$3
fi
### Do not change anything following here!!! ###
### needs manual adaption ###
fillratio=1.0
KEYPOS="2"
if [ $keypos == "first" ];then
KEYPOS="ELEMENTS"
elif [ $keypos == "last" ]; then
KEYPOS="1"
fi
### adapting Tree usage ###
sed -i'' -e 's/\(.*KEYPOS = ELEMENTS\/\)\(.\+\)\(;.*\)/\1'"$KEYPOS"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*LEAF_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$lsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
#sed -i'' -e 's/\(.*BRANCH_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$bsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*DEPTH = \)\([0-9]\+\)\(.*\)/\1'"$depth"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -E -e 's/(.*HYBRID = )(false|true|0|1)(.*)/\1'"$hybrid"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*\"\).*\(Tree.hpp\"\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #include
sed -i'' -e 's/\(.*dbis::\).*\(tree;\)/\1'"${TREE_BASE,,}"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #namespace
sed -i'' -e 's/\(.*LEAFKEYS = getLeafKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*BRANCHKEYS = getBranchKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*TreeType = \).*\(Tree.*\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #type
sed -i'' -e 's/\(.*gPmemPath + \"\).*\(\";\)/\1'"$DATA"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #path
echo -n "Running benchmarks for ${Tree}Tree..."
for depth in "${DEPTHS[@]}"
echo -n "Running benchmarks for ${TREE}Tree..."
for bsize in "${BRANCH_SIZES[@]}"
do
echo -en "\nTarget depth: $depth - "
sed -i'' -e 's/\(.*DEPTH = \)\([0-9]\+\)\(.*\)/\1'"$depth"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
for bsize in "${BRANCH_SIZES[@]}"
echo -en "\nBranch size: $bsize"
sed -i'' -e 's/\(.*BRANCH_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$bsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
for lsize in "${LEAF_SIZES[@]}"
do
echo -n "$bsize "
sed -i'' -e 's/\(.*BRANCH_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$bsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
echo -en "\n\tLeaf size: $lsize"
sed -i'' -e 's/\(.*LEAF_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$lsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
rm -rf $DATA
pushd $BUILD_DIR > /dev/null
make tree_scan > /dev/null
for r in {1..3}
for r in {1..5}
do
OUTPUT="$(sh -c 'bench/tree_scan --benchmark_format=csv' 2> /dev/null | tail -3)"
OUTPUT="$(sh -c 'bench/tree_scan --benchmark_repetitions=3 --benchmark_format=csv' 2> /dev/null | tail -8)"
elements="$(echo "$OUTPUT" | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -1 | cut -d ',' -f4)"
echo "${TREE}Tree$SUFFIX,$elements,$lsize,$bsize,$depth,$fillratio,$keypos,$time" >> $OUTPUT_FILE
time="$(echo "$OUTPUT" | tail -3 | head -1 | cut -d ',' -f4)"
echo "${TREE}Tree,$elements,$lsize,$bsize,$depth,$fillratio,$keypos,$time" >> $OUTPUT_FILE
done
popd > /dev/null
done
......
......@@ -3,16 +3,26 @@
### LOCATIONS ###
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/split2.csv
DATA="tree_benchSp.data"
OUTPUT_FILE=$PWD/results/splitTx.csv
### Create header ###
if [ ! -s $OUTPUT_FILE ]; then
echo "tree,tblsize,lsize,bsize,depth,fillratio,keypos,time,writes" >> $OUTPUT_FILE
fi
### CUSTOMIZABLE PARAMETERS ###
bsize=512
depth=0
LEAF_SIZES=( 256 512 1024 2048 4096 )
TREE="UnsortedPBP" #FP/PBP/wBP
TREE_BASE="PBP" # for namespace and numKeys determination
SUFFIX="" # in case of binary vs. linear
LEAF_SIZES=( 256 512 1024 2048 4096 2048 1024 512 256)
if [ $# != 3 ]; then
TREE="UnsortedPBP" #FP/PBP/UnsortedPBP/wBP
SUFFIX=""
echo "Usage: $0 [<tree-prefix> <_copy|_move>]"
else
TREE=$1
SUFFIX=$3
fi
### Do not change anything following here!!! ###
......@@ -23,10 +33,10 @@ fillratio=1.0
sed -i'' -e 's/\(.*BRANCH_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$bsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*DEPTH = \)\([0-9]\+\)\(.*\)/\1'"$depth"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*\"\).*\(Tree.hpp\"\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #include
sed -i'' -e 's/\(.*dbis::\).*\(tree;\)/\1'"${TREE_BASE,,}"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #namespace
sed -i'' -e 's/\(.*LEAFKEYS = getLeafKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*BRANCHKEYS = getBranchKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*TreeType = \).*\(Tree.*\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #type
sed -i'' -e 's/\(.*gPmemPath + \"\).*\(\";\)/\1'"$DATA"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #path
echo -n "Running benchmarks for ${Tree}Tree..."
for lsize in "${LEAF_SIZES[@]}"
......@@ -38,10 +48,10 @@ do
for r in {1..5}
do
rm -rf $DATA
OUTPUT="$(sh -c 'bench/tree_split --benchmark_format=csv --benchmark_min_time=0.01' 2> /dev/null | tail -4)"
OUTPUT="$(sh -c 'bench/tree_split --benchmark_repetitions=5 --benchmark_format=csv --benchmark_min_time=0.05' 2> /dev/null | tail -11)"
writes="$(echo "$OUTPUT" | head -1 | cut -d ':' -f2)"
elements="$(echo "$OUTPUT" | tail -3 | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -1 | cut -d ',' -f4)"
elements="$(echo "$OUTPUT" | tail -10 | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -3 | head -1 | cut -d ',' -f4)"
echo "${TREE}Tree$SUFFIX,$elements,$lsize,$bsize,$depth,$fillratio,$(($elements+1)),$time,$writes" >> $OUTPUT_FILE
done
popd > /dev/null
......
......@@ -3,17 +3,22 @@
### LOCATIONS ###
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/traverseMemory.csv
DATA=/mnt/pmem0/test/tree_bench.data
OUTPUT_FILE=$PWD/results/traverse.csv
### CUSTOMIZABLE PARAMETERS ###
keypos="middle" #first/middle/last
lsize=512
BRANCH_SIZES=( 256 512 1024 2048 4096 )
DEPTHS=(1 2 3 4)
TREE="PBP" #FP/PBP/wBP/wHBP
TREE_BASE="PBP" # for namespace and numKeys determination
SUFFIX="_b" # in case of binary vs. linear
BRANCH_SIZES=(1024 2048) # ( 256 512 1024 2048 4096 )
DEPTHS=(4) # (1 2 3 4)
if [ $# != 2 ]; then
TREE="UnsortedPBP" #FP/PBP/UnsortedPBP/wBP
hybrid="false"
echo "Usage: $0 [<tree-prefix> <is-hybrid>]"
else
TREE=$1
hybrid=$3
fi
### Do not change anything following here!!! ###
......@@ -31,12 +36,11 @@ fi
sed -i'' -e 's/\(.*KEYPOS = ELEMENTS\/\)\(.\+\)\(;.*\)/\1'"$KEYPOS"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*LEAF_SIZE = \)\([0-9]\+\)\(.*\)/\1'"$lsize"'\3/' $REPO_ROOT/src/bench/trees/common.hpp
sed -i'' -e 's/\(.*\"\).*\(Tree.hpp\"\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #include
sed -i'' -e 's/\(.*dbis::\).*\(tree;\)/\1'"${TREE_BASE,,}"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #namespace
sed -i'' -e 's/\(.*LEAFKEYS = getLeafKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*BRANCHKEYS = getBranchKeys\).*\(Tree.*\)/\1'"$TREE_BASE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #keys
sed -i'' -e 's/\(.*TreeType = \).*\(Tree.*\)/\1'"$TREE"'\2/' $REPO_ROOT/src/bench/trees/common.hpp #type
echo -n "Running benchmarks for ${Tree}Tree..."
echo -n "Running benchmarks for ${TREE}Tree..."
for depth in "${DEPTHS[@]}"
do
echo -en "\nTarget depth: $depth - "
......@@ -48,12 +52,12 @@ do
rm -rf $DATA
pushd $BUILD_DIR > /dev/null
make tree_traverse > /dev/null
for r in {1..3}
for r in {1..5}
do
OUTPUT="$(sh -c 'bench/tree_traverse --benchmark_format=csv' 2> /dev/null | tail -3)"
OUTPUT="$(sh -c 'bench/tree_traverse --benchmark_repetitions=3 --benchmark_format=csv' 2> /dev/null | tail -8)"
elements="$(echo "$OUTPUT" | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -1 | cut -d ',' -f4)"
echo "${TREE}Tree$SUFFIX,$elements,$lsize,$bsize,$depth,$fillratio,$keypos,$time" >> $OUTPUT_FILE
time="$(echo "$OUTPUT" | tail -3 | head -1 | cut -d ',' -f4)"
echo "${TREE}Tree,$elements,$lsize,$bsize,$depth,$fillratio,$keypos,$time" >> $OUTPUT_FILE
done
popd > /dev/null
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment