--- name: hpc-sweep description: "Runs a Slurm parameter sweep as an experiment: plans a job array and shows a dry run, submits on the operator's word, checks each run with its declared verify check, and tabulates every run, failed and unverified included. Not for a single job." triggers: - run a parameter sweep - sweep these parameters on slurm - submit the sweep - dry run the sweep - tabulate the sweep results - refine the sweep grid --- # Parameter sweeps on Slurm A sweep is a job array plus a manifest, judged run by run. Every run ends in the table with its parameters, its scheduler state, its job id, the verdict of its declared check and the conditions behind that verdict. A run that failed, or completed without anything the check could judge, stays in the table as such. The verdicts say whether each run agreed with its reference within the check's declared tolerance. They do not say the simulation is right. The helper is `${pluginRoot}/assets/scripts/sweep.py` (Python 3.10+). It plans and tabulates. It never submits, polls or cancels. Those go through the `slurm-jobs` skill's `mcp_slurm__*` capabilities. Run the helper with `bash` from the project root: `python3 plan|aggregate ...`. ## Phase 0 - Prerequisites 1. Load the `slurm-jobs` skill and run its Phase 0. The Slurm server must be listed with id `slurm`. Without it, stop with that skill's remedy. 2. Read the sweep file. If there is none, write one with the operator (format below) and stop for their review before planning. 3. `verify()` with no arguments. The sweep's `check` must be listed with `One run per call: /, a directory under /runs`. If it is missing or has no runs directory, show the operator the catalog entry below, filled in for this sweep, for them to add, and stop. Do not write or offer to write `.clio-coder/verifiers.yaml` yourself: the catalog decides what Clio may run, so it is the operator's file, and project safety policy often makes it read-only. Every `ask_user` question in this skill marks the option that does nothing new as recommended (`Don't submit`, `No change`), never the one that submits or starts work. An unanswered question can resolve to its recommended option, and an absent operator must not be steered into spending allocation. ## The sweep file YAML (JSON when PyYAML is absent). Paths are relative to the project root. ```yaml version: 1 name: decay # [a-z0-9][a-z0-9_-]*, names sweeps// parameters: # each name becomes an environment variable in the run k: [1, 4] dt: [0.001, 0.01] mode: grid # grid (every combination) or sample # sample: { count: 16, seed: 7 } # mode: sample; a parameter may then be { low, high, log?, integer? } template: sim/run.sh # the run body; it starts inside its run directory resources: { cores: 1, memory: 1G, time_limit: "00:10:00", partition: debug } concurrency: 4 # most runs in flight at once; becomes the array's %N check: decay-error # the verify check that judges one run metrics: metrics.json # optional JSON object each run writes; its numbers go in the table # submit: jobs # one job per run instead of an array; needed for resources.directives ``` The template runs as `bash