Ocp_solver.get_stats time measurement

Hi :wave:
When I build acados with OpenMP, and I run ocp_solver.get_stats, I get the following timings:

time_tot 2.098068
time_lin 0.095448
time_sim 1.0309870000000019
time_sim_ad 0.6132290000000019
time_sim_la 0.13030699999999804
time_qp 1.9827329999999999
time_qp_solver_call 1.9303269999999997
time_qp_xcond 0.05209400000000001
time_glob 4.9999999999999996e-06
time_solution_sensitivities 0.0
time_reg 9e-06

If I build without OpenMP, I get the following:

time_tot 2.312181
time_lin 0.256899
time_sim 0.20957899999998672
time_sim_ad 0.12318699999999419
time_sim_la 0.062420999999999435
time_qp 2.039334
time_qp_solver_call 1.996788
time_qp_xcond 0.042325
time_glob 4e-06
time_solution_sensitivities 0.0
time_reg 1e-05

It seems odd to me that the time_sim is smaller in the version without OpenMP. The possible explanation I came up with is that whatever timer is running inside acados measures change in wall-clock time, rather than the time spent in the thread performing the simulation. Is that whatโ€™s happening, or is there another reason?


yes pretty much as you said.
The time_sim is the sum of the time spent in all integrators, which are called in parallel in case of using openMP.