-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun-gam.sh
executable file
·72 lines (66 loc) · 1.87 KB
/
run-gam.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
#! /bin/bash
launch () {
dist_ratio=$1
start=$2
end=$3
script="./tpcc ${USER_ARGS} -d${dist_ratio}"
./tpcc ${USER_ARGS} -d${dist_ratio} > /dev/null 2>&1 &
for ((x=`expr $start + 1`;x<=$end;x++)); do
host=$USER@node${x}
ssh ${ssh_opts} ${host} "./tpcc ${USER_ARGS} -d${dist_ratio} > /dev/null 2>&1" &
done
wait
echo "done for ${dist_ratio}"
sleep 50
}
run_tpcc () {
start=$1 #0-based index of node to run, e.g., node0, node1...
end=$2
num_servers=`expr $end - $start + 1`
num_whs_per_node=(4 8 16)
num_threads=(4)
num_whs=(0 0 0)
for ((i=0;i<${#num_whs[@]}; i++)); do
num_whs[$i]=`expr ${num_whs_per_node[i]} \* $num_servers`
echo ${num_whs[i]}
done
for ((i=0; i<${#num_whs[@]}; i++)); do
for ((j=0; j<${#num_threads[@]}; j++)); do
thread=${num_threads[j]}
echo "" >> output.txt
USER_ARGS="-p11111 -sf${num_whs[i]} -sf1 -c${thread} -t200000"
dist_ratios=(0 10 20 30 40 50 60 70 80 90 100)
echo "warehouses:${num_whs[i]} threads:${thread} servers:$num_servers scale:1" >> output.txt
echo "USER_ARGS: ${USER_ARGS}"
for dist_ratio in ${dist_ratios[@]}; do
launch ${dist_ratio} $start $end
done
echo "DONE: warehouse num: ${num_whs[i]} thread num: ${thread}"
done
done
}
run_default () {
start=$1 #0-based index of node to run, e.g., node0, node1...
end=$2
echo "" >> output.txt
USER_ARGS="-p11111 -sf32 -sf10 -c4 -t200000"
dist_ratios=(0 10 20 30 40 50 60 70 80 90 100)
echo "warehouses:32 threads:4 servers:8 scale:10" >> output.txt
echo "USER_ARGS: ${USER_ARGS}"
for dist_ratio in ${dist_ratios[@]}; do
launch ${dist_ratio} $start $end
done
}
stop() {
start=$1
end=$2
echo $start
echo $end
sudo killall tpcc
for ((i=`expr $start + 1`; i<=$end; i++)); do
ssh -p 22 $USER@node${i} 'sudo killall tpcc'
done
}
stop 0 7
run_default 0 7
run_tpcc 0 7