Closed vepiteski closed 7 years ago
Can you show the code? Was that finalize
or cutest_finalize
?
It was finalize, at this stage, a problem can be any abstractNLPModel and I expected it to be overloaded with the specific version for any model. I also added printskip to eventually print skipped problems.
function solve_problems(solver :: Function, problems :: Any; prune :: Bool=true, printskip :: Bool = false, kwargs...)
display_header()
nprobs = length(problems)
verbose = nprobs ≤ 1
stats = -ones(nprobs, 3)
k = 0
for problem in problems
try
(f, g, h) = solve_problem(solver, problem, verbose=verbose; kwargs...)
k = k + 1
stats[k, :] = [f, g, h]
catch e
isa(e, SkipException) || rethrow(e)
printskip && @printf("%-15s %8d ncons = %-8d %13s skipped\n",problem.meta.name,
problem.meta.nvar, problem.meta.ncon, unconstrained(problem.meta) ? "unconstrained" :
"constrained")
end
finalize(problem)
end
return prune ? stats[1:k, :] : stats
end
Ah ok, looks like finalize
is the default for Julia (http://docs.julialang.org/en/release-0.5/stdlib/base/), not specifically for NLPModels. cutest_finalize
is not a finalizer
yet. It should be easy to change that, though. I'm currently debugging another thing, then I'll go to that.
Closed by #91
Even if I added finalize(problem) in solve_problems, CUTE complains: ERROR: LoadError: CUTEst: call cutest_finalize on current model first