coin-or / pulp

A python Linear Programming API
http://coin-or.github.io/pulp/
Other
2.06k stars 383 forks source link

HiGHS solver doesn't seem to respect msg=False #735

Closed WPettersson closed 7 months ago

WPettersson commented 7 months ago

Details for the issue

What did you do?

Solved a problem with solver=pulp.HiGHS(msg=False).

What did you expect to see?

Very little output from the solver

What did you see instead?

Information from the solver

Useful extra information

I've uploaded a sample test script to https://gist.github.com/WPettersson/414dbd0655382ed8e0f84040d2739368 for testing - obviously you need to pip install both pulp and highspy. It runs both PULP_CBC_CMD and HiGHS from pulp as solvers with msg=False - the CBC output is indeed empty but HiGHS does output some text. The code also directly calls code from highspy after that, which has no output. This highspy code also has the line h.setOptionValue("output_flag", False). If I change this to True, then there is output from highspy between the "Start highspy" and "End highspy" lines. I think this suggests that pulp should possibly call lp.solverModel.setOptionValue("output_flag", False) if msg == False to fix this.

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

I'm using python version:

I installed PuLP via:

Did you also

pchtsp commented 7 months ago

Thanks, it should be fixed with https://github.com/coin-or/pulp/pull/736