Hello everybody,
I am having a rather weird problem with Gurobi in c++. I'm running a code that iteratively solves a model, always adding and removing constraints at each iteration. The pseudo code is like:
while( stopping criterion )
model.optimize
if( obj value > xx )
model.addConstr( ..... )
else if ( ..... )
model.removeConstr( ... )
model.addConstr( ... )
model.update
model.optimize
if( obj valie < yy )
stop
something like that. The code usually runs without any problem, but some times it crashes with the message INCORRECT CHECKSUM when either updating the model or optimizing it, it's very random. To be more precise, this is a snippet of the code:
/* Modifies model */
GRBConstr obj1Constraint = model.getConstrByName("Obj_1");
model.remove( obj1Constraint );
model.addConstr( obj1LineExpression <= 0, "Obj_1" );
model.setObjective( obj2LineExpression, GRB_MINIMIZE );
model.update();
model.optimize();
p2.y = model.get( GRB_DoubleAttr_ObjVal );
I would this happens 3/10 times with a same instance in a same environment. Also, in even more rare occasions, the "model.remove( obj1Constraint ); " fails, saying that the constraint is not in the model. Im running Gurobi 6.5.2 on both a Mac OS X 10.12.2 as my personal computer and a Linux machine where I am conducting my tests. Sometimes when this happens in Linux, I get a huge error like this:
7fc40c000000-7fc40c637000 rw-p 00000000 00:00 0
7fc40c637000-7fc410000000 ---p 00000000 00:00 0
7fc410000000-7fc41069a000 rw-p 00000000 00:00 0
7fc41069a000-7fc414000000 ---p 00000000 00:00 0
7fc414000000-7fc4144bc000 rw-p 00000000 00:00 0
7fc4144bc000-7fc418000000 ---p 00000000 00:00 0
7fc418000000-7fc41870f000 rw-p 00000000 00:00 0
7fc41870f000-7fc41c000000 ---p 00000000 00:00 0 Aborted
which I really don't understand. The abort is happening inside the gurobi library. What could be the cause of this problem? Does anyone have any idea?
Thank you very much for any help!