Skip to content

Error in pretty_stats with Vector in the GenericExecutionStats specifics #101

Description

@tmigot
using CUTEst, NLPModels, NLPModelsIpopt, SolverBenchmark, SolverCore
#This package
using DCISolver

nmax = 100
_pnames = CUTEst.select(
  max_var = nmax, 
  min_con = 1, 
  max_con = nmax, 
  only_free_var = true, 
  only_equ_con = true, 
  objtype = 3:6
)

#Remove all the problems ending by NE as Ipopt cannot handle them.
pnamesNE = _pnames[findall(x->occursin(r"NE\b", x), _pnames)]
pnames = setdiff(_pnames, pnamesNE)
cutest_problems = (CUTEstModel(p) for p in pnames)

#Same time limit for all the solvers
max_time = 1200. #20 minutes

solvers = Dict(
  :ipopt => nlp -> ipopt(
    nlp,
    print_level = 0,
    dual_inf_tol = Inf,
    constr_viol_tol = Inf,
    compl_inf_tol = Inf,
    acceptable_iter = 0,
    max_cpu_time = max_time,
    x0 = nlp.meta.x0,
  ),
  :dcildl => nlp -> dci(
    nlp,
    nlp.meta.x0,
    linear_solver = :ldlfact,
    max_time = max_time,
    max_iter = typemax(Int64),
    max_eval = typemax(Int64),
  ),
)
stats = bmark_solvers(solvers, cutest_problems)
pretty_stats(stats[:dcildl])

returns the following error.

ERROR: KeyError: key DenseVector{Float64} not found
Stacktrace:
 [1] getindex(h::Dict{DataType, String}, key::Type)
   @ Base ./dict.jl:482
 [2] pretty_stats(io::Base.TTY, df::DataFrames.DataFrame; col_formatters::Dict{DataType, String}, hdr_override::Dict{Symbol, String}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ SolverBenchmark ~/.julia/packages/SolverBenchmark/eOKec/src/formats.jl:66
 [3] pretty_stats(io::Base.TTY, df::DataFrames.DataFrame)
   @ SolverBenchmark ~/.julia/packages/SolverBenchmark/eOKec/src/formats.jl:42
 [4] pretty_stats(df::DataFrames.DataFrame; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ SolverBenchmark ~/.julia/packages/SolverBenchmark/eOKec/src/formats.jl:84
 [5] pretty_stats(df::DataFrames.DataFrame)
   @ SolverBenchmark ~/.julia/packages/SolverBenchmark/eOKec/src/formats.jl:84
 [6] top-level scope
   @ REPL[32]:1

My understanding is that we assume that there are no vectors in the output of the function bmark_solvers, while dci from DCISolver.jl has a vector in its stats.solver_specific. So, it looks as a bug in solve_problems function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions