From cc2cc36f7dca602a4bc944da40ff28fc73c303fd Mon Sep 17 00:00:00 2001 From: Pierre Martinon Date: Mon, 16 Feb 2026 15:26:01 +0100 Subject: [PATCH 1/3] bench update --- test/benchmark.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/benchmark.jl b/test/benchmark.jl index e25e3910..caa54f6e 100644 --- a/test/benchmark.jl +++ b/test/benchmark.jl @@ -214,7 +214,7 @@ function bench(; if target_list isa Symbol target_list = target_dict[target_list] end - verbose > 1 && println("Problem list: ", target_list) + verbose > 0 && println("Problem list: ", target_list) problem_list = [] for problem_name in target_list ocp_data = getfield(Main, Symbol(problem_name))() @@ -222,17 +222,17 @@ function bench(; end # solve problem list for all grid sizes - verbose > 1 && println("Grid size list: ", grid_size_list) + verbose > 0 && println("Grid size list: ", grid_size_list) t_bench = zeros(Float64, (length(problem_list), length(grid_size_list))) i_bench = zeros(Int, (length(problem_list), length(grid_size_list))) s_bench = zeros(Bool, (length(problem_list), length(grid_size_list))) solutions = Array{Any}(undef, (length(problem_list), length(grid_size_list))) i = 1 for problem in problem_list - verbose > 1 && @printf("Testing problem %-20s: grid ", problem[:name]) + verbose > 0 && @printf("Testing problem %s: ", problem[:name]) j = 1 for grid_size in grid_size_list - verbose > 1 && @printf("%d ", grid_size) + verbose > 0 && @printf("%d ", grid_size) flush(stdout) time, iter, success, sol = bench_problem( problem; @@ -247,7 +247,7 @@ function bench(; solutions[i, j] = sol j = j + 1 end - verbose > 1 && println("") + verbose > 0 && print("\r\e[K") i = i + 1 end @@ -256,7 +256,7 @@ function bench(; if verbose > 0 i = 1 for problem in problem_list - @printf("%-22s", problem[:name]) + @printf("%-25s", problem[:name]) for j in 1:length(grid_size_list) if s_bench[i, j] @printf("%6.2f(%3d) ", t_bench[i, j], i_bench[i, j]) @@ -267,6 +267,7 @@ function bench(; println("") i = i + 1 end + println("") end # summary From a8a6324cea602f3934256faf9a21976548fb839d Mon Sep 17 00:00:00 2001 From: Pierre Martinon Date: Mon, 16 Feb 2026 16:08:31 +0100 Subject: [PATCH 2/3] bench --- src/collocation.jl | 2 ++ test/benchmark.jl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/collocation.jl b/src/collocation.jl index 35d3e547..9df3bc07 100644 --- a/src/collocation.jl +++ b/src/collocation.jl @@ -134,6 +134,7 @@ function (discretizer::Collocation)(ocp::AbstractModel) kwargs... )::ADNLPModels.ADNLPModel + #let docp_local = docp # functions for objective and constraints f = x -> CTDirect.DOCP_objective(x, docp) c! = (c, x) -> CTDirect.DOCP_constraints!(c, x, docp) @@ -189,6 +190,7 @@ function (discretizer::Collocation)(ocp::AbstractModel) ) return nlp + #end end # Solution builder for ADNLPModels diff --git a/test/benchmark.jl b/test/benchmark.jl index caa54f6e..9c6d16ec 100644 --- a/test/benchmark.jl +++ b/test/benchmark.jl @@ -204,6 +204,7 @@ function bench(; target_list=:all, grid_size_list=[250, 500, 1000], solver=:ipopt, + timer=false, return_sols=false, save_sols=false, kwargs..., @@ -239,6 +240,7 @@ function bench(; grid_size=grid_size, verbose=verbose-1, solver=solver, + timer=timer, kwargs..., ) t_bench[i, j] = time From 2970003513baca0ded926f1223e3bf9b05fc687c Mon Sep 17 00:00:00 2001 From: Pierre Martinon Date: Mon, 16 Feb 2026 16:46:24 +0100 Subject: [PATCH 3/3] bench --- src/collocation.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/collocation.jl b/src/collocation.jl index 9df3bc07..c851dcbb 100644 --- a/src/collocation.jl +++ b/src/collocation.jl @@ -134,7 +134,6 @@ function (discretizer::Collocation)(ocp::AbstractModel) kwargs... )::ADNLPModels.ADNLPModel - #let docp_local = docp # functions for objective and constraints f = x -> CTDirect.DOCP_objective(x, docp) c! = (c, x) -> CTDirect.DOCP_constraints!(c, x, docp) @@ -190,7 +189,7 @@ function (discretizer::Collocation)(ocp::AbstractModel) ) return nlp - #end + end # Solution builder for ADNLPModels