@@ -736,6 +736,7 @@ void HighsMipSolverData::runSetup() {
736736 upper_bound -= mipsolver.model_ ->offset_ ;
737737
738738 if (mipsolver.solution_objective_ != kHighsInf ) {
739+ // Assigning new incumbent
739740 incumbent = postSolveStack.getReducedPrimalSolution (mipsolver.solution_ );
740741 // return the objective value in the transformed space
741742 double solobj =
@@ -764,6 +765,10 @@ void HighsMipSolverData::runSetup() {
764765 upper_bound);
765766
766767 double new_upper_limit = computeNewUpperLimit (solobj, 0.0 , 0.0 );
768+ // Possibly write the improving solution to the shared memory space
769+ if (!mipsolver.submip && mipsolver.mip_race_record_ )
770+ mipsolver.makeMipRaceRecord (solobj, incumbent);
771+
767772 saveReportMipSolution (new_upper_limit);
768773 if (new_upper_limit < upper_limit) {
769774 upper_limit = new_upper_limit;
@@ -1399,13 +1404,17 @@ bool HighsMipSolverData::addIncumbent(const std::vector<double>& sol,
13991404 updatePrimalDualIntegral (lower_bound, lower_bound, prev_upper_bound,
14001405 upper_bound);
14011406
1407+ // Assigning new incumbent
14021408 incumbent = sol;
14031409 double new_upper_limit = computeNewUpperLimit (solobj, 0.0 , 0.0 );
14041410
14051411 if (!is_user_solution && !mipsolver.submip )
14061412 saveReportMipSolution (new_upper_limit);
14071413 if (new_upper_limit < upper_limit) {
14081414 ++numImprovingSols;
1415+ // Possibly write the improving solution to the shared memory space
1416+ if (!mipsolver.submip && mipsolver.mip_race_record_ )
1417+ mipsolver.makeMipRaceRecord (solobj, incumbent);
14091418 upper_limit = new_upper_limit;
14101419 optimality_limit =
14111420 computeNewUpperLimit (solobj, mipsolver.options_mip_ ->mip_abs_gap ,
@@ -1438,6 +1447,7 @@ bool HighsMipSolverData::addIncumbent(const std::vector<double>& sol,
14381447 printDisplayLine (solution_source);
14391448 }
14401449 } else if (incumbent.empty ())
1450+ // Assigning new incumbent
14411451 incumbent = sol;
14421452
14431453 return true ;
@@ -2821,13 +2831,38 @@ bool MipRaceIncumbent::readOk(double& objective,
28212831 return this ->start_write_incumbent == start_write_incumbent;
28222832}
28232833
2824- void MipRaceRecord::clear () { this ->record .clear (); }
2834+ void MipRaceRecord::clear () {
2835+ this ->terminate .clear ();
2836+ this ->record .clear ();
2837+ }
28252838
28262839void MipRaceRecord::initialise (const HighsInt num_race_instance,
28272840 const HighsInt num_col) {
28282841 this ->clear ();
2842+ this ->terminate .assign (num_race_instance, false );
28292843 MipRaceIncumbent mip_race_incumbent;
28302844 mip_race_incumbent.initialise (num_col);
28312845 for (HighsInt instance = 0 ; instance < num_race_instance; instance++)
28322846 this ->record .push_back (mip_race_incumbent);
28332847}
2848+
2849+ void MipRaceRecord::report () const {
2850+ HighsInt num_race_instance = this ->terminate .size ();
2851+ printf (" \n MipRaceRecord:" );
2852+ for (HighsInt instance = 0 ; instance < num_race_instance; instance++)
2853+ printf (" %11d" , int (instance));
2854+ printf (" \n Terminate: " );
2855+ for (HighsInt instance = 0 ; instance < num_race_instance; instance++)
2856+ printf (" %11s" , this ->terminate [instance] ? " T" : " F" );
2857+ printf (" \n StartWrite: " );
2858+ for (HighsInt instance = 0 ; instance < num_race_instance; instance++)
2859+ printf (" %11d" , this ->record [instance].start_write_incumbent );
2860+ printf (" \n Objective: " );
2861+ for (HighsInt instance = 0 ; instance < num_race_instance; instance++)
2862+ printf (" %11.4g" , this ->record [instance].best_incumbent_objective );
2863+ printf (" \n FinishWrite: " );
2864+ for (HighsInt instance = 0 ; instance < num_race_instance; instance++)
2865+ printf (" %11d" , this ->record [instance].finish_write_incumbent );
2866+ printf (" \n\n " );
2867+ }
2868+
0 commit comments