How can limit 'Thread count' instead of using 'all available processors'?
AnsweredI am using Gurobi to solve a fairly large MILP problem (19633 continuous and 8428 integer variables) written in Pyomo. When I run the model, Gurobi uses all available resources, for example, 12 out of 12 processors of a 6-cores CPU. I want Gurobi to use a specified number of processors, not the all available. I have tried by using SolverFactory("gurobi",Threads=1), but it did not work.
0
-
Official comment
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 why not try our AI Gurobot?. -
Hi Kamal,
This can be done as follows:
optimizer = SolverFactory('gurobi')
optimizer.options['threads'] = 1For more information about passing options to solvers, see the Pyomo documentation on the topic. I hope this helps!
Eli
1 -
Hi Eli,
Thank you for the nice simple solution!
Best,
Kamal
0
Post is closed for comments.
Comments
3 comments