forked from coq-community/chapar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·126 lines (100 loc) · 3.19 KB
/
run
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
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
. ./common
serverCount=$1
opsCount=$2
putPercent=$3
echo "======================================================"
echo "Server count: $serverCount"
echo "Operation count: $opsCount"
echo "Put percent: $putPercent"
# echo
# echo "Making ..."
# make
# echo $launcherNode
# echo $masterNode
# for (( i=0; i < 4; i++ ))
# do
# echo ${workerNodes[$i]}
# done
# echo $keyRange
# echo $repeatCount
echo
echo "Generating benchmarks ..."
mkdir -p bench
for (( i=0; i < $serverCount; i++ ))
do
./benchgen.native bench/Bench${i}.dat $opsCount $keyRange $putPercent
ssh ${workerNodes[$i]} "mkdir -p ~/Runner/Worker$i"
scp bench/Bench${i}.dat ${workerNodes[$i]}:~/Runner/Worker$i
done
echo
echo "Sending code ..."
for (( i=0; i < $serverCount; i++ ))
do
ssh ${workerNodes[$i]} "pkill launchStore"
scp Settings.txt ${workerNodes[$i]}:~/Runner/Worker$i
for (( algNo=${alg1}; algNo <= ${alg2}; algNo++ ))
do
scp _build/ml/launchStore${algNo}.native ${workerNodes[$i]}:~/Runner/Worker$i
done
done
ssh $masterNode "mkdir -p ~/Runner/Master"
ssh $masterNode "pkill launchStore"
scp Settings.txt $masterNode:~/Runner/Master
for (( algNo=${alg1}; algNo <= ${alg2}; algNo++ ))
do
scp _build/ml/launchStore${algNo}.native $masterNode:~/Runner/Master
done
echo
echo "Running ..."
for (( algNo=${alg1}; algNo <= ${alg2}; algNo++ ))
do
echo
echo "Algorithm: $algNo"
echo "---------------------------------------------" >> AllOutputs.txt
echo "Algorithm: $algNo" >> AllOutputs.txt
echo "Server count: $serverCount" >> AllOutputs.txt
echo "Operation count: $opsCount" >> AllOutputs.txt
echo "Put percent: $putPercent" >> AllOutputs.txt
echo "---------------------------------------------" >> AllResults.txt
echo "Algorithm: $algNo" >> AllResults.txt
echo "Server count: $serverCount" >> AllResults.txt
echo "Operation count: $opsCount" >> AllResults.txt
echo "Put percent: $putPercent" >> AllResults.txt
for (( j=1; j <= $repeatCount; j++ ))
do
echo
echo "Run: $j"
echo "Launching ..."
date
for (( i=0; i < $serverCount; i++ ))
do
ssh ${workerNodes[$i]} "cd ~/Runner/Worker$i; rm -f Results.txt; nohup ./launchStore${algNo}.native ${serverCount} ${i} Bench${i}.dat > Output.txt 2>&1 &"
done
sleep 1
ssh $masterNode "cd ~/Runner/Master; rm -f Results.txt; ./launchStore${algNo}.native ${serverCount} -1 > Output.txt"
echo "Receiving and saving results ..."
for (( i=0; i < $serverCount; i++ ))
do
scp ${workerNodes[$i]}:~/Runner/Worker$i/Output.txt Output${i}.txt
done
scp $masterNode:~/Runner/Master/Output.txt OutputM.txt
cat Output* >> AllOutputs.txt
rm Output*
rm -f TempResult.txt
for (( i=0; i < $serverCount; i++ ))
do
scp ${workerNodes[$i]}:~/Runner/Worker$i/Result.txt Result${i}.txt
done
cat Result* >> TempResult.txt
echo "Results ..."
cat TempResult.txt
echo "Run: $j" >> AllResults.txt
cat TempResult.txt >> AllResults.txt
rm Result*
rm TempResult.txt
echo "Sleeping for 10 seconds before the next run ..."
sleep 10
# sleep 30
done
done