-
Notifications
You must be signed in to change notification settings - Fork 79
/
update_experiments.sh
executable file
·64 lines (58 loc) · 1.49 KB
/
update_experiments.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
# Pull and push latest experiment results
# Alfredo Canziani, Mar 17
# Run it as
# ./update_experiments.sh
# ./update_experiments.sh -q # quiet
# ./update_experiments.sh -i # iteratively / 5 seconds loop
if [ "$1" == "-i" ]; then
function ctrl_c {
echo -e "\nExiting."
exit 0
}
trap ctrl_c INT
echo -n "Syncing experiments every 5 seconds"
while true; do
./update_experiments.sh -q
# prints one "." every second for 5 seconds, then removes them
for (( i = 0; i < 5; i++ )); do
printf "."
sleep 1
done
printf "%.s\b" {1..5}
printf "%.s " {1..5}
printf "%.s\b" {1..5}
done
fi
if [ "$1" != "-q" ]; then verbose="--verbose"; fi
local=$(hostname)
case $local in
"GPU0") remote=$GPU8;;
"GPU8") remote=$GPU0;;
*) echo "Something's wrong"; exit -1;;
esac
# Get experimental data
if [ -n "$verbose" ]; then
echo; printf "%.s#" {1..80}; echo
echo -n "Getting experiments from $remote to $local"
echo; printf "%.s#" {1..80}; echo; echo
fi
rsync \
--update \
--archive \
$verbose \
--human-readable \
$remote:MatchNet/results/ \
../results
# Send experimental data
if [ -n "$verbose" ]; then
echo; printf "%.s#" {1..80}; echo
echo -n "Sending experiments to $remote from $local"
echo; printf "%.s#" {1..80}; echo; echo
fi
rsync \
--update \
--archive \
$verbose \
--human-readable \
../results/ \
$remote:MatchNet/results