Search code examples
scip

How can I disable warning output in SCIP?


How can I fix the warning:

WARNING: Original variable <x> not released when freeing SCIP problem <my_solver>.

which is spammed once per x.

Option 1: Disable output.

Ref: https://www.scipopt.org/doc/html/PARAMETERS.php Verblevel=0 disables stdout, but not errors / warnings. How can I tell SCIP to be quiet?

Option 2: Fix alleged memory leak.

This happens even though I am apparently freeing the problem, variables, constraints, and expressions correctly. I can verify this by attempting to free them another time, and watching the program explode.

This answer: http://listserv.zib.de/pipermail/scip/2020-December/004161.html implies this happens when using transform operations, which I am not doing.

I've also verified that there are no memory leaks using valgrind, though it claims there is some memory "still reachable", that memory does not grow no matter how many problems I set up and solve.


Solution

  • Per suggestions by @stefan, the simplest way to disable warning output is to use:

    void SCIPsetMessagehdlrQuiet ( SCIP * scip, SCIP_Bool quiet )   
    

    Defined here (for 8.0): https://scipopt.org/doc/html/group__MessageOutputMethods.php#gadd04befbbea2ee42599ee26db33d52c9

    Passing true did in fact disable those warnings.