Skip to main content

Use multiprocessing in Python with Gurobi

Answered

Comments

3 comments

  • Jaromił Najman
    Gurobi Staff 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 Gurobi Staff

    Is this information still up to date?

    Yes, this information is currently still correct.

    0

Please sign in to leave a comment.