Closed mmundy42 closed 6 years ago
Hi, yes I also observed that. This seems to be a bug in gurobi which ignores its own OutputFlag
parameter. You can verify that output is turned of with com.solver.problem.Params.OutputFlag == 0
.
However that output is generated on the C level and should not really affect speed too much. I have also observed that unpickling gurobi objects is slow which is due to the fact that between the 3 interfaces (glpk, cplex and gurobi) gurobi creates by far the largest objects. So unpickling will be slower.
One tip: micom.Community
has a solver
argument to which you can pass the solver used during construction. This will be much faster than changing the solver afterwards.
Thanks the tip. I didn't realize that gurobi created large objects and that explains the performance issue I found.
Yeah. For larger models (50+ species) cplex worked best for me. For smaller ones GLPK has good performance actually.
I created a simple community model with two species, set the solver to gurobi, and saved the community model using to_pickle(). When I load the community model, gurobi logs several messages which makes loading the community model slow. Is this just the way gurobi works or are there some attributes or settings I should be using to make loading a model with gurobi as the solver efficient?
Here's how I created the community model:
Then, in a new Python session, I loaded the community model with these commands: