This repository contains the scripts used to reproduce the performance benchmarks and (with access to the large CSZ dataset) the greedy sensor-selection application described in paper: "Sensor Placement for Tsunami Early Warning via Large-Scale Bayesian Optimal Experimental Design."
create_test_mat.py: create a synthetic 2D-chunked HDF5 matrix for scaling benchmarks.single_gpu_benchmark.py: single-GPU benchmark for naive vs Schur-update formulations.scaling_benchmark.py: multi-GPU benchmark with overlapped POSIX I/O + compute.run_scaling.sh: Slurm wrapper to run both strong + weak scaling.select_sensors.py: MPI greedy selection on an HDF5-backed CSZ (K) matrix (real dataset required).oed_hist.py: generate random-configuration baselines and (optionally) plot the histogram.
Create an environment and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtFor parallel file systems, it is recommended to disable HDF5 file locking:
export HDF5_USE_FILE_LOCKING=FALSEpython create_test_mat.py --file dummy_data.h5 --total_candidates 600 --Nt 420 --precision doublepython single_gpu_benchmark.py --max_budget 400 --Nt 420 --file ablation_results_420_single.csvThe output CSV contains peak memory and time-per-iteration for:
- Naive formulation (out-of-place / in-place)
- Schur-update formulation (out-of-place / strict in-place)
This script assumes Slurm and srun. Provide the HDF5 file and the maximum rank count to test.
bash run_scaling.sh --data dummy_data.h5 --max-ranks 512Outputs are written under scaling_results/ by default (both strong and weak scaling CSVs).
With the real HDF5 (K) matrix available on a parallel filesystem, run the greedy selection via MPI. Example:
srun -n 16 python select_sensors.py cascadia_K_matrix.h5 175 \
--r_sq 1.0 \
--checkpoint_file cascadia_optimal_results.txtGenerate random baseline scores (MPI-capable; produces a single-column checkpoint file). This run skips plotting:
python oed_hist.py \
--h5_store_K cascadia_K_matrix.h5 \
--total_samples 100 \
--budget 175 \
--checkpoint_file random_results.txt \
--no_plotPlot histogram comparing random baselines to the greedy optimum:
python oed_hist.py \
--plot_only \
--checkpoint_file random_results.txt \
--optimal_file cascadia_optimal_results.txt \
--budget 175- Large datasets (e.g., the CSZ (K) matrix) are intentionally not included in this repository.
- All scripts accept file paths via CLI arguments.