nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
26 stars 15 forks source link

RT_NAP statistics enhancement #1644

Open amishscientist opened 5 months ago

amishscientist commented 5 months ago

There at two places where the rt_nap is used in real time sims.

  1. Where it waits for all the child threads that are supposed to finish. This one can cause an overrun.
  2. When it is waiting for the wall clock time to elapse so it can start it's next frame. (This one can't cause an overrun, but can short change the start of your frame.)

I would like a small amount of stats for each of these rt_naps to be printed in the run summary.

  1. Number of rt_naps that were longer than 10% of the sims real time frame. If this number goes up a lot it might show that your box is starting to be over worked too much and you need to ether off load something or find a bigger faster box.
  2. Longest rt_nap. This gives the user a upper bound of the nap.
  3. Shortest rt_nap. This gives the user a lower bound of the nap.

This is all in an effort to help users find real over runs before they move on to the effort of tweaking the operating system to get better latency performance.

I have found as real time frame rates get smaller we are having to do more OS level tweaking to get the overruns to go away. That being said there are still a lot of overrun issues that can be solved before then. This is an attempt to help give the users and developers some prospective on how much noise the rt_naps introduces into their real time frame. The rt_nap is still very much needed because it helps sims play nice with Linux operating system fair scheduler.