What happens between "found heuristic solution" and presolving?

582 views
Skip to first unread message

Lukas Barth

unread,
May 27, 2016, 6:39:53 AM5/27/16
to Gurobi Optimization
Hi,

I'm currently trying to optimize a number of large models, and I notice that for some of them, Gurobi hangs a long time between the message "Found heuristic solution: objective -0" and before the presolving starts (or at least before there is any logging output related to presolving). What does Gurobi do in that time, and is there any way of speeding it up? Once this phase is over, solving the rest of the models works comparatively good.

I also notice that during this phase, Gurobi only uses one of the cores I assigned to it. I used 
   env.set(GRB_IntParam_Threads,num_threads);
to do so - is there a separate parameter to control the number of threads used in earlier phases? Or can these just not be run in parallel?

Thanks a lot,

Lukas

Sonja Mars

unread,
May 27, 2016, 6:48:49 AM5/27/16
to gur...@googlegroups.com
Hi Lukas,

From what you describe, I cannot tell what is going to. To investigate it would be very helpful, if you could provide the model file in MPS format. If you don't like to post it here, you can also send it support[at]gurobi.com. If it is too large for sending, please let us know.

> is there a separate parameter to control the number of threads used in earlier phases?
No, the only parameter to control the number of threads is the "Thread" parameter.

> Or can these just not be run in parallel?

If Gurobi only uses one thread and you allowed more, this normally means that the things Gurobi is doing cannot be parallelized efficiently.

Thanks and best regards,
Sonja

-----------------------------------------------------------------
Dr. Sonja Mars
Gurobi Optimization
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Lukas Barth

unread,
Jun 8, 2016, 11:38:27 AM6/8/16
to Gurobi Optimization
Hi Sonja,

sorry for taking so long, I was busy with other things but now I have an example MPS file, I think.


On Friday, May 27, 2016 at 12:48:49 PM UTC+2, Sonja Mars wrote:
From what you describe, I cannot tell what is going to. To investigate it would be very helpful, if you could provide the model file in MPS format. If you don't like to post it here, you can also send it support[at]gurobi.com. If it is too large for sending, please let us know.


You can find the (very big, 1.6 GB) MPS file here:


I'm aware that it's probably not realistic to expect Gurobi to solve such a big model before our sun goes nova. However, when Gurobi hangs between "found a heuristic solution" and "presolving", it seems not to honor the "TimeLimit" parameter. I could very well live with Gurobi telling me that it can't solve the model in the allotted time, however Gurobi freezing up the series of experiments I'm running is not good. 

Is it somehow possible to make Gurobi honor the time limit in that phase, whatever it is doing there? Or to predict for which models Gurobi will freeze for how long in that phase?

If not, I would probably have to somehow have a non-frozen thread in my program that acts as a watchdog and then somehow interrupts the model.optimize() call if it exceeds the time limit. Is it possible to interrupt Gurobi from another thread? It probably is by putting all Gurobi activities into a separate thread and then hard killing all Gurobi-related threads, but that is very hacky. Is there a nicer possibility?

I tried this with Gurobi 6.0 as well as 6.5, both show the same behavior.

Thanks for any help,

Lukas
 

Tobias Achterberg

unread,
Jun 8, 2016, 5:45:05 PM6/8/16
to gur...@googlegroups.com
Hi Lukas,

thanks for sending the model. We found the issue, which is that one particular
method in our presolve did not check the time limit. Usually, the method runs
very fast, so this is no problem, but this is not true in your case.

The issue will be fixed in the next release. Meanwhile, you can workaround the
issue by disabling the presolve method, which you can achieve using the
parameter "Aggregate=1". Moreover, you may need to disable other presolve
reductions that might be too expensive for your model. If needed, I can tell you
privately how to do this.


Tobias

Lukas Barth

unread,
Jun 9, 2016, 11:37:13 AM6/9/16
to Gurobi Optimization
Hi Tobias,

thanks a lot for the very fast response!


On Wednesday, June 8, 2016 at 11:45:05 PM UTC+2, Tobias Achterberg wrote:
The issue will be fixed in the next release.

Good to know. :)
 
Meanwhile, you can workaround the
issue by disabling the presolve method, which you can achieve using the
parameter "Aggregate=1".

That works, although for the record (if anyone finds this thread via Google..): I guess you meant "Aggregate=0". 
 
Thanks again,
Lukas

Michael Winkler

unread,
Oct 27, 2016, 11:01:29 AM10/27/16
to Gurobi Optimization
Hi Lukas,

you should try our new version 7.0 on your model, its a really nice improvement.

Cheers,
Michael

 
Reply all
Reply to author
Forward
0 new messages