JuliaSmoothOptimizers / NLPModelsJuMP.jl

Create NLPModels with JuMP
Other
34 stars 8 forks source link

MOI optimizer broke #166

Closed blegat closed 10 months ago

blegat commented 10 months ago

It seems the constructor NLPModelsJuMP.Optimizer() broke with an update of one of the dependencies. When running the tests, I get

Got exception outside of a @test
  MethodError: no method matching SolverCore.GenericExecutionStats{Float64, Vector{Float64}, Vector{Float64}, Any}()

  Closest candidates are:
    (::Type{SolverCore.GenericExecutionStats{T, S, V, Tsp}} where {T, S, V, Tsp})(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any)
     @ SolverCore ~/.julia/packages/SolverCore/iOwNg/src/stats.jl:109

  Stacktrace:
    [1] NLPModelsJuMP.Optimizer()
      @ NLPModelsJuMP ~/.julia/dev/NLPModelsJuMP/src/MOI_wrapper.jl:10

The versions used are

(NLPModelsJuMP) pkg> st
Project NLPModelsJuMP v0.12.1
Status `~/.julia/dev/NLPModelsJuMP/Project.toml`
  [4076af6c] JuMP v1.15.1
  [b8f27783] MathOptInterface v1.20.1
  [a4795742] NLPModels v0.20.0
  [01435c0c] Percival v0.7.0
  [ff4d7338] SolverCore v0.3.7
  [37e2e46d] LinearAlgebra
  [de0858da] Printf
  [2f01184e] SparseArrays
blegat commented 10 months ago

This is why it was not detected in the tests: https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl/pull/167#issuecomment-1764087888

tmigot commented 10 months ago

Ok... I am slighly surprised it ever worked now as I don't remember the last we updated the GenericExecutionStats constructor. The main one being:

 stats = GenericExecutionStats(nlp)

because it allocates some structure that are dependent of the size of the problem.

The solution might be to proceed in the same way we handle the solver?

It should be possible to make an empty constructor for the GenericExecutionStats, but it will at minima requires knowing the type used for the solution vector and the multipliers (for instance, Vector{Float64}, etc...).

blegat commented 10 months ago

Ok thanks, https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl/pull/168 should fix it by simply using nothing.

amontoison commented 10 months ago

Do you want a new release?

blegat commented 10 months ago

Yes please :)

amontoison commented 10 months ago

Ok, I will do it later today :+1:

@tmigot Do you plan to open a PR with your new empty GenericStatsExectution that you added in SolverCore.jl?

tmigot commented 10 months ago

Thanks @amontoison , I will add it later, no rush there.