Add salvage and merge utilities for recovering from partial batch failures#811
Draft
Add salvage and merge utilities for recovering from partial batch failures#811
Conversation
Co-authored-by: tobeycarman <838735+tobeycarman@users.noreply.github.com>
Co-authored-by: tobeycarman <838735+tobeycarman@users.noreply.github.com>
Co-authored-by: tobeycarman <838735+tobeycarman@users.noreply.github.com>
Co-authored-by: tobeycarman <838735+tobeycarman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add script to continue failed batch runs without restart
Add salvage and merge utilities for recovering from partial batch failures
Nov 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When dvmdostem batch runs partially fail (e.g., 2 of 10 cells), users must either restart the entire batch or manually merge outputs. This adds
pyddt-salvageandpyddt-mergecommands to automate recovery.Implementation
Core modules
salvage_run.py: Identifies failed cells fromrun_status.nc, backs up outputs, generates run-mask for failed cells onlymerge_runs.py: Merges salvaged and rerun outputs usingxarray.where()with proper dimension broadcastingCLI integration
pyddt-salvageandpyddt-mergeentry points topyproject.toml--verboseflag for detailed progressMerging strategy
Uses run_status to select data per-pixel across all dimensions:
Usage
Testing
Documentation
Added
pyddt/docs/SALVAGE_AND_MERGE.mdwith workflow examples and troubleshooting.Original prompt
This section details on the original issue you should resolve
<issue_title>Continuing a failed run in a batch</issue_title>
<issue_description>From Slack discussion:
Elchin Jafarov
I need a script that can run failed batches without restarting them over.
Suppose I have a run-mask with 10 enabled grid cells, 8 out of 10 finished, I need to re-run the other 2, so that I can continue writing into the existing result files.
How should I modify the command line so that it continues writing into existing restart and other results files?
tcarman
ooh interesting question. I have not tried this, so you’d need to experiment with it, but it might work to make a new run mask with your 2 cells enabled and the 8 cells disabled. Then run dvmdostem with the
—no-output-cleanupflag?Elchin Jafarov
I will try and let you know. Thank you!
Elchin Jafarov
Unfortunately, it does not do it. it cleans the results files and runs only enabled cells. we need to copy previous results files and then merge them together.
tcarman
hmm, shoot. so --no-output-cleanup is not working?
Elchin Jafarov
it is designed for keeping the restart files, not other results
tcarman
ah, ok, that sounds kinda familiar.
I wonder if we could easily modify it so that it leaves the other outputs untouched…trying to think if that would create other problems…
Here is another workflow idea to test:
</issue_description>
<agent_instructions>Can you use the information described in this issue to start solving the issue? </agent_instructions>
Comments on the Issue (you are @copilot in this section)
@tobeycarman Sample code to setup trivial experiment for testing(note that this uses the command line interface that will exist when PR #809 is merged):✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.