is the code correct to set parameters in Gurobi

Hello,

I am using Gurobi as the solver in Julia to solve the problem but now encountered the out-of-memory error.


I understand that Gurobi has parameters such as NodefileStart and Thread to deal with this problem (http://www.gurobi.com/documentation/8.0/refman/nodefilestart.html#parameter:NodefileStart). I have been trying to use these parameters, however, error persists. For example, I set NodefileStart=0.1, but 10 hours later, Gurobi threw the error and stopped. But when I check my disks, there is no new file written.

I am wondering

  1. am I using the code to set parameters correctly?
    It looks correct – when I set TimeLimit=10 in the code, the solver will stop in 10 seconds. But why would there be no new files written to store the information when the memory is not enough? Below is my code:

using JuMP, Gurobi, ConditionalJuMP
env = Gurobi.Env()
m = Model(solver=GurobiSolver(env))
cd(“$(homedir())/Desktop”)
pwd()
setparams!(env, TimeLimit=54000, Symmetry=2, NodefileStart=0.1, NodefileDir=“D:\nodes”, ResultFile=“MySolution.sol”)

If timelimit is reached and solver is stopped, I would use below to update parameters:

setparams!(env, MIPFocus=3, TimeLimit=7200, Cuts=3, Symmetry=2, ResultFile=“MySolution.sol”)
setSolver(m,GurobiSolver(env))

  1. if the code to set parameters is correct, why wouldn’t it work? Is it because the root cause of memory not enough is not node files but some other reasons? Then what it is?

I would also post this question in Gurobi community for help if I ask in the wrong place. Many thanks.

Best Regards,
Summer

Hi @Summer,

You can set parameters on the model (as suggested in your thread on the Gurobi forum) by passing them to the GurobiSolver object instead of the env as follows:

env = Gurobi.Env()
model = Model(solver = GurobiSolver(env, TimeLimit=10))
2 Likes

Thank you Oscar, I would try that if the problem comes out again. :slight_smile: