#!/usr/bin/env bash # GP review, Phases 2-3 (declared in docs/research/gp-review-analyses.md and gp-review-experiments.md, hashed before # the first run; exploratory; outside every lock and the reproduction archives). # scripts/run_gp_review.sh a # A1-A9 on existing outputs (scripts/51) # scripts/run_gp_review.sh e5 # E5: posterior-mean labels with the Gaussian likelihood (scripts/52) # scripts/run_gp_review.sh e6 # E6: seven registered methods at 125/250/500 iterations (scripts/52) # scripts/run_gp_review.sh e4 # E4: point tie optimizing the SMC target (scripts/52) # scripts/run_gp_review.sh e3 # E3: one shift per well (only if A3 is not sufficient; scripts/52) # scripts/run_gp_review.sh e2 tune|budget|train # E2: practitioner-grade tie (scripts/53) # scripts/run_gp_review.sh e1 # E1: anchor-noise misspecification on realizations 24-31 (scripts/54) # scripts/run_gp_review.sh summary # summaries of every finished experiment # Every stage skips jobs that already have a CSV, so any stage can be restarted with the same command. set -euo pipefail cd "$(dirname "$0")/.." PY="${PY:-.venv/bin/python}" DEVICE="${DEVICE:-cuda:0}" WORKERS="${WORKERS:-4}" THREADS="${THREADS:-2}" export OMP_NUM_THREADS=$THREADS MKL_NUM_THREADS=$THREADS OPENBLAS_NUM_THREADS=$THREADS NUMEXPR_NUM_THREADS=$THREADS \ NUMBA_NUM_THREADS=$THREADS VECLIB_MAXIMUM_THREADS=$THREADS PYTHONHASHSEED=0 stage="$1"; shift echo "== gp_review $stage $* ($(date -u +%FT%TZ))" case "$stage" in a) CUDA_VISIBLE_DEVICES= "$PY" scripts/51_gp_review.py "$@" ;; e3|e4|e5|e6) "$PY" scripts/52_gp_experiments.py --stage "$stage" --device "$DEVICE" --workers "$WORKERS" "$@" ;; e2) "$PY" scripts/53_gp_practitioner_tie.py --stage "$1" --device "$DEVICE" --workers "$WORKERS" "${@:2}" ;; e1) "$PY" scripts/54_gp_anchor_noise.py --stage "$1" --device "$DEVICE" --workers "$WORKERS" "${@:2}" ;; summary) CUDA_VISIBLE_DEVICES= "$PY" scripts/52_gp_experiments.py --stage summary [[ -f scripts/53_gp_practitioner_tie.py ]] && CUDA_VISIBLE_DEVICES= "$PY" scripts/53_gp_practitioner_tie.py --stage summary || true [[ -f scripts/54_gp_anchor_noise.py ]] && CUDA_VISIBLE_DEVICES= "$PY" scripts/54_gp_anchor_noise.py --stage summary || true ;; *) echo "unknown stage $stage" >&2; exit 2 ;; esac echo "== gp_review $stage done ($(date -u +%FT%TZ))"