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 3340f1d commit fc274d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nestkernel/event_delivery_manager_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ 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
e.set_stamp( kernel().simulation_manager.get_slice_origin() + Time::step( lag + 1 ) );
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 @@ -48,8 +50,10 @@ 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
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
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 @@ -72,8 +76,9 @@ 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
e.set_stamp( kernel().simulation_manager.get_slice_origin() + Time::step( lag + 1 ) );
e.get_stamp().set_offset( offset ); // restore offset field
e.set_sender( source );

if ( source.is_off_grid() )
Expand Down

0 comments on commit fc274d6

Please sign in to comment.