Skip to content

Parallel early termination - #3124

Merged
Opt-Mucca merged 3 commits into
latestfrom
parallel-early-termination
Jul 8, 2026
Merged

Parallel early termination#3124
Opt-Mucca merged 3 commits into
latestfrom
parallel-early-termination

Conversation

@Opt-Mucca

@Opt-Mucca Opt-Mucca commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a deterministic stopping criteria during parallel MIP, so that some workers may terminate early in the case where another worker has already proven global optimality / infeasibility.

This should only affect cases where (1) a worker finds a primal solution where the existing global dual bound is within tolerances (2) a worker concludes that the problem is infeasible. In my test set it saves 5% of time on 3% of instances, and has no overhead + no effect on the solution path of everything else. I don't see a reason not to add this.

The biggest "change" here would be adding a std::atomic to HighsMipSolverData, and when checking limits doing a std::memory_order_relaxed load.

Edit: The "improvement" on LP iterations and nodes is much higher and might make this PR look good, but it's simply cheating by discarding the information from all other workers (necessary for determinism)

@Opt-Mucca
Opt-Mucca requested a review from fwesselm July 1, 2026 13:33
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.58209% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.16%. Comparing base (dfd5cbf) to head (f42041f).
⚠️ Report is 47 commits behind head on latest.

Files with missing lines Patch % Lines
highs/mip/HighsMipSolver.cpp 75.00% 10 Missing ⚠️
highs/mip/HighsSearch.cpp 92.85% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           latest    #3124   +/-   ##
=======================================
  Coverage   73.15%   73.16%           
=======================================
  Files         430      430           
  Lines      103937   104012   +75     
  Branches    16717    16726    +9     
=======================================
+ Hits        76039    76101   +62     
- Misses      27622    27635   +13     
  Partials      276      276           

☔ View full report in Codecov by Harness.
📢 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.

@fwesselm fwesselm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @Opt-Mucca. Just some minor comments/questions from me.

Comment thread highs/mip/HighsMipSolver.cpp Outdated
Comment thread highs/mip/HighsMipSolver.cpp
Comment thread highs/mip/HighsMipSolver.cpp
Comment thread highs/mip/HighsMipSolverData.h
@Opt-Mucca

Copy link
Copy Markdown
Collaborator Author

@fwesselm ready for round 2 of review

for (const HighsInt i : search_indices) {
if (i == early_terminated_worker) continue;
HighsMipWorker& worker = mipdata_->workers[i];
worker.nodequeue.clear();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks familiar. If it is repeated somewhere, maybe it's worth adding a method to clear this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid that for now. Similar code is sprinkled everywhere, but it's always calling different sync functions and is missing some components depending on when it's called. Any central function would have so many arguments that it'd be confusing currently.

@fwesselm

fwesselm commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

@fwesselm ready for round 2 of review

Thanks, @Opt-Mucca. Just one more comment, and I think it's good to go.

@Opt-Mucca
Opt-Mucca merged commit 780d824 into latest Jul 8, 2026
484 checks passed
@Opt-Mucca
Opt-Mucca deleted the parallel-early-termination branch July 29, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants