This page summarizes script entrypoints currently included in the scaffold.
scripts/finalize_attempt.py- Generates manifest/checksums, writes terminal marker, finalizes attempt directory.
scripts/verify_attempt_integrity.py- Verifies file checksums for an attempt.
scripts/archive_attempt.py- Creates a compressed archive for an attempt.
scripts/verify_archive.py- Validates archive readability and checksum metadata.
scripts/audit_preservation.py- Audits attempt completeness and marker consistency across
data/runs.
- Audits attempt completeness and marker consistency across
scripts/validate_run_layout.py- Confirms expected top-level run directories exist.
The following are scaffolded placeholders and should be implemented for production execution:
scripts/canonicalize_cases.pyscripts/register_case.pyscripts/run_pf.pyscripts/run_dc_opf.py
-
scripts/build_pf_anchor_index.py- Builds a deterministic Parquet index and checksum manifest from successful
AC-OPF
samples.jsonlrecords for downstream PF candidate generation.
- Builds a deterministic Parquet index and checksum manifest from successful
AC-OPF
-
scripts/generate_pf_candidates.py- Generates seeded control-distance, topology, criticality, and response-policy quotas from the anchor index.
- Streams candidates to an
.in_progressJSONL and atomically publishes the completed file, avoiding retention of all expanded candidates in memory.
-
scripts/run_campaign_pf_round.py- Validates PF candidate schemas, applies explicit contingency response
policies, reuses a persistent PowerModels process, and writes resumable
samples and a manifest under
<runs_root>/pf/. - Validates residuals, controls, voltage/reactive/thermal limits, and exact AC-OPF anchor consistency; preserves each outcome in a separate partition.
- Validates PF candidate schemas, applies explicit contingency response
policies, reuses a persistent PowerModels process, and writes resumable
samples and a manifest under
-
scripts/reduce_pf_campaign_shards.py- Atomically merges PF diversity, boundary, and coverage ledgers across shards and aggregates active-constraint counts while retaining prior rounds.
-
scripts/create_operating_point.py- Generates structured operating-point candidates for adaptive campaigns (parametric perturbations plus reference load snapshots when a snapshot registry exists).
-
scripts/enumerate_contingencies.py- Enumerates physically credible contingency candidates (N-1 and sequential N-1-1) for a case.
-
scripts/screen_contingencies.py- Applies multi-trigger screening and audit tagging to enumerated contingency candidates.
scripts/compare_solver_consistency.py- Compares ExaGO and pandapower AC-OPF outputs on MATPOWER cases and writes a consistency report.
scripts/phase1_gate.py- Phase-1 gate combining solver-consistency and preservation-audit checks.
Implemented workflow command:
scripts/run_ac_opf.py- Runs AC-OPF through
PowerModelsAdapterfor selected MATPOWER cases. - Creates full preservation-first attempt directories under
data/runs/ac_opf/.... - Writes normalized outputs, validation placeholders, manifests/checksums, terminal marker, and appends run registry records.
- Runs AC-OPF through
scripts/run_scopf.py- Runs coupled nonlinear AC SCOPF through
PowerModelsSecurityConstrained.run_c1_scopfand Ipopt. - Accepts a JSON contingency-set object, a JSON array, or campaign JSONL rows with nested
contingencyobjects; case-tagged JSONL rows are filtered for each selected case. - Requires static branch or generator N-1 events and rejects sequential or simultaneous N-k inputs before allocating an attempt.
- Preserves the resolved case and contingency set, raw and normalized results, solver provenance, logs, timing, checksums, terminal marker, and SCOPF run-registry record.
- Runs coupled nonlinear AC SCOPF through
scripts/run_exago_ac_opf.py- Runs AC-OPF through ExaGO OPFLOW for selected MATPOWER cases.
- Parses OPFLOW text output into structured
raw_result.solutionfields (bus,branch,gen) for downstream HydraGNN-style OPF training conversion. - Creates full preservation-first attempt directories and appends run registry records with runtime metadata.
scripts/run_pandapower_ac_opf.py- Runs AC-OPF through pandapower for selected MATPOWER cases.
- Creates full preservation-first attempt directories and appends run registry records with runtime metadata.
scripts/run_campaign_ac_opf_round.py- Runs a campaign round of AC-OPF attempts across cases, topologies, operating points, and contingencies via
PowerModelsAdapter. - Applies operating-point and contingency transforms (including reference load snapshots) to each parsed case before solving.
- Encodes the applied contingency into the output path via a deterministic
contingency_sluglevel. --resumeskips any candidate whose deterministic output directory already has a finalized attempt; the round report then addsskipped_countand computesfailure_fractionover solvable (non-skipped) candidates. See Resumable Campaigns.
- Runs a campaign round of AC-OPF attempts across cases, topologies, operating points, and contingencies via
scripts/run_campaign_exago_ac_opf_round.py- ExaGO GPU variant of the campaign map worker: same transforms, ledgers, resume, and reporting as
run_campaign_ac_opf_round.py, but solves each candidate with ExaGOopflow. - Serializes each transformed case back to a MATPOWER
.mnetfile (write_matpower_case) so ExaGO solves the identical reduced network PowerModels sees. --solver-modeselectsgpu_then_ipopt(default),gpu_only, oripopt_only; GPU usesHIOPSPARSEGPU/PBPOLRAJAHIOPSPARSEwith IPOPT fallback.- Captures the power-balance duals (
mult_Pmis/mult_Qmis) on every bus from the ExaGO JSON export (LAM_P/LAM_Q) or the stdout summary fallback, matching the single-case and PowerModels paths. - Records a normalized
feasibility_label(feasible/infeasible/indeterminate/error) on each sample and round-report row; both feasible and infeasible solves are persisted (see Schema Contracts). opflowis launched under aulimit -c 0/HSA_ENABLE_COREDUMP=0guard so a GPU or IPOPT abort on an infeasible case fails cleanly instead of writing a multi-GBcore/gpucore.*file; the worker then falls back to IPOPT.- Environment: set
PGDF_EXAGO_VERBOSE=1for maximum ExaGO/HiOp verbosity, which also writes one per-shardsolver_verbose.log(each attempt's stdout/stderr) next tosamples.jsonl; setPGDF_EXAGO_SRUN_PREFIXto launch eachopflowas its own singleton Slurm step. - Requires a Python env with
pyarrowfor Parquet ledgers (see Setup); driven byconfigs/slurm/frontier_exago_acopf_mapreduce_8n_2h.sbatch.
- ExaGO GPU variant of the campaign map worker: same transforms, ledgers, resume, and reporting as
scripts/register_load_snapshots.py- Discovers per-scenario MATPOWER snapshot files for a case and registers them as reference load operating points.
- Writes
data/operating_point_registry/<case_id>/load_snapshots.jsonwith season, voltage regime, difficulty, and per-bus loads.
scripts/shard_selected_candidates.py- Deterministically shards selected-candidate JSONL files.
- Produces fixed shard files and a manifest for map-stage parallel execution.
- Supports coverage gates (for example by dataset/topology) and deterministic pool-based backfill before sharding.
--assignment contiguous --streamcreates balanced consecutive input ranges with bounded memory; the Riker PF launcher uses this mode.
scripts/reduce_campaign_shards.py- Deterministically merges shard campaign ledgers and shard AC execution reports back into the target campaign.
- Aggregates active-constraint ledger rows by
(constraint_family, component_id)and writes a reduce report marker per round.
scripts/launch_ultrascale_campaign.py- Plans or submits chained map/reduce Slurm rounds with full parameter exports (budget, sharding, coverage gate, backfill, solver runtime settings).
- Supports dependency-chained submission (
afterok) for continuous multi-round campaigns.
scripts/drive_campaign.py- Auto-detects the furthest incomplete round (lowest round whose reduce marker is missing or not
ok) and resubmits it withRESUME=1so the job resumes interrupted work. --chainqueues all subsequent rounds, each chained viaafterok, for unattended multi-round completion.- Splits budgets across rounds (
--total-budgetwith--budget-schedule) and passes through extra env with repeatable--set KEY=VALUE;--nodes/--ntasks-per-node/--cpus-per-task/--timeoverride the sbatch header;--dry-runprints the plan without submitting. See Resumable Campaigns.
- Auto-detects the furthest incomplete round (lowest round whose reduce marker is missing or not
scripts/monitor_campaign.py- Read-only progress dashboard for a map/reduce campaign round: bootstrap sub-stage, candidate counts, shards done/total, aggregated solved/failed/skipped, and reduce status.
- Reads only cheap signals (intermediate files, the per-shard reports, and
queue/donemarkers), so it stays fast even with millions of attempt directories.--watch Nrefreshes every N seconds. See Resumable Campaigns.
scripts/analyze_campaign_diversity.py- Streams authoritative per-shard diversity ledgers and writes a reproducible JSON, CSV, and self-contained HTML audit under
data/reports/diversity/. - Computes exact low-cardinality structural coverage and deterministic sampled estimates for robust nearest-neighbor distance, near-duplicate rate, effective sample ratio, intrinsic dimension, active-signature diversity, and similarity-cluster concentration.
- Uses versioned defaults from
configs/diversity_analysis.yaml; see Campaign Diversity Analysis.
- Streams authoritative per-shard diversity ledgers and writes a reproducible JSON, CSV, and self-contained HTML audit under
scripts/analyze_campaign_diversity_mpi.py- MPI map/reduce variant of the diversity audit. Deterministically partitions shard ledgers, merges exact counters and the global lowest-hash sample, and writes only from rank 0.
- Produces the same report schema as the serial reference implementation; use
configs/slurm/andes_diversity_analysis_mpi.sbatchfor the production corpus.
scripts/inspect_sources.py- Reports configured source presence, git head (for git repos), direct-download file presence, and manual-case raw file status.
scripts/download_sources.py- Clones missing git-based sources from
configs/sources.yaml. - Supports pinned git checkout and recursive clone configuration.
- Downloads direct URL artifacts with retries/resume (
curl --continue-at -) when--download-filesis enabled. - Skips already-verified archives and records source URLs, timestamps, SHA-256, and sizes.
- Optionally extracts archives and writes per-source
source_manifest.yaml. - Writes provenance report JSON (default:
data/imported/source_provenance.json).
- Clones missing git-based sources from
scripts/prepare_manual_downloads.py- Creates TAMU case-folder structure and emits
external/tamu/MANUAL_DOWNLOADS.md. - Writes
external/tamu/manual_download_manifest.yamlwith per-case acquisition status.
- Creates TAMU case-folder structure and emits
scripts/register_manual_download.py- Registers a manually downloaded archive for a specific case.
- Preserves the original archive under
external/tamu/<case_id>/raw/, computes SHA-256, and writes inventory/checksum files. - Optionally extracts archive contents and writes case-level
source_manifest.yaml.
scripts/validate_sources.py- Validates configured sources and emits policy statuses.
- Supports statuses:
MISSING,DOWNLOADED_UNREGISTERED,REGISTERED,EXTRACTED,VALIDATED,CHECKSUM_MISMATCH,UNSUPPORTED_FORMAT,INCOMPLETE_FOR_PF,INCOMPLETE_FOR_OPF. - Marks validation non-OK when required manual cases are not validated.
scripts/audit_case_sources.py- Audits per-case source identity metadata and local availability from
configs/sources.yaml. - Reports source lineage, acquisition mode, expected source file, checksum, TAMU correspondence, and PF/DC-OPF/AC-OPF readiness.
- Enforces explicit non-equivalence metadata for similar-size but distinct grid families.
- Audits per-case source identity metadata and local availability from
scripts/export_manual_source_bundle.py- Exports a git-tracked reproducibility bundle from manual TAMU case ingestion state.
- Copies per-case manifests, checksums, and inventories into
data/imported/manual_sources/cases/. - Writes
data/imported/manual_sources/repro_bundle.jsonwith archive checksums and metadata.
scripts/convert_go_challenge_to_matpower.py- Converts GO Challenge PSS/E scenario bundles (
.rawwith optional.rop) into MATPOWER.mfiles. - Input archives are expected to be preserved original downloads from the official DOE catalog entry: https://catalog.data.gov/dataset/arpa-e-grid-optimization-go-competition-challenge-1?utm_source=chatgpt.com
- Supports batch conversion directly from
external/go_challenge1/raw/Challenge_1*.ziparchives. - Writes conversion summary/report JSON (default:
data/analysis/go_challenge1_conversion_report.json).
- Converts GO Challenge PSS/E scenario bundles (
scripts/create_topology.py- Parses MATPOWER-format case files (currently default-mapped for
pglib_opf). - Emits a topology JSON artifact under
data/topology_registry/<case_id>/topology_<index>_<description>.json. - Appends a registry record to
data/topology_registry/topology_registry.jsonlwith source file and element counts.
- Parses MATPOWER-format case files (currently default-mapped for
scripts/install_hsl_ipopt.sh- Builds a licensed Coin-HSL archive with Meson against the Riker Julia LP64
OpenBLAS artifact and installs it under private
$HOME/.local/coinhslstorage. - Generates
current/env.sh, explicitly configures Ipopt'shsllib, and validates both MA27 and MA57 before activating the version.
- Builds a licensed Coin-HSL archive with Meson against the Riker Julia LP64
OpenBLAS artifact and installs it under private
configs/slurm/submit_riker_pf_smoke.sh- Submits the one-node PF smoke after validating the private Coin-HSL activation. Each candidate tries default Ipopt, MA27, then MA57 as needed.
configs/slurm/submit_riker_pf_large.sh- Starts the Riker PF campaign supervisor after the HSL preflight. Run only after the smoke completes.
configs/slurm/riker_pf_campaign_supervisor.sbatch- Submits the first incomplete PF round with resume enabled, then resubmits
itself
afteranythat job. It resumes timeouts, advances after successful reduction, and stops after all configured rounds complete.
- Submits the first incomplete PF round with resume enabled, then resubmits
itself
scripts/configure_exago_build.py- Configures machine-scoped ExaGO build/install directories under
external/ExaGO/builds/<profile>/. - Supports optional configure/build/install execution and emits resolved paths in JSON.
- Configures machine-scoped ExaGO build/install directories under
scripts/run_exago_andes_opflow.sh- Loads the known-good Andes module stack and runs isolated ExaGO
opflow. - Defaults to case9 IPOPT smoke test when no CLI arguments are provided.
- Accepts custom
opflowarguments for alternate netfiles and solver options.
- Loads the known-good Andes module stack and runs isolated ExaGO
scripts/setup_frontier_venv.sh- Builds the canonical campaign virtualenv (
.venv) withpandas+pyarrowfromrequirements.txt, matching the Frontier runtime interpreter. - Consumed by the Frontier ExaGO campaign sbatch via
PGDF_VENV. See Setup.
- Builds the canonical campaign virtualenv (
Equivalent module-backed entrypoints are exposed via package scripts:
pgdf-finalize-attemptpgdf-verify-attemptpgdf-audit-preservationpgdf-validate-layout