Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix jump example utils for benchmarks #789

Merged
merged 1 commit into from
Dec 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/JuMP_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ function solve_check(
JuMP.optimize!(model) # TODO make sure it doesn't copy again
flush(stdout); flush(stderr)

opt = JuMP.backend(model).optimizer.model.optimizer
if opt isa Hypatia.Optimizer
if JuMP.solver_name(model) == "Hypatia"
solver = JuMP.backend(model).optimizer.model.optimizer.solver
test && test_extra(model.ext[:inst], model)
flush(stdout); flush(stderr)
(solve_stats, _) = process_result(opt.solver.orig_model, opt.solver)
(solve_stats, _) = process_result(solver.orig_model, solver)
return solve_stats
elseif test
@info("cannot run example tests if solver is not Hypatia")
Expand All @@ -163,7 +163,7 @@ function solve_check(
iters = MOI.get(model, MOI.BarrierIterations())
primal_obj = JuMP.objective_value(model)
dual_obj = JuMP.dual_objective_value(model)
moi_status = MOI.get(model, MOI.TerminationStatus())
moi_status = JuMP.termination_status(model)
if haskey(moi_hyp_status_map, moi_status)
hyp_status = moi_hyp_status_map[moi_status]
else
Expand Down