Julia - Suppressing output for Clp optimizer when solving minimization

Viewed 142

I'm developing a package in Julia that uses Clp together with JuMP to solve a Simplex problem, here is a sample of the code:

model = JuMP.Model(Clp.Optimizer)
@variable(model, x[1:size(c)[1]])
@constraint(model,A*x.==b)
@constraint(model,x.>=0)
@objective(model, Min, c'*x)
optimize!(model)

The problem is, when using Clp, the code prints the iteration steps. Here is an example:

Coin0506I Presolve 500 (-62500) rows, 62500 (0) columns and 125000 (-62500) elements
Clp0006I 0  Obj 0 Primal inf 1.9995 (500)
Clp0006I 85  Obj 5.249611e-08 Primal inf 1.9070741 (461)
Clp0006I 170  Obj 1.3219003e-06 Primal inf 1.7932731 (424)
Clp0006I 255  Obj 2.1956446e-06 Primal inf 1.6079534 (387)
Clp0006I 338  Obj 4.6964461e-06 Primal inf 1.3793942 (354)
Clp0006I 423  Obj 5.8976838e-06 Primal inf 1.4504309 (331)
...

My question is, how can I suppress this without appealing to another package as "Suppressor.jl"?

2 Answers

Just set the LogLevel:

set_optimizer_attribute(model, "LogLevel", 0)

This will stop the logs to appear.

There was a bug in Clp.j v0.8.2 issues#1883 which is fix. You just have to update to Clp.jl v0.8.3.

-- Maurice

Related