Skip to content
Open
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
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ version = "0.2.0"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JSOSolvers = "10dff2fc-5484-5881-a0e0-c90441020f8a"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
NLPModelsTest = "7998695d-6960-4d3a-85c4-e1bceb8cd856"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
Comment on lines 6 to 16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense. It's the Project.toml in the same folder of index.jmd that should be updated

Expand Down
30 changes: 30 additions & 0 deletions tutorials/introduction-to-solverbenchmark/index.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,33 @@ p = profile_solvers(stats, costs, costnames)
Here is a useful tutorial on how to use the benchmark with specific solver:
[Run a benchmark with OptimizationProblems](https://jso.dev/OptimizationProblems.jl/dev/benchmark/)
The tutorial covers how to use the problems from `OptimizationProblems` to run a benchmark for unconstrained optimization.

### Handling `solver_specific` in stats
If a solver's GenericExecutionStats contains a `solver_specific` dictionary
, a column is created for
each key in that dictionary in the per-solver `DataFrame`.

Here is a example showing how to set a solver-specific flag and then access it for tabulation:
```julia
using NLPModelsTest, DataFrames, SolverCore, SolverBenchmark

function newton(nlp)
stats = GenericExecutionStats(nlp)
set_solver_specific!(stats, :isConvex, true)
return stats
end

solvers = Dict(:newton => newton)
problems = [NLPModelsTest.BROWNDEN()]
stats = bmark_solvers(solvers, problems)

combined_stats = DataFrame(
name = stats[:newton].name,
nvars = stats[:newton].nvar,
convex = stats[:newton].isConvex,
newton_iters = stats[:newton].iter,
)

combined_stats.convex = string.(combined_stats.convex)
pretty_stats(combined_stats)
Comment on lines +243 to +252
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need all this? Isn't the result of bmark_solvers sufficient ?

```