Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/bmark/run_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function solve_problems(solver :: Function, problems :: Any;
colstats :: Vector{Symbol} = [:name, :nvar, :ncon, :status, :elapsed_time, :objective, :dual_feas, :primal_feas],
info_hdr_override :: Dict{Symbol,String} = Dict{Symbol,String}(),
prune :: Bool=true, kwargs...)
nprobs = length(problems)
solverstr = split(string(solver), ".")[end]

f_counters = collect(fieldnames(Counters))
Expand Down Expand Up @@ -56,7 +55,7 @@ function solve_problems(solver :: Function, problems :: Any;
end
if first_problem
for (k,v) in s.solver_specific
insertcols!(stats, ncol(stats)+1, k => Array{Union{typeof(v),Missing},1}())
insertcols!(stats, ncol(stats)+1, k => Vector{Union{typeof(v),Missing}}())
push!(specific, k)
end

Expand All @@ -70,6 +69,7 @@ function solve_problems(solver :: Function, problems :: Any;
[getfield(s.counters, f) for f in fnls_counters]; "";
[s.solver_specific[k] for k in specific]])
catch e
@error "caught exception" e
push!(stats, [problem_info; :exception; Inf; Inf; 0; Inf; Inf;
fill(0, ncounters); string(e); fill(missing, length(specific))])
finally
Expand Down
4 changes: 3 additions & 1 deletion src/stats/stats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export AbstractExecutionStats, GenericExecutionStats, Printf,

const STATUSES = Dict(:unknown => "unknown",
:first_order => "first-order stationary",
:infeasible => "problem may be infeasible",
:max_eval => "maximum number of function evaluations",
:max_time => "maximum elapsed time",
:max_iter => "maximum iteration",
Expand Down Expand Up @@ -79,12 +80,13 @@ function print(io :: IO, stats :: GenericExecutionStats; showvec :: Function=dis
@printf(io, "Generic Execution stats\n")
@printf(io, " status: "); show(io, getStatus(stats)); @printf(io, "\n")
@printf(io, " objective value: "); show(io, stats.objective); @printf(io, "\n")
@printf(io, " primal feasibility: "); show(io, stats.primal_feas); @printf(io, "\n")
@printf(io, " dual feasibility: "); show(io, stats.dual_feas); @printf(io, "\n")
@printf(io, " solution: "); showvec(io, stats.solution); @printf(io, "\n")
@printf(io, " iterations: "); show(io, stats.iter); @printf(io, "\n")
@printf(io, " elapsed time: "); show(io, stats.elapsed_time); @printf(io, "\n")
if length(stats.solver_specific) > 0
@printf(io, " solver specifics:\n")
@printf(io, " solver specific:\n")
for (k,v) in stats.solver_specific
@printf(io, " %s: ", k)
if isa(v, Vector)
Expand Down