@@ -949,19 +949,27 @@ void HighsMipSolver::run() {
949949 }
950950 }
951951 assert (early_terminated_worker != -1 );
952- // Clear all buffered solve information from workers that are not
953- // the earliest to terminate
954- for (const HighsInt i : search_indices) {
955- if (i == early_terminated_worker) continue ;
956- HighsMipWorker& worker = mipdata_->workers [i];
957- worker.nodequeue .clear ();
958- worker.search_ptr_ ->resetStatistics ();
959- worker.resetHeurStats ();
960- worker.resetSepaStats ();
961- worker.solutions_ .clear ();
952+ if (early_terminated_worker == -1 ) {
953+ mipdata_->worker_lp_iterations_stop .store (
954+ std::numeric_limits<int64_t >::max (), std::memory_order_relaxed);
955+ for (const HighsInt i : search_indices) {
956+ mipdata_->workers [i].early_termination = false ;
957+ }
958+ } else {
959+ // Clear all buffered solve information from workers that are not
960+ // the earliest to terminate
961+ for (const HighsInt i : search_indices) {
962+ if (i == early_terminated_worker) continue ;
963+ HighsMipWorker& worker = mipdata_->workers [i];
964+ worker.nodequeue .clear ();
965+ worker.search_ptr_ ->resetStatistics ();
966+ worker.resetHeurStats ();
967+ worker.resetSepaStats ();
968+ worker.solutions_ .clear ();
969+ }
970+ search_indices.clear ();
971+ search_indices.emplace_back (early_terminated_worker);
962972 }
963- search_indices.clear ();
964- search_indices.emplace_back (early_terminated_worker);
965973 }
966974
967975 // Sync statistics, check infeasibility, and flush nodes from worker queues
0 commit comments