Timing output interpretation

Hi guys,

first of all thank you very much for sharing such a useful tool!

I wanted to ask you how I should interpret the timing output. On one example I got:
time_tot: 0.00452284 # total cpu time previous call
time_lin: 0.000916956 # cpu time for linearization
time_sim: 0.0007608240000000002 # cpu time for integrator
time_sim_ad: 0.0007382460000000001 # cpu time for integrator contribution of external function calls
time_sim_la: 0.0 # cpu time for integrator contribution of linear algebra
time_qp: 0.003321902 # cpu time qp solution
time_qp_solver_call: 0.003229635 # cpu time inside qp solver (without converting the QP)
time_qp_xcond: 8.934899999999999e-05
time_reg: 2.93e-07 # cpu time regularization

Since many of these times are not even approximately the sum of the others, I am not sure what they refer to. I also reported some comments I found in the python interface. However, what is the difference between the integrator and linearization time?

Does linearization mean integrator + system dynamics linearization + cost linearization + constraint linearization + Lagrangian Hessian computation?

Does time_sim_ad mean integrator minus the system dynamics linearization (and, eventually, Hessian computation)?

Hi Mario,

Linearization includes linearization of dynamics (discretized through integrator), cost and constraint.

Yes, all operations to compute the QP matrices.

time_sim_ad is the time that is spent in external (typically CasADi generated) functions (AD - algorithmic differentiation).
time_sim_la is the time spent in Blasfeo linear algebra within the integrator.
It is 0 in your example, probably because you use ERK.

I hope that helps,
Best,
Jonathan

Awesome! Thanks a lot Jonathan!

One last thing, I have time_reg >0 (though as you see it’s very small) even though I select the option
ocp.solver_options.regularize_method = ‘NO_REGULARIZE’
is that expected?

Great!

I just had a look and the time_reg is taken around the call to the regularization module and not inside the module.
So, the ~1e-7 should be the overhead of the empty function + the overhead of the timer.