Skip to main content

Inquiry on Asynchronous Optimization Calls Using Gurobipy in Python Environment

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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.
  • Maliheh Aramon
    • Gurobi Staff

    Hi Gabriel, 

    We do not support asynchronous optimization in Python because the gurobipy module is not thread-safe. Therefore, there is no method similar to the GRBModel.optimizeasync() method of C++ Gurobi API in the Gurobi Python API.

    • We support batch optimization with Gurobi Cluster Manager (see the batchmode.py python example). Unfortunately, this option is not still available via the Gurobi Instant Cloud. However, this feature is in our roadmap and will be added to the Gurobi Instant Cloud at some point in the future Gurobi releases.
    • You can use the Python multiprocessing module to spawn multiple Gurobi jobs to be run in parallel in the Gurobi Instant Cloud. The runs will be done synchronously. If this is an option for you, you might find the article on How do I use multiprocessing in Python with Gurobi? useful. I think this option covers all your three objectives. 

    Best regards,

    Maliheh

    1

Post is closed for comments.