Skip to content

Commit 6d77072

Browse files
committed
move worker init outside of search loopgit add --all
1 parent 5b7e8e0 commit 6d77072

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

highs/mip/HighsMipSolver.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,21 @@ void HighsMipSolver::run() {
291291
double upperLimLastCheck = mipdata_->upper_limit;
292292
double lowerBoundLastCheck = mipdata_->lower_bound;
293293
analysis_.mipTimerStart(kMipClockSearch);
294+
295+
int k = 0;
296+
297+
// Initialize worker relaxations and mipworkers
298+
// todo lps and workers are still empty right now
299+
300+
const int num_workers = 7;
301+
for (int i = 0; i < 7; i++) {
302+
mipdata_->lps.push_back(HighsLpRelaxation(*this));
303+
mipdata_->workers.emplace_back(*this, mipdata_->lps.back());
304+
}
305+
294306
while (search.hasNode()) {
307+
308+
295309
// Possibly look for primal solution from the user
296310
if (!submip && callback_->user_callback &&
297311
callback_->active[kCallbackMipUserSolution])
@@ -311,14 +325,6 @@ void HighsMipSolver::run() {
311325

312326
mipdata_->lp.setIterationLimit(iterlimit);
313327

314-
// Initialize worker relaxations and mipworkers
315-
// todo lps and workers are still empty right now
316-
317-
const int num_workers = 7;
318-
for (int i = 0; i < 7; i++) {
319-
mipdata_->lps.push_back(HighsLpRelaxation(*this));
320-
mipdata_->workers.emplace_back(*this, mipdata_->lps.back());
321-
}
322328

323329
// perform the dive and put the open nodes to the queue
324330
size_t plungestart = mipdata_->num_nodes;

0 commit comments

Comments
 (0)