nest-simulator
nest-simulator copied to clipboard
Refactor handling of timers to achieve simpler code in place of use and increase coverage
Currently, timers in NEST are typically started/stopped with code like this:
if ( tid == 0 )
{
sw_communicate_prepare_.start();
}
or
#ifdef TIMER_DETAILED
if ( tid == 0 )
{
sw_gather_target_data_.start();
}
#endif
This creates a lot of visual clutter and is not as expressive as it could be in terms of OpenMP. I suggest the following:
- All
if ( tid == 0 )
should be replaced by#pragma omp master
, which should have the same effect and does not introduce barriers. - We should try to move both this pragma and the
#ifdef TIMER_DETAILED
into thestart()
/stop()
methods. These should be inline, so that this should not cause any overhead. It will require creating aStopwatch
subclass forDetailedStopwatch
, which is inactive unless the detailed timers option is set. - #3097 adds coverage for secondary event time. We should also add detailed timers for MUSIC, WFR, and Structural Plasticity (in two places) so that we have all parts of the update loop covered.
This work will required careful benchmarking to ensure that 1 & 2 do not cause longer runtimes.
Issue automatically marked stale!