@@ -4043,10 +4043,8 @@ HighsStatus Highs::callSolveMip() {
40434043 // converted into the use_lp instance, and this->presolve(); works
40444044 // on the incumbent model
40454045 const bool use_mip_race_single_presolve =
4046- run_mip_race &&
4047- options_.mip_race_single_presolve &&
4048- options_.presolve != kHighsOffString &&
4049- !has_semi_variables;
4046+ run_mip_race && options_.mip_race_single_presolve &&
4047+ options_.presolve != kHighsOffString && !has_semi_variables;
40504048 // Take a copy of the presolve option in case it's switched off for
40514049 // a single presolve MIP race
40524050 const std::string presolve = this ->options_ .presolve ;
@@ -4060,16 +4058,20 @@ HighsStatus Highs::callSolveMip() {
40604058 // the call to presolve...
40614059 assert (!this ->called_return_from_optimize_model );
40624060 this ->called_return_from_optimize_model = true ;
4063- this ->presolve ();
4061+ HighsStatus call_status = this ->presolve ();
40644062 // ... then set it back to false and restart the run clock
40654063 this ->called_return_from_optimize_model = false ;
40664064 this ->timer_ .start ();
4065+ if (call_status != HighsStatus::kOk ) return call_status;
40674066 presolved_lp = this ->getPresolvedLp ();
40684067 this ->options_ .presolve = kHighsOffString ;
40694068 }
40704069 // Create the master MIP solver instance that will exist beyond any
40714070 // MIP race
4072- HighsLp& lp = has_semi_variables ? use_lp : (use_mip_race_single_presolve ? presolved_lp : model_.lp_ );
4071+ HighsLp& lp =
4072+ has_semi_variables
4073+ ? use_lp
4074+ : (use_mip_race_single_presolve ? presolved_lp : model_.lp_ );
40734075 HighsMipSolver solver (callback_, options_, lp, solution_);
40744076 HighsMipSolverInfo mip_solver_info;
40754077 if (run_mip_race) {
@@ -4084,7 +4086,7 @@ HighsStatus Highs::callSolveMip() {
40844086 worker_callback.clear ();
40854087 // Race the MIP solver!
40864088 highsLogUser (options_.log_options , HighsLogType::kInfo ,
4087- " Starting MIP race with %d instances: behaviour is "
4089+ " \n Starting MIP race with %d instances: behaviour is "
40884090 " non-deterministic!\n " ,
40894091 int (mip_race_concurrency));
40904092 // Define the HighsMipSolverInfo record for each worker
@@ -4133,9 +4135,9 @@ HighsStatus Highs::callSolveMip() {
41334135 }
41344136 });
41354137 // Determine the winner and report on the solution
4136- HighsStatus call_status = this -> mipRaceResults (use_mip_race_single_presolve,
4137- mip_solver_info, worker_info ,
4138- mip_time, mip_race_time);
4138+ HighsStatus call_status =
4139+ this -> mipRaceResults (use_mip_race_single_presolve, mip_solver_info ,
4140+ worker_info, mip_time, mip_race_time);
41394141 // Restore the presolve option - that will have been set to
41404142 // kHighsOffString for a single presolve MIP race
41414143 this ->options_ .presolve = presolve;
@@ -4238,9 +4240,10 @@ HighsStatus Highs::callSolveMip() {
42384240 return return_status;
42394241}
42404242
4241- // Only called from Highs::postsolve
4242- HighsStatus Highs::callRunPostsolve (const HighsSolution& solution,
4243- const HighsBasis& basis) {
4243+ // Only called from Highs::postsolve and Highs::mipRaceResults
4244+ HighsStatus Highs::callRunPostsolve (
4245+ const HighsSolution& solution, const HighsBasis& basis,
4246+ const bool suppress_mip_model_status_warning) {
42444247 HighsStatus return_status = HighsStatus::kOk ;
42454248 HighsStatus call_status;
42464249 const HighsLp& presolved_lp = presolve_.getReducedProblem ();
@@ -4305,9 +4308,12 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
43054308 max_integrality_violation);
43064309 }
43074310 }
4308- highsLogUser (
4309- options_.log_options , HighsLogType::kWarning ,
4310- " Postsolve performed for MIP, but model status cannot be known\n " );
4311+ // When calling postsolve after MIP race on presolved model,
4312+ // model status can be trusted so suppress the warning message
4313+ if (!suppress_mip_model_status_warning)
4314+ highsLogUser (
4315+ options_.log_options , HighsLogType::kWarning ,
4316+ " Postsolve performed for MIP, but model status cannot be known\n " );
43114317 } else {
43124318 highsLogUser (options_.log_options , HighsLogType::kError ,
43134319 " Postsolve return status is %d\n " , (int )postsolve_status);
0 commit comments