MultiThreadSpikeScheduler Class Reference

Spike scheduler for a multi-thread simulation. More...

#include <MultiThreadSpikeScheduler.h>

Inheritance diagram for MultiThreadSpikeScheduler:

Inheritance graph
[legend]
Collaboration diagram for MultiThreadSpikeScheduler:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MultiThreadSpikeScheduler (int numThreads, MTSpikeRoutingTables &tables, vector< PropagatedSpikeBuffer * > &stBuffers, SimParameter &sp)
 Constructor.
virtual ~MultiThreadSpikeScheduler ()
virtual void scheduleSpike (local_objectid_t senderid, float offsetFraction, engineid_t engine=0)
 Schedules an occured spike in the PropagatedSpikeBuffers.
virtual void deliverSpikes (SpikeReceiverList &listActiveSynapses, engineid_t engine, double simTime, int stepOffset=0)
 Delivers the spikes scheduled for the current time step.
virtual void reset ()
 Reset the state of the spike scheduler (and empties all the spike buffers inside), so that the simulation can begin at time = 0.
virtual void advance (engineid_t engine=0)
 Informs that a single thread sim engine has advanced one time step, so that the SpikeScheduler can appropriately setup time offsets for spike scheduling.
virtual void nextCycle ()
 Informs the spike scheduler that the simulation is advanced to the next simulation cycle.

Protected Attributes

int _numThreads
 Number of threads the multi-threaded simulation engine is using.
vector
< SingleThreadSpikeScheduler
STschedulers
 Array of single thread schedulers for scheduling the spikes within one single thread sim engine.
MTSpikeRoutingTablesrtables
 reference to MTSpikeRoutingTables which the scheduler is using for routing the spikes.
NodeLocalMultiTargetDelayMapmTDelayMap
 reference to NodeLocalMultiTargetDelayMap taken from rtables object for faster access.
SpikeTargetGroupPooltgtGrpPool
 reference to SpikeTargetGroupPool taken from rtables object for faster access.
SimParameter_simParam
 General parameter of the simulation.
vector< PropagatedSpikeBuffer * > & STbuffers
 Separated PropagatedSpikeBuffers for the single thread schedulers.
MTPropagatedSpikeBuffers mTSpikeBuffers
 The buffers for inter-engine spike scheduling.
intengineSteps
 Array holding the relative number of steps each engine has advanced within one cycle of simulation.
int nCycleSteps
 Number of time steps one cycle lasts = minDelay.


Detailed Description

Spike scheduler for a multi-thread simulation.

Specialization of the abstract SpikeScheduler class which handles the spike scheduling (routing, scheduling for later time steps) and delivering afterwards for the multi-threaded case.

This class is used by a DistributedSpikeScheduler for the distributed case.

Definition at line 21 of file MultiThreadSpikeScheduler.h.


Constructor & Destructor Documentation

MultiThreadSpikeScheduler::MultiThreadSpikeScheduler ( int  numThreads,
MTSpikeRoutingTables tables,
vector< PropagatedSpikeBuffer * > &  stBuffers,
SimParameter sp 
)

Constructor.

Parameters:
numThreads Number of threads used in the multi-threaded simulation.
tables Container of the spike routing tables.
stBuffers Array of propagated spike buffers that are used by SingleThreadSpikeScheduler for storing the spikes data.
sp structure holding general parameters about the simulation.

Definition at line 3 of file MultiThreadSpikeScheduler.cpp.

References _numThreads, _simParam, SimParameter::dt, engineSteps, Time::in_steps(), MTSpikeRoutingTables::localDelayMaps, SimParameter::minDelay, nCycleSteps, rtables, STbuffers, STschedulers, and tgtGrpPool.

Here is the call graph for this function:

MultiThreadSpikeScheduler::~MultiThreadSpikeScheduler (  )  [virtual]

Definition at line 35 of file MultiThreadSpikeScheduler.cpp.

References engineSteps.


Member Function Documentation

void MultiThreadSpikeScheduler::scheduleSpike ( local_objectid_t  senderid,
float  offsetFraction,
engineid_t  engine = 0 
) [virtual]

Schedules an occured spike in the PropagatedSpikeBuffers.

Implements SpikeScheduler.

Definition at line 40 of file MultiThreadSpikeScheduler.cpp.

References NodeLocalMultiTargetDelayMap::beginDelays(), MTPropagatedSpikeBuffers::buffers, NodeLocalMultiTargetDelayMap::endDelays(), engineSteps, NodeLocalMultiTargetDelayMap::lastDestEngine(), mTDelayMap, mTSpikeBuffers, and STschedulers.

Here is the call graph for this function:

void MultiThreadSpikeScheduler::deliverSpikes ( SpikeReceiverList listActiveSynapses,
engineid_t  engine = 0,
double  simTime = -1,
int  stepOffset = 0 
) [virtual]

Delivers the spikes scheduled for the current time step.

