Originally posted by: SystemAdmin
I tried, but was unable to reproduce the issue using a model with 60K constraints and 160K columns. Are you sure that the delay occurs in the 'env.end()' function call? Is 'cplex.clearModel()' in your code as well? If it is and you are ending the environment in every iterations, then clearModel need not be called; so can you comment that and try again?
If you have a sav/mps/lp version of the underlying IP, you could try using the following program to see if 'env.end()' really takes that long. Do change <file_path> with your sav/mps/lp full path name (like, "C:\\test\\check.lp") and the TiLim parameter if need be.
#include <ilcplex/ilocplex.h>
#include <time.h>
ILOSTLBEGIN
int main (int argc, char **argv)
{
for(int c=0;c<20;c++){
IloEnv env;
try {
IloModel model(env);
IloCplex cplex(env);
cplex.importModel(model, <file_path>);
cplex.setParam(IloCplex::TiLim,1);
cplex.extract(model);
cplex.solve();
}
catch (IloException& e) {
cerr << "Concert exception caught: " << e << endl;
}
catch (...) {
cerr << "Unknown exception caught" << endl;
}
double start = clock();
env.end();
double end = clock();
cout<<"Time to end environment:"<<(end-start)/1000<<endl;
}
return 0;
} // END main
#CPLEXOptimizers#DecisionOptimization