Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make cplex not output to terminal

I am using the IBM cplex optimizer to solve an optimization problem and I don't want all terminal prints that the optimizer does. Is there a member that turns this off in the IloCplex or IloModel class? These are the prints about cuts and iterations. Prints to the terminal are expensive and my problem will eventually be on the order of millions of variables and I don't want to waste time with these superfluous outputs. Thanks.

like image 237
DiegoNolan Avatar asked Jul 25 '12 01:07

DiegoNolan


People also ask

How do you stop a run in CPLEX?

Answer. With the Interactive Optimizer, pressing Ctrl-C at any time will interrupt an on-going optimization.

Does CPLEX use simplex?

To solve such linear programming problems, CPLEX implements optimizers based on the simplex algorithms (both primal and dual simplex) as well as primal-dual logarithmic barrier algorithms and a sifting algorithm.

Is CPLEX a solver?

The CPLEX solver from IBM ILOG is a high performance solver for Linear Programming (LP), Mixed Integer Programming (MIP) and Quadratic Programming (QP/QCP/MIQP/MIQCP) problems. A detailed list of all features supported by CPLEX can be found on our Solvers page.

What is CPLEX written in?

The CPLEX Optimizer was named for the simplex method as implemented in the C programming language, although today it also supports other types of mathematical optimization and offers interfaces other than C.


1 Answers

Using cplex/concert, you can completely turn off cplex's logging to the console with

cpx.setOut(env.getNullStream())

Where cpx is an IloCplex object. You can also use the setOut function to redirect logs to a file.

There are several cplex parameters to control what gets logged, for example MIPInterval will set the number of MIP nodes searched between lines. Turning MIPDisplay to 0 will turn off the display of cuts except when new solutions are found, while MIPDisplay of 5 will show detailed information about every lp-subproblem.

Logging-related parameters include MIPInterval MIPDisplay SimDisplay BarDisplay NetDisplay

You set parameters with the setParam function.

cpx.setParam(IloCplex::MIPInterval, 1000)
like image 194
David Nehme Avatar answered Sep 23 '22 18:09

David Nehme