jump-dev / Ipopt.jl

A Julia interface to the Ipopt nonlinear solver
https://github.com/coin-or/ipopt
Other
152 stars 58 forks source link

Update the version of Ipopt_jll #378

Closed amontoison closed 1 year ago

amontoison commented 1 year ago

I recompiled Ipopt with the release 2023.8.2 of SPRAL.

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (e0f57ad) 94.02% compared to head (8e13d70) 94.02%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #378 +/- ## ======================================= Coverage 94.02% 94.02% ======================================= Files 4 4 Lines 921 921 ======================================= Hits 866 866 Misses 55 55 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

chriscoey commented 1 year ago

@amontoison let's merge this? I'm not sure if it will fix my issue, but I had trouble using SPRAL even though I followed the instructions here and exported the three environment variables in the terminal before starting Julia:

julia> optimize!(model)
Setting: "spral" is not a valid setting for Option: linear_solver. Check the option documentation.

### linear_solver (String)  ###
Category: Linear Solver
Description: Linear solver used for step computations.
Valid Settings:
    ma27 (load the Harwell routine MA27 from library at runtime)
    ma57 (load the Harwell routine MA57 from library at runtime)
    ma77 (load the Harwell routine HSL_MA77 from library at runtime)
    ma86 (load the Harwell routine MA86 from library at runtime)
    ma97 (load the Harwell routine MA97 from library at runtime)
    pardiso (load the Pardiso package from pardiso-project.org from user-provided library at runtime)
    mumps (use the Mumps package)
    custom (use custom linear solver (expert use))
Default: "mumps"
ERROR: IPOPT: Couldn't set option 'linear_solver' to value 'spral'.
odow commented 1 year ago

@chriscoey what version of Ipopt were you using?

chriscoey commented 1 year ago

I was using v1.4.1 - up to date. I will try again when 1.4.2 gets tagged. All I did was paste the exports from the README (OMP_CANCELLATION=TRUE OMP_NESTED=TRUE OMP_PROC_BIND=TRUE, though now there's only two in the README) into the console then open julia 1.9.2 and run

using Ipopt, JuMP

# An optimization problem
model = Model(Ipopt.Optimizer)
@variable(model, x)
@objective(model, Min, (x - 2)^2)

# Use the linear solver SPRAL
set_attribute(model, "linear_solver", "spral")
optimize!(model)

Can we add any tests for SPRAL?

odow commented 1 year ago

No, I mean, what version of Ipopt the solver (Ipopt_jll, or the initial part of a log file)

odow commented 1 year ago

We didn't add tests because of the environment variable problem. But I guess we could

chriscoey commented 1 year ago

Oh sorry, here: version = "300.1400.400+0"

chriscoey commented 1 year ago

Upgraded to Ipopt v1.4.2, but my version of Ipopt_jll is still the same, and I still get the error above. The environment variables are correctly set:

ccoey@CCoey's Macbook Pro ~ % echo $OMP_CANCELLATION
TRUE
ccoey@CCoey's Macbook Pro ~ % echo $OMP_PROC_BIND   
TRUE

and I see this when printing ENV in Julia too.

odow commented 1 year ago

I think you need to more recent version of Ipopt_jll

chriscoey commented 1 year ago

Hm OK, what is the recommended way to keep that up to date? I naively thought (and I think users would think the same...) that updating Ipopt.jl, or doing ]up, would keep everything up to date, but I did that and it doesn't do anything to Ipopt_jll. So do I need to manually add Ipopt_jll and update that?

odow commented 1 year ago

JLLs are no different than any other dependency. You probably have some other compat holding you back. If you want to force a compat bound on Ipopt_jll, you'll need to add it as an explicit dependency.

chriscoey commented 1 year ago

Weird. Perhaps it was SCIP? I just did:

(@v1.9) pkg> add Ipopt_jll
   Resolving package versions...
    Updating `~/.julia/environments/v1.9/Project.toml`
⌅ [9cc047cb] + Ipopt_jll v300.1400.400+0
  No Changes to `~/.julia/environments/v1.9/Manifest.toml`

(@v1.9) pkg> up
    Updating registry at `~/.julia/registries/General.toml`
   Installed Ipopt_jll ─ v300.1400.1302+0
   Installed SPRAL_jll ─ v2023.8.2+0
  Downloaded artifact: SPRAL
  Downloaded artifact: Ipopt
    Updating `~/.julia/environments/v1.9/Project.toml`
  [9cc047cb] ↑ Ipopt_jll v300.1400.400+0 ⇒ v300.1400.1302+0
    Updating `~/.julia/environments/v1.9/Manifest.toml`
⌃ [82193955] ↓ SCIP v0.11.13 ⇒ v0.11.6
  [e33a78d0] + Hwloc_jll v2.9.2+0
  [9cc047cb] ↑ Ipopt_jll v300.1400.400+0 ⇒ v300.1400.1302+0
  [d7ed1dd3] ↑ MUMPS_seq_jll v5.4.1+0 ⇒ v500.600.100+0
⌅ [fc9abe76] ↓ SCIP_PaPILO_jll v800.0.301+0 ⇒ v0.1.0+3
⌅ [e5ac4fe4] ↓ SCIP_jll v800.0.301+0 ⇒ v0.2.1+0
  [319450e9] + SPRAL_jll v2023.8.2+0
        Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
chriscoey commented 1 year ago

So SCIP's project.toml has ipopt_jll as a dep and no version bound, but also SCIP_jll has ipopt_jll as a dep plus a version upper bound. I think we should try to change SCIP_jll...

chriscoey commented 1 year ago

SCIP_PaPILO_jll does the same to ipopt_jll

chriscoey commented 1 year ago

And I can use SPRAL now that Ipopt_jll is updated 🥳