Skip to content

Commit aaf91ce

Browse files
committed
remove warning + add timer + remove useless test
1 parent 8d35652 commit aaf91ce

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

test/runtests.jl

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const list_problems_not_PureJuMP = Symbol[]
2626
const list_problems_PureJuMP = setdiff(list_problems, list_problems_not_PureJuMP)
2727

2828
include("test-defined-problems.jl")
29-
@everywhere include("test-utils.jl")
29+
include("test-utils.jl")
3030

3131
@everywhere function make_ad_nlp(prob::Symbol; kwargs...)
3232
mod = ADNLPProblems
@@ -43,7 +43,17 @@ end
4343
nvar = OptimizationProblems.eval(Symbol(:get_, prob, :_nvar))()
4444
ncon = OptimizationProblems.eval(Symbol(:get_, prob, :_ncon))()
4545

46-
@time nlp_ad = make_ad_nlp(prob)
46+
function timed_info(label, f, args...; kwargs...)
47+
stats = @timed f(args...; kwargs...)
48+
msg = "$(label) took $(round(stats.time, digits=2)) s " *
49+
"($(Base.format_bytes(stats.bytes)) allocated, " *
50+
"GC $(round(100*stats.gctime/stats.time, digits=1)) %, " *
51+
"compile $(round(100*stats.compile_time/stats.time, digits=1)) %)"
52+
@info msg
53+
return stats.value
54+
end
55+
56+
nlp_ad = timed_info("Instantiating $(pb)", make_ad_nlp, prob)
4757

4858
@test nlp_ad.meta.name == pb
4959

@@ -63,20 +73,6 @@ end
6373
end
6474
end
6575

66-
@testset "Test for nls_prob flag for $prob" begin
67-
nls_prob = begin
68-
mod = ADNLPProblems
69-
if isdefined(mod, prob)
70-
getfield(mod, prob)(; use_nls = true)
71-
else
72-
nothing
73-
end
74-
end
75-
if (typeof(nls_prob) <: ADNLPModels.ADNLSModel) # if the nls_flag is not supported we ignore the prob
76-
test_in_place_residual(prob, nls_prob)
77-
end
78-
end
79-
8076
model = begin
8177
mod = PureJuMP
8278
if isdefined(mod, prob)

0 commit comments

Comments
 (0)