Execution and memory load time for large-scale AMPL model using CPLEX

We are working with a large-scale model and would like to know the estimated memory load time required for AMPL to process it properly. Additionally, we are interested in the resolve time and the total execution time of the CPLEX solver.

To see the time and memory needed for AMPL processing, execute the command

option times 1;

and then solve. The last number under total memory is the memory used for processing. The numbers under seconds show the CPU time in each phase of AMPL processing. You can see total CPU time in AMPL in the current session with

display _ampl_time;

For a more detailed breakdown of processing times, also specify

option gentimes 1;

To see the time taken by the solver in the most recent CPLEX solve, use

display _solve_elapsed_time;

(Because CPLEX runs on multiple processor cores in parallel, elapsed time is the best indicator, while CPU time is misleading.) For more detailed information about time taken in CPLEX, specify

option cplex_options 'outlev=1';
1 Like

Thank you for your response. The _solve_elapsed_time display works perfectly. However, the _ampl_time display returns a very small value, which I believe does not correspond to the actual CPU time. I’m not sure why this is happening…

The _ampl_time does not include the solver time, so it can be much smaller than the _solve_elapsed_time. This happens when AMPL processes the model and data quickly, but the resulting optimization problem is not so easy — so the solver’s algorithm needs a greater amount of time to determine a solution.

To see where AMPL is spending its time, execute the AMPL command option times 1, gentimes 1; before solving. Post the resulting output here if you need help interpreting it.