-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_loss.sh
executable file
·59 lines (39 loc) · 919 Bytes
/
run_loss.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
#!/usr/bin/env bash
# Change the loss percentage here
LOSS=0.1
projdir="$1"
conf=`pwd`/paxos.conf
n="$2"
if [[ x$projdir == "x" || x$n == "x" ]]; then
echo "Usage: $0 <project dir> <number of values per proposer>"
exit 1
fi
# following line kills processes that have the config file in its cmdline
KILLCMD="pkill -f $conf"
$KILLCMD
cd $projdir
../loss_set.sh $LOSS
../generate.sh $n > ../prop1
../generate.sh $n > ../prop2
echo "starting acceptors..."
./acceptor.sh 1 $conf &
./acceptor.sh 2 $conf &
./acceptor.sh 3 $conf &
sleep 1
echo "starting learners..."
./learner.sh 1 $conf > ../learn1 &
./learner.sh 2 $conf > ../learn2 &
sleep 1
echo "starting proposers..."
./proposer.sh 1 $conf &
./proposer.sh 2 $conf &
echo "waiting to start clients"
sleep 10
echo "starting clients..."
./client.sh 1 $conf < ../prop1 &
./client.sh 2 $conf < ../prop2 &
sleep 5
$KILLCMD
wait
../loss_unset.sh
cd ..