forked from thustorage/pacman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eval_value_size.sh
executable file
·94 lines (75 loc) · 2.31 KB
/
eval_value_size.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#! /bin/bash -e
if [[ $(basename $PWD) != "scripts" ]]; then
echo 'run this script in "scripts"'
exit
fi
help() {
echo "Usage: $0 <db_type> <with_pacman>"
echo " <db_type>: 1: FlatStore-H, 2: FlatStore-PH, 3: FlatStore-FF, 4: FlatStore-M, 5: Viper"
echo " <apply_pacman>: 0: false, 1: true"
}
if [[ $# != 2 || $1 < 1 || $1 > 5 || ($2 != 0 && $2 != 1) ]]; then
help
exit
fi
# to avoid no available space
./clean_pmem_dir.sh
if [[ $1 == 1 || $1 == 2 || $1 == 5 ]]; then
INDEX_TYPE=1
elif [[ $1 == 3 ]]; then
INDEX_TYPE=2
elif [[ $1 == 4 ]]; then
INDEX_TYPE=3
fi
if [[ $1 == 1 || $1 == 4 || $1 == 5 ]]; then
IDX_PERSISTENT="-DIDX_PERSISTENT=OFF"
else
IDX_PERSISTENT="-DIDX_PERSISTENT=ON"
fi
if [[ $1 != 5 ]]; then
TARGET="pacman_bench"
TARGET_CMD="./benchmarks/pacman_bench"
else
TARGET="viper_bench"
TARGET_CMD="./benchmarks/other/viper_bench"
WITH_OTHERS="-DEVAL_OTHER_SYSTEMS=ON"
fi
PACMAN_OPT=""
if [[ $2 == 1 ]]; then
PACMAN_OPT="-DPACMAN=ON"
fi
FILTER="--benchmark_filter=/(80)/.*/threads:(12)$"
SKEW="true" # true (Zipfian), false (uniform)
NUMA_AFFINITY=0
mkdir -p ../results
mkdir -p ../build
cd ../build
OUTPUT_FILE=../results/value_size_$1_$2
TMP_OUTPUT=../results/value_size_$1_$2_tmp
# clean the result file
cat /dev/null > ${OUTPUT_FILE}
# disable cpu scaling
sudo cpupower frequency-set --governor performance > /dev/null
VALUE_SIZE=(32 64 128 256 512 1024)
# it may take long to get third-party dependencies, so don't delete _deps
ls | grep -v _deps | xargs rm -rf
for size in "${VALUE_SIZE[@]}"; do
echo | tee -a ${OUTPUT_FILE}
echo ${size} | tee -a ${OUTPUT_FILE}
# build
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_NUMA_NODE=${NUMA_AFFINITY} \
${WITH_OTHERS} -DINDEX_TYPE=${INDEX_TYPE} ${IDX_PERSISTENT} ${PACMAN_OPT} \
-DNUM_KEYS=200000000 -DNUM_OPS_PER_THREAD=25000000 \
-DNUM_WARMUP_OPS_PER_THREAD=25000000 -DVALUE_SIZE=${size} \
-DNUM_GC_THREADS=4 -DSKEW=${SKEW} ..
make ${TARGET} -j
# clean cache
sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
numactl --membind=${NUMA_AFFINITY} --cpunodebind=${NUMA_AFFINITY} \
${TARGET_CMD} --benchmark_repetitions=1 ${FILTER} \
--benchmark_out=${TMP_OUTPUT} --benchmark_out_format=json
cat ${TMP_OUTPUT} >> ${OUTPUT_FILE}
sleep 5s
done
rm ${TMP_OUTPUT}
sudo cpupower frequency-set --governor powersave > /dev/null