-
Notifications
You must be signed in to change notification settings - Fork 8
/
run.sh
executable file
·44 lines (36 loc) · 873 Bytes
/
run.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
#!/bin/bash
trap 'kill $(jobs -p)' SIGINT SIGTERM EXIT
config=${2:-"config/all.conf"}
source $config
algorithm=$algorithm
if [ -z "$redis_server" ]; then
redis_server=$3
fi
if [ -z "$visdom_server" ]; then
visdom_server=$3
fi
echo "redis server:" $redis_server
echo "visdom server:" $visdom_server
pids=""
if $visdom; then
python -m visdom.server -logging_level WARNING &
pids="$pids $!"
sleep 2
fi
if $leaner; then
if [ -z "$actor_device" ]; then
python learner_node.py -r $redis_server -v $visdom_server -a $algorithm &
pids="$pids $!"
else
python learner_node.py -r $redis_server -v $visdom_server -d $actor_device -a $algorithm &
pids="$pids $!"
fi
fi
if $actor; then
for i in `seq $1`
do
python actor_node.py -n $i -t $1 -r $redis_server -v $visdom_server -a $algorithm &
pids="$pids $!"
done
fi
wait -n $pids