File size: 1,033 Bytes
b4396f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Chain waiter #2 (Rule #1): F1 (running) -> F2 -> arm E -> E measurements.
# Sequential: whenever the current train_v4.py process exits, launch the
# next leg immediately. Logs to ~/sera_v4_experiments/chain_f2_e.log.
set -u
LOG="$HOME/sera_v4_experiments/chain_f2_e.log"
TOOLS="$HOME/sera_v4_experiments/tools"
wait_gone() {
  for i in $(seq 1 480); do
    pgrep -f "train_v4.py" > /dev/null || return 0
    sleep 30
  done
}
echo "CHAIN2_START $(date -Is)" >> "$LOG"
wait_gone
echo "F1_PROC_GONE $(date -Is)" >> "$LOG"
bash "$TOOLS/run_f2.sh" >> "$LOG" 2>&1
echo "F2_LAUNCHED $(date -Is)" >> "$LOG"
sleep 90
wait_gone
echo "F2_PROC_GONE $(date -Is)" >> "$LOG"
bash "$TOOLS/run_arm_e.sh" >> "$LOG" 2>&1
echo "E_LAUNCHED $(date -Is)" >> "$LOG"
sleep 90
wait_gone
echo "E_PROC_GONE $(date -Is)" >> "$LOG"
setsid nohup env BATCH=8 bash "$TOOLS/measure_steps.sh" sera-v4-e-entropy e-entropy 2000 5000 10000 \
  >> "$HOME/sera_v4_experiments/measurement/e-measure.log" 2>&1 &
echo "E_MEASURE_LAUNCHED $(date -Is)" >> "$LOG"