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
-
Official comment
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
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
Post is closed for comments.
Comments
3 comments