Skip to content

add --hub-only-solver-logs option#682

Merged
DLWoodruff merged 2 commits into
Pyomo:mainfrom
DLWoodruff:hub-only-solver-logs
May 11, 2026
Merged

add --hub-only-solver-logs option#682
DLWoodruff merged 2 commits into
Pyomo:mainfrom
DLWoodruff:hub-only-solver-logs

Conversation

@DLWoodruff
Copy link
Copy Markdown
Collaborator

Summary

  • New CLI flag --hub-only-solver-logs that, 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-logs if --solver-log-dir is not set.
  • Implemented by giving cfg_vanilla.shared_options(cfg, is_hub=False) an is_hub parameter; ph_hub, subgradient_hub, and fwph_hub pass is_hub=True. When the flag is on and is_hub=False, solver_log_dir is dropped from the spoke options dict so spopt._solve_one skips log emission.

Motivation: a typical hub-and-spoke run with xhat spokes solves many small evaluation subproblems per outer iteration. With --solver-log-dir on, 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
  • Checker rejects --hub-only-solver-logs alone
  • Checker accepts the pair
  • shared_options(cfg, is_hub=True) keeps solver_log_dir; is_hub=False drops it when hub_only_solver_logs is True

🤖 Generated with Claude Code

DLWoodruff and others added 2 commits May 11, 2026 10:43
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
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.04%. Comparing base (bfc2ce3) to head (f840a43).

Files with missing lines Patch % Lines
mpisppy/utils/cfg_vanilla.py 83.33% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DLWoodruff DLWoodruff merged commit b58f561 into Pyomo:main May 11, 2026
30 checks passed
@DLWoodruff DLWoodruff deleted the hub-only-solver-logs branch May 11, 2026 20:01
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