Skip to content

Commit d9c57a6

Browse files
committed
Add more solution syncs. Fix wrong index and addincumbent call
1 parent 092ea99 commit d9c57a6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

highs/mip/HighsMipSolver.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void HighsMipSolver::run() {
363363
mipdata_->lps.emplace_back(mipdata_->lp, i);
364364
mipdata_->cutpools.emplace_back(numCol(),
365365
options_mip_->mip_pool_age_limit,
366-
options_mip_->mip_pool_soft_limit, i);
366+
options_mip_->mip_pool_soft_limit, i + 1);
367367
mipdata_->conflictpools.emplace_back(5 * options_mip_->mip_pool_age_limit,
368368
options_mip_->mip_pool_soft_limit);
369369
mipdata_->workers.emplace_back(
@@ -721,6 +721,7 @@ void HighsMipSolver::run() {
721721
// due to parallelism)
722722
// TODO MT: Change the if statement
723723
// if (mipdata_->hasMultipleWorkers() && num_search_indices == 0) {
724+
syncSolutions();
724725
if (mipdata_->hasMultipleWorkers() &&
725726
(num_search_indices == 0 || search_indices[0] != 0)) {
726727
double prev_lower_bound = mipdata_->lower_bound;
@@ -1153,6 +1154,7 @@ void HighsMipSolver::run() {
11531154
// printf("popping node from nodequeue (length = %" HIGHSINT_FORMAT ")\n",
11541155
// (HighsInt)nodequeue.size());
11551156
std::vector<HighsInt> search_indices = getSearchIndicesWithNoNodes();
1157+
// TODO MT: Remove this line
11561158
if (search_indices[0] != 0) break;
11571159
// if (search_indices.size() >= mip_search_concurrency) break;
11581160

@@ -1174,6 +1176,7 @@ void HighsMipSolver::run() {
11741176

11751177
bool infeasible = separateAndStoreBasis(search_indices);
11761178
if (infeasible) break;
1179+
syncSolutions();
11771180
} // while(!mipdata_->nodequeue.empty())
11781181
analysis_.mipTimerStop(kMipClockNodeSearch);
11791182
if (analysis_.analyse_mip_time) {

highs/mip/HighsSearch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,10 +2031,10 @@ bool HighsSearch::addIncumbent(const std::vector<double>& sol, double solobj,
20312031
const bool print_display_line) {
20322032
// if (mipsolver.mipdata_->workers.size() <= 1)
20332033
if (mipsolver.mipdata_->parallelLockActive()) {
2034+
return mipworker.addIncumbent(sol, solobj, solution_source);
2035+
} else {
20342036
return mipsolver.mipdata_->addIncumbent(sol, solobj, solution_source,
20352037
print_display_line);
2036-
} else {
2037-
return mipworker.addIncumbent(sol, solobj, solution_source);
20382038
}
20392039
// dive part.
20402040
// return mipworker.addIncumbent(sol, solobj, solution_source,

0 commit comments

Comments
 (0)