Skip to content

ENH: Restart control file; changelog for v1.3.0 - #34

Merged
pastewka merged 3 commits into
mainfrom
enh/restart-control
Oct 27, 2026
Merged

pastewka merged 3 commits into
mainfrom
enh/restart-control

Conversation

@pastewka

Copy link
Copy Markdown
Contributor

Adds the restart control file and dates the v1.3.0 changelog (27Oct26). Supersedes #33.

Restart control file. As soon as the output NetCDF is set up, every run writes output.restart_control (new key, default restart.json). This is the run's complete control file with two changes:

  • initial_density.source is set to this run's output.file, so the continuation starts from the last frame written there;
  • output.file is advanced to a new, numbered name: a number at the end of the name (after ., _ or -) is incremented with its zero padding kept, otherwise .1 is appended (design.nc → design.1.nc → design.2.nc, run_009.nc → run_010.nc).

So a continuation never overwrites the file it reads, and repeating mutopopt restart.json chains jobs.

  • The file is written at the start rather than the end, so a run killed at the walltime can be continued, from its last dumped frame. The key's help text recommends dump_every > 0 for runs that may be interrupted.
  • Keys left at null (automatic) stay null, so the next run makes those choices again.
  • Only the design carries over. The optimizer's state (trust-region radius, adaptive tolerance, iteration count) starts fresh.
  • The control file the run was started from is replaced only if it is itself a continuation. A hand-written control file of the same name is kept, with a warning.
  • Elasticity driver only; simulate_conduction.py is unchanged.

Tests. New test/test_restart_control.py (numbering, contents and validity of the restart file, chaining, the overwrite guard); all of it passes. I also ran the chain twice up to the start of the optimization (design.nc → design.1.nc → design.2.nc). Locally, 8 optimizer tests fail on this branch and on main alike, because the NuMPI in the venv is older than the required >0.15.2.

Release. Requires muGrid 1.6.0 (muSpectre/muGrid#247), so release muGrid first.

🤖 Generated with Claude Code

pastewka and others added 3 commits October 27, 2026 12:21
Every run writes output.restart_control (default restart.json) as soon as
its output file is set up: the run's complete control, starting from the last
frame of output.file and writing to a new, numbered output file (design.nc ->
design.1.nc -> design.2.nc, run_009.nc -> run_010.nc), so the run never
overwrites the file it continues from and `mutopopt restart.json` repeated
chains jobs. A hand-written control file of the same name is not replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The muGrid wheels have no MPI, and muGrid 1.6.0 raises instead of running
serially under mpirun, so every MPI test errored. Compile muGrid and mpi4py
against the runner's Open MPI (with PnetCDF for parallel NetCDF), and fail
early if the build still lacks MPI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pastewka
pastewka merged commit 0e5df13 into main Oct 27, 2026
8 checks passed
@pastewka
pastewka deleted the enh/restart-control branch October 27, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant