Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set sender node id info with correct target lcid #2665

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -617,13 +617,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 );
jougs marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -638,12 +632,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