[Coin-discuss] Controlling the level of output from solvers

Stefan Vigerske stefan at vigerske.de
Thu Aug 23 10:51:25 EDT 2007


Hi,

> is there any way in Osi to completely switch off all the output from the
> solvers, or redirect somewhere? I solve a problem iteratively and my own
> messages get lost in all the output...
> 
> I tried "setHintParam(OsiDoReducePrint,true,OsiHintDo)", but it does not
> help much - for example OsiGlpkSolverInterface does not seem to
> implement setHintParam at all..

This should be the way to do it, or you can try
OsiSolverInterface::messageHandler()->setLogLevel(0);
but this will not work for Glpk.
Also Clp seem to forget this from time to time, so I do this everytime
before initalSolve() or resolve().

> With OsiSolverGlpk, I even tried
> - lpx_set_int_parm(GLPK_model, LPX_K_MSGLEV, 0);
> - lpx_set_int_parm(GLPK_model, LPX_K_OUTFRQ, 1000);
> but even this does not help. (I noticed that for ex. resolve() resets
> LPX_K_MSGLEV to 1 at start, so there is not point changing it anyway, is
> it?)

The seem to be version 0.95 of Osi.
resolve() in Osi/stable/0.96 and Osi/trunk shouldn't do this anymore,
and setting OsiDoReducePrint should work there.
If not, you can setup a callback function in Glpk which Glpk uses for
printing,
  glp_term_hook(my_print_function, info);
Then you can ignore or redirect all the output in there (see Glpk manual).

> I still get the following output for each call of branchAndBound()
> (which I changed so that it uses lpx_intopt() instead of lpx_integer()):

Osi/0.96 should also recognize that lpx_intopt is available and use it.

> Any idea how to get rid of it?
> If there is no general OsiSolverInterface solution, I would appreciate
> help for Glpk, Cbc and/or Cplex.

The thing with the loglevel mentioned above works for Clp and Cplex for me.

Best,
Stefan




More information about the Coin-discuss mailing list