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
-
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
Please sign in to leave a comment.
Comments
2 comments