-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrun_all.sh
More file actions
executable file
·105 lines (88 loc) · 3.04 KB
/
Copy pathrun_all.sh
File metadata and controls
executable file
·105 lines (88 loc) · 3.04 KB
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
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
exp_dir="/data1/xtra"
L3_cache_size=20971520
# read arguments
helpFunction()
{
echo ""
echo "Usage: $0 -d exp_dir -c L3_cache_size"
echo -e "\t-d the experiment results directory"
echo -e "\t-c the L3 cache size of the current CPU"
exit 1 # Exit script after printing help
}
while getopts "d:c:" opt
do
case "$opt" in
d ) exp_dir="$OPTARG" ;;
c ) L3_cache_size="$OPTARG" ;;
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done
# Print helpFunction in case parameters are empty
if [ -z "$exp_dir" ] || [ -z "$L3_cache_size" ]
then
echo "Some or all of the parameters are empty";
helpFunction
fi
# Begin script in case all parameters are correct
echo "$exp_dir"
echo "$L3_cache_size"
# update in case some package can be missing.
sudo apt update
## auto install all packages
sudo apt install -y cmake
sudo apt install -y texlive-fonts-recommended texlive-fonts-extra
sudo apt install -y dvipng
sudo apt install -y font-manager
sudo apt install -y cm-super
sudo apt install -y python3
sudo apt install -y python3-pip
pip3 install numpy
pip3 install matplotlib
sudo apt install -y libnuma-dev
sudo apt install -y zlib1g-dev
sudo apt install -y python-tk
sudo apt install -y linux-tools-common
sudo apt install -y linux-tools-$(uname -r) # XXX is the kernel version of your linux, use uname -r to check it. e.g. 4.15.0-91-generic
sudo echo -1 > /proc/sys/kernel/perf_event_paranoid # if permission denied, try to run this at root user.
sudo modprobe msr
# download and mv datasets to exp_dir
wget https://www.dropbox.com/s/64z4xtpyhhmhojp/datasets.tar.gz
tar -zvxf datasets.tar.gz
rm datasets.tar.gz
mkdir -p $exp_dir
mv datasets $exp_dir
## Create directories on your machine.
mkdir -p $exp_dir/results/breakdown/partition_buildsort_probemerge_join
mkdir -p $exp_dir/results/breakdown/partition_only
mkdir -p $exp_dir/results/breakdown/partition_buildsort_only
mkdir -p $exp_dir/results/breakdown/partition_buildsort_probemerge_only
mkdir -p $exp_dir/results/breakdown/allIncludes
mkdir -p $exp_dir/results/figure
mkdir -p $exp_dir/results/gaps
mkdir -p $exp_dir/results/latency
mkdir -p $exp_dir/results/records
mkdir -p $exp_dir/results/timestamps
# copy custom pmu events to experiment dir.
cp pcm* $exp_dir
# copy cpu mappings to exp_dir
cp cpu-mapping.txt $exp_dir
# set all scripts exp dir
sed -i -e "s/exp_dir = .*/exp_dir = "\"${exp_dir//\//\\/}\""/g" ./hashing/scripts/*.py
exp_secction="APP_BENCH,MICRO_BENCH,SCALE_STUDY,PROFILE_MICRO,PROFILE,PROFILE_MEMORY_CONSUMPTION,PROFILE_PMU_COUNTERS"
# execute experiment
cd ./sorting/scripts || exit
bash benchmark.sh -e $exp_secction -d $exp_dir -c $L3_cache_size
cd - || exit
cd ./hashing/scripts || exit
bash benchmark.sh -e $exp_secction -d $exp_dir -c $L3_cache_size
exp_secction="PROFILE_TOPDOWN"
cd - || exit
cd ./sorting/scripts || exit
bash benchmark.sh -e $exp_secction -d $exp_dir -c $L3_cache_size
cd - || exit
cd ./hashing/scripts || exit
bash benchmark.sh -e $exp_secction -d $exp_dir -c $L3_cache_size
# draw figures
bash draw.sh
python3 jobdone.py