Skip to content

Refactor handling of timers to achieve simpler code in place of use and increase coverage #3098

@heplesser

Description

@heplesser

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:

  1. All if ( tid == 0 ) should be replaced by #pragma omp master, which should have the same effect and does not introduce barriers.
  2. We should try to move both this pragma and the #ifdef TIMER_DETAILED into the start()/stop() methods. These should be inline, so that this should not cause any overhead. It will require creating a Stopwatch subclass for DetailedStopwatch, which is inactive unless the detailed timers option is set.
  3. Add detailed timers for gathering and delivering secondary events #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)S: NormalHandle this with default priorityT: EnhancementNew functionality, model or documentationstaleAutomatic marker for inactivity, please have another look here

    Type

    No type

    Projects

    Status

    To do (open issues)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions