Skip to content
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

Cbc ignores parameters when model is an LP #168

Open
jd-lara opened this issue May 25, 2021 · 2 comments
Open

Cbc ignores parameters when model is an LP #168

jd-lara opened this issue May 25, 2021 · 2 comments
Labels
Upstream Issue with upstream library

Comments

@jd-lara
Copy link

jd-lara commented May 25, 2021

Cbc ignores the outcome of set_silent when the model is an LP. I guess this is because the attribute isn't passed to CLP.

MWE:

using JuMP, Cbc
Cbc_optimizer = JuMP.optimizer_with_attributes(Cbc.Optimizer)
m = Model(Cbc_optimizer)
x = @variable(m, upper_bound = 0)
y = @variable(m, upper_bound = 0)
@objective(m, Min, x + y)
optimize!(m)
@odow odow added the Upstream Issue with upstream library label May 25, 2021
@odow
Copy link
Member

odow commented May 25, 2021

This is an upstream issue.

using Cbc_jll
open("file.lp", "w") do io
    println(
        io, 
"""
Minimize
obj: - 2 x3

Subject To
c1: x2 - x1 <= 10
c2: x1 + x2 + x3 <= 20

Bounds
x1 <= 30

End
""",
    )
end

julia> Cbc_jll.cbc() do exe
           run(`$(exe)`)
       end

Welcome to the CBC MILP Solver 
Version: 2.10.5 
Build Date: Apr 14 2021 

CoinSolver takes input from arguments ( - switches to stdin)
Enter ? for list of commands or help
Coin:import file.lp
Coin:logLevel 0
Coin:logLevel
logLevel has value 0
Coin:solve
Presolve 0 (-2) rows, 0 (-3) columns and 0 (-5) elements
Empty problem - 0 rows, 0 columns and 0 elements
Optimal - objective value -40
After Postsolve, objective -40, infeasibilities - dual 0 (0), primal 0 (0)
Optimal objective -40 - 0 iterations time 0.002, Presolve 0.00
Coin:

Although it respects parameters at the command line

julia> Cbc_jll.cbc() do exe
           run(`$(exe) file.lp`)
       end
Welcome to the CBC MILP Solver 
Version: 2.10.5 
Build Date: Apr 14 2021 

command line - /Users/oscar/.julia/artifacts/fcc0f90ee62113a97e8e82c1b20a46265667d88d/bin/cbc file.lp (default strategy 1)
Presolve 0 (-2) rows, 0 (-3) columns and 0 (-5) elements
Empty problem - 0 rows, 0 columns and 0 elements
Optimal - objective value -40
After Postsolve, objective -40, infeasibilities - dual 0 (0), primal 0 (0)
Optimal objective -40 - 0 iterations time 0.002, Presolve 0.00
Total time (CPU seconds):       0.00   (Wallclock seconds):       0.00

Process(`/Users/oscar/.julia/artifacts/fcc0f90ee62113a97e8e82c1b20a46265667d88d/bin/cbc file.lp`, ProcessExited(0))

julia> Cbc_jll.cbc() do exe
           run(`$(exe) file.lp logLevel=0`)
       end
Process(`/Users/oscar/.julia/artifacts/fcc0f90ee62113a97e8e82c1b20a46265667d88d/bin/cbc file.lp logLevel=0`, ProcessExited(0))

@odow
Copy link
Member

odow commented Dec 12, 2022

I renamed the issue because this affects more parameters than just logLevel. For example: #211.

vtjeng added a commit to vtjeng/MIPVerify.jl that referenced this issue Feb 17, 2023
Cbc cannot be properly silenced (jump-dev/Cbc.jl#168); using HiGHS avoids the need for the workaround in #131 of using `optimize_silent!`.
vtjeng added a commit to vtjeng/MIPVerify.jl that referenced this issue Feb 17, 2023
Cbc cannot be properly silenced (jump-dev/Cbc.jl#168); using HiGHS avoids the need for the workaround in #131 of using `optimize_silent!`.
vtjeng added a commit to vtjeng/MIPVerify.jl that referenced this issue Feb 17, 2023
Cbc cannot be properly silenced (jump-dev/Cbc.jl#168); using HiGHS avoids the need for the workaround in #131 of using `optimize_silent!`.

This increases test times slightly, but is worth it to avoid the log spam without additional complexity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Upstream Issue with upstream library
Development

Successfully merging a pull request may close this issue.

2 participants