Skip to content

Commit

Permalink
move precise spike time offset from Event to Time class
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Dec 10, 2024
1 parent fc274d6 commit 15d8ee5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions nestkernel/event_delivery_manager_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ inline void
EventDeliveryManager::send_local_( Node& source, EventT& e, const long lag )
{
assert( not source.has_proxies() );
const double offset = e.get_stamp().get_offset(); // offset might already have been set on the event by the sender; make sure to preserve it when setting the stamp time
const double offset = e.get_stamp().get_offset(); // offset might already have been set on the event by the sender;
// make sure to preserve it when setting the stamp time
e.set_stamp( kernel().simulation_manager.get_slice_origin() + Time::step( lag + 1 ) );
e.get_stamp().set_offset( offset ); // restore offset field
e.get_stamp().set_offset( offset ); // restore offset field
e.set_sender( source );
const size_t t = source.get_thread();
const size_t ldid = source.get_local_device_id();
Expand All @@ -50,10 +51,11 @@ inline void
EventDeliveryManager::send_local_( Node& source, SecondaryEvent& e, const long )
{
assert( not source.has_proxies() );
const double offset = e.get_stamp().get_offset(); // offset might already have been set on the event by the sender; make sure to preserve it when setting the stamp time
const double offset = e.get_stamp().get_offset(); // offset might already have been set on the event by the sender;
// make sure to preserve it when setting the stamp time
e.set_stamp( kernel().simulation_manager.get_slice_origin() + Time::step( 1 ) );
e.set_sender( source );
e.get_stamp().set_offset( offset ); // restore offset field
e.get_stamp().set_offset( offset ); // restore offset field
const size_t t = source.get_thread();
const size_t ldid = source.get_local_device_id();
kernel().connection_manager.send_from_device( t, ldid, e );
Expand All @@ -76,9 +78,10 @@ EventDeliveryManager::send< SpikeEvent >( Node& source, SpikeEvent& e, const lon
if ( source.has_proxies() )
{
local_spike_counter_[ tid ] += e.get_multiplicity();
const double offset = e.get_stamp().get_offset(); // offset might already have been set on the event by the sender; make sure to preserve it when setting the stamp time
const double offset = e.get_stamp().get_offset(); // offset might already have been set on the event by the sender;
// make sure to preserve it when setting the stamp time
e.set_stamp( kernel().simulation_manager.get_slice_origin() + Time::step( lag + 1 ) );
e.get_stamp().set_offset( offset ); // restore offset field
e.get_stamp().set_offset( offset ); // restore offset field
e.set_sender( source );

if ( source.is_off_grid() )
Expand Down

0 comments on commit 15d8ee5

Please sign in to comment.