From b5b6cf29d91f3bce5ed72cafb9490b4ee3af1fbf Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Thu, 8 Feb 2024 09:33:51 -0700 Subject: [PATCH] add xpress patch --- src/core/optimization_container.jl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/optimization_container.jl b/src/core/optimization_container.jl index 2953aac2ad..1a1452a63a 100644 --- a/src/core/optimization_container.jl +++ b/src/core/optimization_container.jl @@ -677,7 +677,13 @@ function solve_impl!(container::OptimizationContainer, system::PSY.System) optimizer_stats.sec_in_gc = @timed JuMP.optimize!(jump_model) model_status = JuMP.primal_status(jump_model) if model_status != MOI.FEASIBLE_POINT::MOI.ResultStatusCode - @error "Optimizer returned $model_status" + @error "Optimizer returned $model_status trying again" + JuMP.optimize!(jump_model) + model_status = JuMP.primal_status(jump_model) + end + + if model_status != MOI.FEASIBLE_POINT::MOI.ResultStatusCode + @error "Optimizer returned $model_status getting conflict" if get_calculate_conflict(get_settings(container)) compute_conflict!(container) end @@ -706,6 +712,8 @@ function compute_conflict!(container::OptimizationContainer) JuMP.compute_conflict!(jump_model) if MOI.get(jump_model, MOI.ConflictStatus()) != MOI.CONFLICT_FOUND @error "No conflict could be found for the model. $(MOI.get(jump_model, MOI.ConflictStatus()))" + + return end for (key, field_container) in get_constraints(container)