Skip to main content

Use multiprocessing in Python with Gurobi

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    It looks like in your (2) form, 1 environment is used for every model solution. Since environments are not thread safe, this leads to blocking and possible errors during the optimization process.

    Thus, I do not want to define the model in the solve_model(input_data) function. Instead, define the model before that, so that I don't need to define the model repeatedly every time I call the function, which also facilitates the hot start of the model (since the feasible domain doesn't change)

    All Model objects have to be connected to a given environment. Thus, it is currently not possible to skip (or avoid) the "model building" part in your solve_model function.

    Best regards, 
    Jaromił

    0
  • Florian Götz
    • Gurobi-versary
    • Conversationalist
    • First Question

    Is this information still up to date?

    Best regards

    Thus, it is currently not possible to skip (or avoid) the "model building" part in your solve_model function.

    0
  • Jaromił Najman
    • Gurobi Staff

    Is this information still up to date?

    Yes, this information is currently still correct.

    0

Post is closed for comments.