how to set the memory parameter in a Gurobi model using c++?
AnsweredI'm trying to set a memory limit to my Gurobi Model.
GRBEnv env = GRBEnv(true);
env.set("LogFile", "Model_DEBUG.log");
env.start();
GRBModel model = GRBModel(env);
model.getEnv().set(GRB_DoubleParam_MemLimit, 8);
But, this doesn't work. How could I set this parameter?
I'm trying to set 8Gb of ram to my gurobi model, considering the c++ language
0
-
Hi Igor,
Which Gurobi version are you using? In version 9.5 the MemLimit parameter had to be set before starting the environment. If you are using 9.5, your code should be replaced by
GRBEnv env = GRBEnv(true); env.set("LogFile", "Model_DEBUG.log");
env.set("MemLimit", 8); env.start(); GRBModel model = GRBModel(env);But starting from version 10.0 your original snippet should work.
Elisabeth
0 -
Thank you very much, I'll try this way
0
Please sign in to leave a comment.
Comments
2 comments