summaryrefslogtreecommitdiff
path: root/research/flossing/flossing_suite/watch_and_summarize.sh
diff options
context:
space:
mode:
Diffstat (limited to 'research/flossing/flossing_suite/watch_and_summarize.sh')
-rwxr-xr-xresearch/flossing/flossing_suite/watch_and_summarize.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/research/flossing/flossing_suite/watch_and_summarize.sh b/research/flossing/flossing_suite/watch_and_summarize.sh
new file mode 100755
index 0000000..a75c250
--- /dev/null
+++ b/research/flossing/flossing_suite/watch_and_summarize.sh
@@ -0,0 +1,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"