-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attributes are ignored with JuMP #171
Comments
I've tried a bunch of different combinations of |
As linked about (#168), there is a bug in Cbc. It ignores the logLevel option when solving LPs: julia> using JuMP, Cbc
julia> model = Model(Cbc.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: COIN Branch-and-Cut (Cbc)
julia> set_optimizer_attribute(model, "logLevel", 0)
0
julia> @variable(model, x >= 2)
x
julia> @objective(model, Min, x + 1)
x + 1
julia> optimize!(model)
Optimal - objective value 2
Optimal objective 2 - 0 iterations time 0.002
julia> using JuMP, Cbc
julia> model = Model(Cbc.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: COIN Branch-and-Cut (Cbc)
julia> set_optimizer_attribute(model, "logLevel", 0)
0
julia> @variable(model, x >= 2, Int)
x
julia> @objective(model, Min, x + 1)
x + 1
julia> optimize!(model)
julia> using JuMP, Cbc
julia> model = Model(Cbc.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: COIN Branch-and-Cut (Cbc)
julia> set_optimizer_attribute(model, "logLevel", 2)
2
julia> set_optimizer_attribute(model, "presolve", "off")
"off"
julia> @variable(model, x >= 2, Int)
x
julia> @objective(model, Min, x + 1)
x + 1
julia> optimize!(model)
Welcome to the CBC MILP Solver
Version: 2.10.5
Build Date: Mar 11 2021
command line - Cbc_C_Interface -presolve off -logLevel 2 -solve -quit (default strategy 1)
Option for presolve changed from on to off
logLevel was changed from 1 to 2
Continuous objective value is 2 - 0.00 seconds
Cgl0004I processed model has 0 rows, 0 columns (0 integer (0 of which binary)) and 0 elements
Cbc3007W No integer variables - nothing to do
Cuts at root node changed objective from 2 to -1.79769e+308
Probing was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Gomory was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Knapsack was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Clique was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
FlowCover was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
ZeroHalf was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Result - Optimal solution found
Objective value: 2.00000000
Enumerated nodes: 0
Total iterations: 0
Time (CPU seconds): 0.00
Time (Wallclock seconds): 0.00
Total time (CPU seconds): 0.00 (Wallclock seconds): 0.00 The README explains how to check what options do what: https://github.com/jump-dev/Cbc.jl#options |
I wanted to set some solver attributes using JuMP, e.g.,
which wasn't working. Then I noticed that the Cbc wrapper in JuMP seems to be ignoring every attribute I try. For instance, even something ridiculous like
set_optimizer_attributes(model,"blah"=>-π)
doesn't throw an error. Is there a known solution to this? I was hoping to set verbosity and presolve off, but I'm not sure if that's even possible with Cbc and JuMP.The text was updated successfully, but these errors were encountered: