Limit core usage for Gurobi
AnsweredHi,
I'm using Gurobi with Python interface, and I have a WLS license.
Since my laptop has low specs, I'm running my scripts on a server. I'm getting the following error message:
GurobiError: Requested number of cores (18) is greater than allowed (8) cores
I also tried to limit the usage of cores to 8 by:
with gb.Env(empty=True) as env:
env.setParam('OutputFlag', 0)
env.setParam('Threads', 8) #Limit the number of cores used according to the license
env.start()
with gb.Model(env=env) as a:
But it doesn't work.
What I want to know is, is there any problem with my code, or my WLS license can't work when I want to use it on a computer that has more cores than allowed?
Thanks in advance!
-
Hi Yichen,
I have created an internal ticket to fix this issue.
Cheers,
David0 -
I also have this issue with WLS license in WSL2 env, attempted on the optimiser object via pyomo:
opt = SolverFactory(SET_SOLVER)
opt.options["cores"] = 8
opt.options["threads"] = 8
results = opt.solve(model, tee=True)Results in
gurobipy.GurobiError: Requested number of cores (10) is greater than allowed (8) cores
1 -
I'll create another ticket for you.
Anyone else with this issue, please see How do I resolve an "ERROR 10009: License is for 8 cores, machine has XX"?
Cheers,
David1
Please sign in to leave a comment.
Comments
3 comments