Skip to content

Commit

Permalink
Merge branch 'jari-integration' of github.com:terhorstd/nest-simulato…
Browse files Browse the repository at this point in the history
…r into jari-integration
  • Loading branch information
terhorstd committed Jul 4, 2024
2 parents c9dafd8 + f0316a2 commit c0aa7ab
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions nestkernel/event_delivery_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ EventDeliveryManager::finalize( const bool )
}
off_grid_emitted_spikes_register_.clear();

for ( auto it : spike_recv_register_ )
for ( auto& it : spike_recv_register_ )
{
it->clear();
delete ( it );
Expand Down Expand Up @@ -656,11 +656,14 @@ EventDeliveryManager::deliver_events_( const size_t tid, const std::vector< Spik
if ( kernel().connection_manager.use_compressed_spikes() )
{
// when compressed, spikes do not have lcid set, so we need to do a lookup here and uncompress
for ( auto spike_data :
for ( auto& uncompressed_spike_data :
kernel().connection_manager.get_compressed_spike_data( spike_data.get_syn_id(), spike_data.get_lcid() ) )
{
( *spike_recv_register_[ tid ] )[ spike_data.get_tid() ][ spike_data.get_syn_id() ][ spike_data.get_lag() ]
.push_back( spike_data );
if ( uncompressed_spike_data.get_lcid() != invalid_lcid )
{
( *spike_recv_register_[ tid ] )[ uncompressed_spike_data.get_tid() ][ uncompressed_spike_data.get_syn_id() ][ spike_data.get_lag() ]
.push_back( uncompressed_spike_data );
}
}
}
else // spikes are already uncompressed
Expand Down Expand Up @@ -688,7 +691,7 @@ EventDeliveryManager::deliver_events_( const size_t tid, const std::vector< Spik
for ( size_t lag = 0; lag < srr_w_tid[ syn_id ].size(); ++lag )
{
se.set_stamp( prepared_timestamps[ lag ] );
for ( auto it_spike_data : srr_w_tid[ syn_id ][ lag ] )
for ( const auto it_spike_data : srr_w_tid[ syn_id ][ lag ] )
{
se.set_offset( it_spike_data.get_offset() );

Expand All @@ -715,17 +718,17 @@ EventDeliveryManager::resize_spike_recv_register_()
const long mindelay_steps = kernel().connection_manager.get_min_delay();

spike_recv_register_.resize( num_threads );
for ( auto it_w_tid : spike_recv_register_ )
for ( auto& it_w_tid : spike_recv_register_ )
{
if ( it_w_tid == NULL )
if ( it_w_tid == nullptr )
{
it_w_tid = new std::vector< std::vector< std::vector< std::vector< SpikeData > > > >();
}
it_w_tid->resize( num_threads );
for ( auto it_r_tid : *it_w_tid )
for ( auto& it_r_tid : *it_w_tid )
{
it_r_tid.resize( num_synapse_types );
for ( auto it_syn_id : it_r_tid )
for ( auto& it_syn_id : it_r_tid )
{
it_syn_id.resize( mindelay_steps );
}
Expand All @@ -736,11 +739,11 @@ EventDeliveryManager::resize_spike_recv_register_()
void
EventDeliveryManager::reset_spike_recv_register_( const size_t tid )
{
for ( auto it_r_tid : ( *spike_recv_register_[ tid ] ) )
for ( auto& it_r_tid : ( *spike_recv_register_[ tid ] ) )
{
for ( auto it_syn_id : it_r_tid )
for ( auto& it_syn_id : it_r_tid )
{
for ( auto it_lag : it_syn_id )
for ( auto& it_lag : it_syn_id )
{
it_lag.clear();
}
Expand Down

0 comments on commit c0aa7ab

Please sign in to comment.