2
$\begingroup$

I am solving a MILP model in C++ using Gurobi 10.1. I retrieve the CPU time of my C++ program under Linux via the following commands:

clock_t start_time;
double elapsed_time;
start_time= clock();
model.optimize();
elapsed_time = (double) (clock() - start_time)/CLOCKS_PER_SEC;

Each time I solve the same problem instance with the same gurobi options and using only ONE thread, I get different CPU times; sometimes drastically different; for example 6500 sec vs. 3800 sec.

I do not understand why, in particular, since I use only one thread. CPU time is also significantly larger than the wall-clock time.

On the other hand, the wall-clock time remains stable.

Can somebody help me understand this and fix this issue?

$\endgroup$
2
  • $\begingroup$ Might the Gurobi ver. be 9.1 instead of 10.1? Are you sure to solve the same problems by checking those fingerprints? $\endgroup$
    – A.Omidi
    Commented Jan 15, 2021 at 7:11
  • $\begingroup$ Yes, I use gurobi 10.1 for both. $\endgroup$
    – Pratim
    Commented Jan 15, 2021 at 17:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.