Skip to main content

When are MIP callbacks executed ?




  • Erdem Banak
    First Comment

    This question is tagged as answered but I couldn't find the answer. Would you able to provide how you solved this issue?

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Erdem, this post was actually converted into an internal ticket and answered there, as the poster is a commercial customer.  The responses were as follows:

    1. When do MIP callbacks with where = 3 first executed ? The documentation says "in MIP" but what does that mean exactly, as there are different phases in a MIP solve (presolve, root node solve, B&B tree etc.).
    2. How frequently are the MIP callbacks executed ? Like, MIPSOL and MIPNODE callbacks are executed whenever a new incumbent is found or a node is being explored respectively. Is there a set frequency for the MIP callbacks ?

    The MIP callback is called at the following places: inside the NoRel Heuristic, when solving the root node and inside every node. You can find out at which phase the MIP callback has been called via the MIP_PHASE value. So the first time that the callback is executed depends for example on whether you are using the NoRel heuristic or note. There is no specific frequency set for the MIP callbacks, they are called at the places mentioned above.

    3. Similar to the POLLING callbacks, is there a callback which will be executed periodically (say, every 10 seconds or so), the time_interval being a user input. Right now, we are maintaining an interval counter in the MIP callback to check if the time_interval has elapsed or not.

    There is no other callback that will be executed periodically besides the POLLING callback. Also, the time_interval of the POLLING callback cannot be set by the user. The way to achieve this is as you are doing now, by manually maintaining an interval counter. This is to avoid extensive callback usage and possible performance degradation, especially when using remote services. It is sometimes also possible that one thread is taking a bit longer because a node LP is harder to solve.

    4. Does the return value of cget.RUNTIME differ if we are using Gurobi Compute Server or not ? Meaning, does that function return the total time spent in GCS queue + actual solve time, or only the time since the solve actually started ?

    The RUNTIME "what" value always returns the elapsed solver runtime. That is, it does not account for the time spent in the Compute Server queue. However, this time might differ when using a Compute Server vs. when running the code locally, depending on the performance of the machine.

    - Riley


Please sign in to leave a comment.