@@ -699,22 +699,29 @@ void HighsMipSolver::run() {
699699
700700void HighsMipSolver::cleanupSolve () {
701701 if (mipdata_->terminatorActive ()) {
702- if (!mipdata_->terminatorTerminated ()) {
703- // No other instance has terminated, so terminate it
702+ mipdata_->terminatorReport ();
703+ if (mipdata_->terminatorTerminated ()) {
704+ // Indicate that this instance has been interrupted
704705 highsLogUser (options_mip_->log_options , HighsLogType::kInfo ,
705- " instance%d: terminate %6.4f (%sMIP)\n " ,
706+ " instance%d: terminated %6.4f (%sMIP)\n " ,
706707 int (this ->mipdata_ ->terminatorMyInstance ()),
707708 this ->timer_ .read (),
708709 submip ? " sub-" : " " );
709- mipdata_->terminatorTerminate ();
710- } else {
711- // Indicate that this instance has been interrupted
710+ modelstatus_ = HighsModelStatus::kHighsInterrupt ;
711+ } else if (!submip) {
712+ // When sub-MIPs call cleanupSolve(), they generally don't have
713+ // a termination criterion for the whole MIP solver
714+ //
715+ // Possibly allow sub-MIPs to terminate if the time limit is
716+ // reached
717+ //
718+ // No other instance has terminated, so terminate
712719 highsLogUser (options_mip_->log_options , HighsLogType::kInfo ,
713- " instance%d: terminated %6.4f (%sMIP)\n " ,
720+ " instance%d: terminate %6.4f (%sMIP)\n " ,
714721 int (this ->mipdata_ ->terminatorMyInstance ()),
715722 this ->timer_ .read (),
716723 submip ? " sub-" : " " );
717- modelstatus_ = HighsModelStatus:: kHighsInterrupt ;
724+ mipdata_-> terminatorTerminate () ;
718725 }
719726 mipdata_->terminatorReport ();
720727 // Report on any active MIP race
0 commit comments