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

Default to MUMPS if MA57 is not available #32

Closed
odow opened this issue Oct 17, 2024 · 6 comments
Closed

Default to MUMPS if MA57 is not available #32

odow opened this issue Oct 17, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@odow
Copy link
Contributor

odow commented Oct 17, 2024

This is going to become annoying:

julia> model = Model() do
           return AmplNLWriter.Optimizer(UnoSolverCommand())
       end
A JuMP Model
├ solver: AmplNLWriter
├ objective_sense: FEASIBILITY_SENSE
├ num_variables: 0
├ num_constraints: 0
└ Names registered in the model: none

julia> set_attribute(model, "preset", "ipopt")

julia> set_attribute(model, "print_solution", "yes")

julia> @variable(model, x)
x

julia> @objective(model, Min, (x - 1)^2)
x² - 2 x + 1

julia> optimize!(model)
libc++abi: terminating due to uncaught exception of type std::invalid_argument: Linear solver name is unknown

The solution is

julia> set_attribute(model, "linear_solver", "MUMPS")

julia> optimize!(model)
Problem /var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_VfYlG8/model.nl_scaled_equalityconstrained_boundrelaxed
1 variables, 0 constraints

Options:
... etc

But better options would be to:

  • default to MUMPS if MA57 is not available and MUMPS is
  • improve the error message to print the name of the available solvers and to tell the user to set the linear_solver option
@cvanaret
Copy link
Owner

I will change the default solvers based on what's available.

@odow
Copy link
Contributor Author

odow commented Oct 17, 2024

Maybe the same with the presets? If we haven't compiled BQPD then make -preset ipopt the default?

@cvanaret cvanaret changed the title Default to MUMPS is MA57 is not available Default to MUMPS if MA57 is not available Oct 17, 2024
@cvanaret cvanaret self-assigned this Oct 17, 2024
@cvanaret cvanaret added the bug Something isn't working label Oct 17, 2024
@cvanaret
Copy link
Owner

Quick question: you used the command set_attribute(model, "preset", "ipopt") in your code. This should be an attribute of the solver/optimizer, rather than of the model.
Would it be possible to have something like:

solver = AmplNLWriter.Optimizer(UnoSolverCommand())
set_attribute(solver, "preset", "ipopt")
...

?

@odow
Copy link
Contributor Author

odow commented Oct 19, 2024

There are multiple ways that you can pass options to a solver: https://jump.dev/JuMP.jl/stable/manual/models/#solver_options

None of this needs to concern Uno though. We'll pack them into the appropriate place in the CLI.

@cvanaret
Copy link
Owner

Setting the default subproblem solvers + improving the error messages was addressed in commit d8571b6.
I will address the default preset in a separate issue.

@odow
Copy link
Contributor Author

odow commented Oct 24, 2024

Great. I confirm that this worked in the latest build of Uno_jll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants