summaryrefslogtreecommitdiff
path: root/research/flossing/flossing_suite/watch_and_summarize.sh
blob: a75c250862175bf527b37efd0950cf2e5c735db7 (plain)
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
#!/usr/bin/env bash
set -euo pipefail

ROOT="/home/yurenh2/rrm"
PY="/home/yurenh2/miniconda3/envs/rrm/bin/python"
cd "${ROOT}"

if [[ "$#" -gt 0 ]]; then
  pid_files=("$@")
else
  pid_files=(research/flossing/flossing_suite/results/trm_faithful/trm_seed123_*.pid)
fi

echo "watching ${#pid_files[@]} pid files"
for pf in "${pid_files[@]}"; do
  [[ -f "${pf}" ]] || continue
  pid="$(cat "${pf}")"
  echo "watch ${pf}: pid ${pid}"
  while kill -0 "${pid}" 2>/dev/null; do
    sleep 60
  done
  echo "done ${pf}: pid ${pid}"
done

"${PY}" research/flossing/flossing_suite/summarize_flossing.py
bash research/flossing/flossing_suite/status.sh > research/flossing/flossing_suite/results/summary/final_status.txt
echo "watch complete"