-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gurobi Always Printing to Console #22107
Comments
One recent change was #21345, and perhaps I made a mistake there? If you have time, you could try reverting that a let me know if it's to blame. |
Ah. The old code set Does this solve it? --- a/solvers/gurobi_solver.cc
+++ b/solvers/gurobi_solver.cc
@@ -954,9 +954,7 @@ void GurobiSolver::DoSolve2(const MathematicalProgram& prog,
// Copy the remaining options into model_env.
options->Respell([](const auto& common, auto* respelled) {
- if (common.print_to_console) {
- respelled->emplace("LogToConsole", 1);
- }
+ respelled->emplace("LogToConsole", common.print_to_console ? 1 : 0);
if (!common.print_file_name.empty()) {
respelled->emplace("LogFile", common.print_file_name);
} |
Yup. https://www.gurobi.com/documentation/10.0/refman/logtoconsole.html#parameter:LogToConsole I'll open a PR with that patch and ask for testing. |
Now that I'm manually setting some additional Gurobi parameters (like number of threads), I'm getting spammed again -- this time with messages like |
Sigh. I imagine the full solution is to call a hard-coded |
BTW I don't have a lot of time today, and I don't have convenient access to a Gurobi license to test, so I'd welcome any contributors' fixes. |
I can confirm that dropping that in anytime before |
What happened?
I've recently observed that when Gurobi is used to solve a MathematicalProgram, the verbose output is always printed to the console. @wernerpe also observed this behavior. For methods that require solving many optimization problems, the output completely clogs the console, and can even crash a jupyter notebook.
Version
16e7281
What operating system are you using?
Ubuntu 22.04, Other
What installation option are you using?
compiled from source code using CMake, compiled from source code using Bazel
Relevant log output
No response
The text was updated successfully, but these errors were encountered: