[Osi] reducing messages OsiCbc

Lou Hafer lou at cs.sfu.ca
Wed Nov 17 14:50:12 EST 2010


Matt,

On Sat, 2010-11-13 at 23:27 +0000, Matthew Galati wrote:

> Reducing messages.
>
> I either use OsiCbc or OsiCpx. To make them quiet, I have to do:
> m_osi.messageHandler()->setLogLevel(0);
> #ifdef __DECOMP_IP_CBC__
> m_osi.getModelPtr()->setLogLevel(0);
> #endif
>  
> I also tried the following - but it didn't help:  
> 
>     m_osi.setHintParam(OsiDoReducePrint, true, OsiHintDo);
>
> Is there a better way? Since "getModelPtr" is specific to OsiCbc, it
> forces the use of this ifdef.

	Not that I know of. This is a long-standing gripe and bugs me on a
regular basis. I'll make a note to try and fix it next time I'm in the
vicinity of that bit of code.

	Really, this is just one symptom of the fundamental architectural flaw
of OsiCbc, which is that all Osi calls are passed directly through to
the underlying linear solver. Here, as you show, you also need to
instruct the CbcModel object to do something.

	If you're feeling ambitious, OsiCbc::setHintParam is the place to put
the fix. It amounts to imbedding the #ifdef'd line in a switch on
parameter type, with some decoration to deal with sense and hint
strength; that can be lifted from one of the other OsiXXX.

						Lou




More information about the Osi mailing list