Callbacks and multithreading in Gurobi

321 views
Skip to first unread message

Michael Mueller

unread,
Jul 22, 2016, 4:10:13 PM7/22/16
to Gurobi Optimization
Hello,

I'm interested in implementing callbacks in Gurobi, for the purpose of adding lazy constraints. However, I noticed that in the documentation (https://www.gurobi.com/documentation/6.5/refman/cpp_grbcallback.html) it says that the callback is only called from a single thread; doesn't this impact performance? It is possible to have callbacks called from multiple threads in CPLEX (http://www-eio.upc.edu/lceio/manuals/cplex-11/html/usrcplex/advMIPcontrolInterface3.html), and I would like to replicate this behavior. Is there any way I can enforce this in Gurobi?

Another question I have is about the following loop that I assume happens in Gurobi (?) for an ILP: given a node, its LP relaxation is solved, then the MIPNODE callback is called (where I would add lazy constraints), and then if the LP solution did not satisfy the lazy constraints the process is repeated with another LP relaxation. I would like to be able to limit the number of times this loop runs, but I'm not sure how to do this unless I can get some sort of node ID inside the callback (similar to the NodeId in CPLEX: http://www.ibm.com/support/knowledgecenter/SSSA5P_12.4.0/ilog.odms.cplex.help/refdotnetcplex/html/T_ILOG_CPLEX_Cplex_NodeId.htm). Is it possible to do this?

Cheers,
Michael

Tobias Achterberg

unread,
Jul 23, 2016, 1:19:15 PM7/23/16
to gur...@googlegroups.com
Hi Michael,

the approach of Gurobi regarding callbacks is a bit different from CPLEX. For
parallel tree search the callback is not called immediately when a node is
processed. Instead, the nodes are buffered, and then the callback is called at
some later point in time, always from thread 0. For this reason, your second
concern also does not apply to Gurobi.

Of course, at the root node the situation is different (as this is not parallel)
and more similar to CPLEX.


Best regards,

Tobias
Reply all
Reply to author
Forward
0 new messages