Osi icon indicating copy to clipboard operation
Osi copied to clipboard

Add loglevel control to Osi

Open svigerske opened this issue 5 years ago • 2 comments

Issue created by migration from Trac.

Original creator: @lleeoo

Original creation time: 2006-10-24 22:34:09

Assignee: @mjsaltzman

Version: 1.0

CC: @mjsaltzman

As of v 0.95, there is no direct loglevel control in Osi. Indirectly, one can use passInMessageHandler, but this typically has limited effect, since each solver has its own message handling mechanism in addition to Osi's. Instead, this ticket proposes two enhancements:

  1. make passInMessageHandler virtual, so that solver-specific actions can be taken when the Osi message handler is replaced.

  2. add virtual set/get logLevel(int) methods, which would provide a sufficiently general high-level control of messaging. What the actual int means should be left up to the solver.

svigerske avatar Mar 02 '19 19:03 svigerske

Comment by @LouHafer created at 2008-01-08 22:52:00

Essentially unchanged as 0.97 moves to 0.98.

You can use messageHandler()->setLogLevel() to adjust the log level of the OSI handler, and the OsiDoReducePrintLevel hint to (try to) affect the print level of the solver. But this is admittedly clumsy. Most annoying, there's no way to get at the message handler for a CoinMpsIO object, which by default is annoyingly chatty.

There's a lot to be said for virtual methods here, because Leo's right --- each underlying solver has its own i/o control.

svigerske avatar Mar 02 '19 19:03 svigerske

passInMessageHandler() is virtual in current Osi code and a number of OsiXyz implementations use it to setup the solvers message handling. Regarding setLogLevel(), many OsiXyz implementations check the loglevel in the message handler when it comes to a solve and set the solvers loglevel parameter accordingly.

svigerske avatar Mar 10 '19 14:03 svigerske