I am using AMPL/CPLEX to run a decomposition scheme I created in a run file. The run file iterates through solving a master problem, checking if various metrics are met by iterating through numerous "For" and "If" statements, and then solving a number of subproblems, and checking termination criteria.
I am currently reporting the Wall Clock time that it takes for the algorithm to run by using:
param WallClockStartTime;
param WallClockRunTime;
let WallClockStartTime:= time();
. . . (Run Algorithm) . . .
let WallClockRunTime:=time()-WallClockStartTime;
How do I report the corresponding CPU time for this algorithm? I am aware of the built in AMPL timing parameters like:
_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_time := _ampl_system_time + _ampl_user_time
_total_solve_elapsed_time := elapsed seconds used by all solve commands
_total_solve_user_time := user CPU seconds used by all solve commands
_total_solve_time := _total_solve_system_time + _total_solve_user_time
However, I would like to include the CPU time of the "For" and "If" loops in addition to all of the solve commands.