Skip to content

Commit

Permalink
Merge pull request #2665 from JanVogelsang/master
Browse files Browse the repository at this point in the history
Set sender node id info with correct target lcid
  • Loading branch information
abigailm authored Jul 18, 2023
2 parents 0982694 + 34c2727 commit b9514cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
15 changes: 9 additions & 6 deletions nestkernel/connector_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,28 +388,31 @@ class Connector : public ConnectorBase
typename ConnectionT::CommonPropertiesType const& cp =
static_cast< GenericConnectorModel< ConnectionT >* >( cm[ syn_id_ ] )->get_common_properties();

size_t lcid_offset = 0;
size_t current_lcid = lcid;

while ( true )
{
ConnectionT& conn = C_[ lcid + lcid_offset ];
ConnectionT& conn = C_[ current_lcid ];
const bool is_disabled = conn.is_disabled();
const bool source_has_more_targets = conn.source_has_more_targets();

e.set_port( lcid + lcid_offset );
e.set_port( current_lcid );
if ( not is_disabled )
{
// non-local sender -> receiver retrieves ID of sender Node from SourceTable based on tid, syn_id, lcid
// only if needed, as this is computationally costly
e.set_sender_node_id_info( tid, syn_id_, current_lcid );
conn.send( e, tid, cp );
send_weight_event( tid, lcid + lcid_offset, e, cp );
send_weight_event( tid, current_lcid, e, cp );
}
if ( not source_has_more_targets )
{
break;
}
++lcid_offset;
++current_lcid;
}

return 1 + lcid_offset; // event was delivered to at least one target
return 1 + current_lcid - lcid; // event was delivered to at least one target
}

// Implemented in connector_base_impl.h
Expand Down
15 changes: 2 additions & 13 deletions nestkernel/event_delivery_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,7 @@ EventDeliveryManager::deliver_events_( const size_t tid, const std::vector< Spik
{
if ( spike_data.get_tid() == tid )
{
const size_t syn_id = spike_data.get_syn_id();
const size_t lcid = spike_data.get_lcid();

// non-local sender -> receiver retrieves ID of sender Node from SourceTable based on tid, syn_id, lcid
// only if needed, as this is computationally costly
se.set_sender_node_id_info( tid, syn_id, lcid );
kernel().connection_manager.send( tid, syn_id, lcid, cm, se );
kernel().connection_manager.send( tid, spike_data.get_syn_id(), spike_data.get_lcid(), cm, se );
}
}
else
Expand All @@ -624,12 +618,7 @@ EventDeliveryManager::deliver_events_( const size_t tid, const std::vector< Spik
{
if ( it->get_tid() == tid )
{
const size_t lcid = it->get_lcid();

// non-local sender -> receiver retrieves ID of sender Node from SourceTable based on tid, syn_id, lcid
// only if needed, as this is computationally costly
se.set_sender_node_id_info( tid, syn_id, lcid );
kernel().connection_manager.send( tid, syn_id, lcid, cm, se );
kernel().connection_manager.send( tid, syn_id, it->get_lcid(), cm, se );
}
}
}
Expand Down

0 comments on commit b9514cc

Please sign in to comment.