Skip to content

Commit

Permalink
Merge pull request #3097 from heplesser/add_sec_ev_timer
Browse files Browse the repository at this point in the history
Add detailed timers for gathering and delivering secondary events
  • Loading branch information
heplesser authored Feb 14, 2024
2 parents 06fa45b + e5bfa28 commit df4c93e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nestkernel/nest_names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,9 @@ const Name time_communicate_spike_data( "time_communicate_spike_data" );
const Name time_communicate_target_data( "time_communicate_target_data" );
const Name time_construction_connect( "time_construction_connect" );
const Name time_construction_create( "time_construction_create" );
const Name time_deliver_secondary_data( "time_deliver_secondary_data" );
const Name time_deliver_spike_data( "time_deliver_spike_data" );
const Name time_gather_secondary_data( "time_gather_secondary_data" );
const Name time_gather_spike_data( "time_gather_spike_data" );
const Name time_gather_target_data( "time_gather_target_data" );
const Name time_in_steps( "time_in_steps" );
Expand Down
2 changes: 2 additions & 0 deletions nestkernel/nest_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ extern const Name time_communicate_spike_data;
extern const Name time_communicate_target_data;
extern const Name time_construction_connect;
extern const Name time_construction_create;
extern const Name time_deliver_secondary_data;
extern const Name time_deliver_spike_data;
extern const Name time_gather_secondary_data;
extern const Name time_gather_spike_data;
extern const Name time_gather_target_data;
extern const Name time_in_steps;
Expand Down
22 changes: 22 additions & 0 deletions nestkernel/simulation_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ nest::SimulationManager::reset_timers_for_dynamics()
sw_simulate_.reset();
#ifdef TIMER_DETAILED
sw_gather_spike_data_.reset();
sw_gather_secondary_data_.reset();
sw_update_.reset();
sw_deliver_spike_data_.reset();
sw_deliver_secondary_data_.reset();
#endif
}

Expand Down Expand Up @@ -443,9 +445,11 @@ nest::SimulationManager::get_status( DictionaryDatum& d )
def< double >( d, names::time_communicate_prepare, sw_communicate_prepare_.elapsed() );
#ifdef TIMER_DETAILED
def< double >( d, names::time_gather_spike_data, sw_gather_spike_data_.elapsed() );
def< double >( d, names::time_gather_secondary_data, sw_gather_secondary_data_.elapsed() );
def< double >( d, names::time_update, sw_update_.elapsed() );
def< double >( d, names::time_gather_target_data, sw_gather_target_data_.elapsed() );
def< double >( d, names::time_deliver_spike_data, sw_deliver_spike_data_.elapsed() );
def< double >( d, names::time_deliver_secondary_data, sw_deliver_secondary_data_.elapsed() );
#endif
}

Expand Down Expand Up @@ -841,7 +845,19 @@ nest::SimulationManager::update_()
}
if ( kernel().connection_manager.secondary_connections_exist() )
{
#ifdef TIMER_DETAILED
if ( tid == 0 )
{
sw_deliver_secondary_data_.start();
}
#endif
kernel().event_delivery_manager.deliver_secondary_events( tid, false );
#ifdef TIMER_DETAILED
if ( tid == 0 )
{
sw_deliver_secondary_data_.stop();
}
#endif
}


Expand Down Expand Up @@ -1044,8 +1060,14 @@ nest::SimulationManager::update_()
}
if ( kernel().connection_manager.secondary_connections_exist() )
{
#ifdef TIMER_DETAILED
sw_gather_secondary_data_.start();
#endif
kernel().event_delivery_manager.gather_secondary_events( true );
}
#ifdef TIMER_DETAILED
sw_gather_secondary_data_.stop();
#endif
}


Expand Down
2 changes: 2 additions & 0 deletions nestkernel/simulation_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ class SimulationManager : public ManagerInterface
#ifdef TIMER_DETAILED
// intended for internal core developers, not for use in the public API
Stopwatch sw_gather_spike_data_;
Stopwatch sw_gather_secondary_data_;
Stopwatch sw_update_;
Stopwatch sw_gather_target_data_;
Stopwatch sw_deliver_spike_data_;
Stopwatch sw_deliver_secondary_data_;
#endif
};

Expand Down

0 comments on commit df4c93e

Please sign in to comment.