Skip to main content

Inquiry on Asynchronous Optimization Calls Using Gurobipy in Python Environment

Answered

Comments

1 comment

  • Maliheh Aramon
    Gurobi Staff 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

Please sign in to leave a comment.