I am currently developing a medium-sized cutting stock model in AMPL using CPLEX as the solver.
I am trying to analyze the computational times of my model, but I have noticed a significant discrepancy between the reported solver time and the actual wall-clock time. Specifically, when I use the command:
display _solve_elapsed_time;
AMPL reports approximately 10 seconds of solving time. However, when I measure the time manually with a stopwatch, the entire process takes more than 20 minutes.
Could you please clarify why there is such a large difference between these two measurements? Is it correct to assume that AMPL spends a considerable amount of time on model generation and data loading before the solver is invoked?
Also, could you let me know which internal AMPL options or commands can be used to accurately measure:
The total elapsed (wall-clock) time, including model and data loading; and
The time spent specifically in the solver?
Thank you very much for your help and clarification.
The _solve_xxx parameters don’t include AMPL times.
There are separated built-in parameters for AMPL times (model/data loading, compilation/generation of the model, presolve, writing the NL file…) and the Solver times.
Here it’s the table with all these built-in parameters:
AMPL Process Timing
_ampl_elapsed_time - Elapsed seconds since the start of the AMPL process
_ampl_system_time - System CPU seconds used by the AMPL process itself
_ampl_user_time - User CPU seconds used by the AMPL process itself
_ampl_time - _ampl_system_time + _ampl_user_time
Most Recent Shell Command
_shell_elapsed_time - Elapsed seconds for most recent shell command
_shell_system_time - System CPU seconds used by most recent shell command
_shell_user_time - User CPU seconds used by most recent shell command