-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_servers.sh
More file actions
33 lines (21 loc) · 874 Bytes
/
start_servers.sh
File metadata and controls
33 lines (21 loc) · 874 Bytes
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
#!/bin/bash
num_servers=5
threshold=3
num_clients=3
num_channels=30
phaseLength=500
timeoutMs=1000
exe="./target/release/runner"
session="DistLib"
tmux set -g remain-on-exit on
tmux new-session -d -s $session
WORK_DIR=$(mktemp -d)
for ((id=0; id < $num_servers; id++))
do
tmux new-window -a -n "Server $id" "$exe --num_servers $num_servers -t $threshold --num_clients $num_clients --num_channels $num_channels --timeout $timeoutMs --phase_length $phaseLength server --id $id &> $WORK_DIR/s-$id &; tail -f $WORK_DIR/s-$id"
done
for ((id=0; id < $num_clients; id++))
do
tmux new-window -a -n "Client $id" "$exe --num_servers $num_servers -t $threshold --num_clients $num_clients --num_channels $num_channels --timeout $timeoutMs --phase_length $phaseLength client --id $id &> $WORK_DIR/c-$id &; tail -f $WORK_DIR/c-$id"
done
tmux attach-session -t $session