Parameters:
listActiveSynapses adds all the waken-up spike receiver objects by the delivered spikes
engine identifier of the single threaded engine for which objects to deliver the spikes.
time Current time of the simulation, used to inform the target objects about the exact time of the delivered spikes.
stepOffset time offset convenient for advance delivering of later spikes which arrive after stepOffset timesteps with respect to the current simulation time.

Implements SpikeScheduler.

Definition at line 97 of file MultiThreadSpikeScheduler.cpp.

References _numThreads, _simParam, SpikeTargetGroupPool::beginSpikeTargetGroup(), MTPropagatedSpikeBuffers::buffers, SpikeEvent::delta, SimParameter::dt, SpikeTargetGroupPool::endSpikeTargetGroup(), engineSteps, SimObject::getChainedObject(), Time::in_sec(), mTSpikeBuffers, SPIKEHITFLAG_ACTIVATE, STschedulers, tgtGrpPool, and SimObject::toBeActivated().

Here is the call graph for this function:

void MultiThreadSpikeScheduler::reset (  )  [virtual]

Reset the state of the spike scheduler (and empties all the spike buffers inside), so that the simulation can begin at time = 0.

Implements SpikeScheduler.

Definition at line 65 of file MultiThreadSpikeScheduler.cpp.

References _numThreads, _simParam, MTPropagatedSpikeBuffers::buffers, SimParameter::dt, engineSteps, Time::in_steps(), SimParameter::maxDelay, SimParameter::minDelay, mTSpikeBuffers, and STschedulers.

Referenced by MultiThreadNetwork::_reset_().

Here is the call graph for this function:

void MultiThreadSpikeScheduler::advance ( engineid_t  engine = 0  )  [virtual]

Informs that a single thread sim engine has advanced one time step, so that the SpikeScheduler can appropriately setup time offsets for spike scheduling.

The scheduler advances the propagated spike buffers and other state variables that hold simulation timestep information.

Parameters:
engine id of the single thread engine that has advanced

Implements SpikeScheduler.

Definition at line 59 of file MultiThreadSpikeScheduler.cpp.

References engineSteps, and STschedulers.

void MultiThreadSpikeScheduler::nextCycle (  )  [virtual]

Informs the spike scheduler that the simulation is advanced to the next simulation cycle.

Used to update the state of the propagated spike buffers etc.

Implements SpikeScheduler.

Definition at line 80 of file MultiThreadSpikeScheduler.cpp.

References _numThreads, MTPropagatedSpikeBuffers::buffers, engineSteps, and mTSpikeBuffers.


Member Data Documentation

Number of threads the multi-threaded simulation engine is using.

Definition at line 89 of file MultiThreadSpikeScheduler.h.

Referenced by deliverSpikes(), MultiThreadSpikeScheduler(), nextCycle(), and reset().

Array of single thread schedulers for scheduling the spikes within one single thread sim engine.

Definition at line 92 of file MultiThreadSpikeScheduler.h.

Referenced by advance(), deliverSpikes(), MultiThreadSpikeScheduler(), reset(), and scheduleSpike().

reference to MTSpikeRoutingTables which the scheduler is using for routing the spikes.

Definition at line 95 of file MultiThreadSpikeScheduler.h.

Referenced by MultiThreadSpikeScheduler().

reference to NodeLocalMultiTargetDelayMap taken from rtables object for faster access.

Definition at line 98 of file MultiThreadSpikeScheduler.h.

Referenced by scheduleSpike().

reference to SpikeTargetGroupPool taken from rtables object for faster access.

Definition at line 101 of file MultiThreadSpikeScheduler.h.

Referenced by deliverSpikes(), and MultiThreadSpikeScheduler().

General parameter of the simulation.

Definition at line 104 of file MultiThreadSpikeScheduler.h.

Referenced by deliverSpikes(), MultiThreadSpikeScheduler(), and reset().

Separated PropagatedSpikeBuffers for the single thread schedulers.

Definition at line 107 of file MultiThreadSpikeScheduler.h.

Referenced by MultiThreadSpikeScheduler().

The buffers for inter-engine spike scheduling.

Definition at line 110 of file MultiThreadSpikeScheduler.h.

Referenced by deliverSpikes(), nextCycle(), reset(), and scheduleSpike().

Array holding the relative number of steps each engine has advanced within one cycle of simulation.

Definition at line 113 of file MultiThreadSpikeScheduler.h.

Referenced by advance(), deliverSpikes(), MultiThreadSpikeScheduler(), nextCycle(), reset(), scheduleSpike(), and ~MultiThreadSpikeScheduler().

Number of time steps one cycle lasts = minDelay.

Definition at line 117 of file MultiThreadSpikeScheduler.h.

Referenced by MultiThreadSpikeScheduler().


The documentation for this class was generated from the following files:

Generated on Wed Jul 9 16:34:52 2008 for PCSIM by  doxygen 1.5.5