Pyomo + MPI => 1 environment per process
回答済みHello,
I am using the third-party modeling framework, Pyomo, as well as MPI (mpi4py) to run several instances of Gurobi in parallel.
How can I have each process create its own environment?
Many thanks,
Jake
-
正式なコメント
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. -
Unfortunately, it's not currently possible to explicitly manage Gurobi environments in Pyomo. There is an open issue in the Pyomo GitHub repository about this (Pyomo/pyomo#2408).
0 -
Hi Eli,
Is there a workaround to use multiprocessing with Pyomo to ensure that I won't have more than one thread within a single environment?
Thanks,
Jake
0 -
Do you mean that for each process, you would like to re-use a single environment for all models solved by that process? This would be the best way to limit your token usage. I believe Pyomo creates a new environment for each model. This would explain why you run out of tokens, as you mention in your other community post.
As far as I know, re-using a single environment like this isn't possible in Pyomo unless you modify Pyomo's source code yourself to support it. The other workaround is to build your model using Gurobi's native Python API.
0 -
Hi Eli,
I instead dispose of the environment. This is a fine solution, given the model isn't costly to build.
Thanks,
Jake
0
投稿コメントは受け付けていません。
コメント
5件のコメント