add --hub-only-solver-logs option#682
Merged
Merged
Conversation
When set together with --solver-log-dir, only the hub writes solver logs; spokes (xhat evaluators, bounders, etc.) do not. Useful to keep per-iteration hub-subproblem logs without an extra log file for every spoke solve. checker() requires --solver-log-dir to also be set. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three checker cases (raise without --solver-log-dir; pass with it; pass when flag is off) and three shared_options propagation cases (both hub+spoke get the dir by default; hub-only suppresses spoke; no dir means no key anywhere). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #682 +/- ##
==========================================
+ Coverage 71.02% 71.04% +0.02%
==========================================
Files 154 154
Lines 19248 19252 +4
==========================================
+ Hits 13670 13677 +7
+ Misses 5578 5575 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
--hub-only-solver-logsthat, when paired with--solver-log-dir, causes only the hub to write per-subproblem solver logs; spokes (xhat evaluators, bounders, etc.) do not.Config.checker()rejects--hub-only-solver-logsif--solver-log-diris not set.cfg_vanilla.shared_options(cfg, is_hub=False)anis_hubparameter;ph_hub,subgradient_hub, andfwph_hubpassis_hub=True. When the flag is on andis_hub=False,solver_log_diris dropped from the spoke options dict sospopt._solve_oneskips log emission.Motivation: a typical hub-and-spoke run with xhat spokes solves many small evaluation subproblems per outer iteration. With
--solver-log-diron, the spoke chatter dominates the log directory; this flag lets you keep hub subproblem logs without the spoke noise.Test plan
python -m pytest mpisppy/tests/test_config.py— 78 passed (6 new)ruff check .clean on changed files--hub-only-solver-logsaloneshared_options(cfg, is_hub=True)keepssolver_log_dir;is_hub=Falsedrops it whenhub_only_solver_logsis True🤖 Generated with Claude Code