Hi Esra,
Using the model you provided and CPLEX 12.7.1, I have not been able to reproduce the behavior you describe (nor with the most recent version, CPLEX 12.10). I used the following code (as suggested in one of the related threads I mentioned above):
#include <ilcplex/ilocplex.h>
#include <time.h>
ILOSTLBEGIN
int main (int argc, char **argv)
{
int num_solves = 20;
if (argc == 2) { }
else if (argc == 3) {
num_solves = atoi(argv[2]);
}
else {
cout << "usage: " << argv[0] << " <model-file> [<num-solves>]" << endl;
exit (2);
}
for (int c = 0; c < num_solves; c++) {
IloEnv env;
try {
IloModel model(env);
IloCplex cplex(env);
cplex.importModel(model, argv[1]);
cplex.setParam(IloCplex::TiLim, 1);
cplex.extract(model);
cplex.solve();
}
catch (IloException& e) {
cerr << "Concert exception caught: " << e << endl;
throw e;
}
catch (...) {
cerr << "Unknown exception caught" << endl;
throw;
}
double start = clock();
env.end();
double end = clock();
cout << "Time to end environment: " << (end-start) / 1000 << endl;
}
return 0;
}
Are you able to reproduce using this code? If not, are you using any non-default parameter settings? Also, if you are willing to share you program (via email) I can try with that.
------------------------------
Ryan Kersh
------------------------------
Original Message:
Sent: Wed May 20, 2020 11:11 AM
From: Esra Buyuktahtakin
Subject: Freeing CPLEX takes too much time
I can now open the attachment in the zip file. Thanks, Ryan!
--
Esra Buyuktahtakin Toy, PhD
Associate Professor
Mechanical and Industrial Engineering Department
New Jersey Institute of Technology
office: MEC 313
phone: 973-596-5705
Original Message------
I received the model from Esra via email. I'll attempt to share it as a zip file here.
EDIT: It looks like it worked. :-)
------------------------------
Ryan Kersh
------------------------------
#DecisionOptimization