Skip to main content

Is Parallel exploration of tree for MIP concurrent with callback execution?

Answered

Comments

3 comments

  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Lee,

    During a parallel optimization, all threads are communicating with each other. This includes new incumbents. They will all be reported to your callback.

    While your callback is executed, the other threads are not going to continue exploring the tree. You can test this by adding a sleep() call in your callback.

    The more threads you are using the more likely it is that new incumbents are found at the same time. This can also mean that one of those new solutions is not improving the current primal bound anymore. In such a case, you should not see this solution in your callback. You will also not see this solution reported in the log.

    Does that answer your question?

    Cheers,
    Matthias

    0
  • Lee Mitchell
    Gurobi-versary
    First Comment
    First Question

    Matthias, thank you for your reply.  Yes you have answered my questions.

    My hope was that Gurobi would continue to explore the tree while my callback is executed by one thread, but I understand this is not that case.

    As a follow up question:  Does your answer apply regardless of the programming language used, or is your answer specific to python ?  (I am currently using python.) 

    Thanks again, Lee

    0
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Lee,

    Every interface is a wrapper of the C API, so this behavior is the same for all programming languages.

    See also here: https://www.gurobi.com/documentation/9.0/refman/index.html

    Cheers,
    Matthias

    0

Please sign in to leave a comment.