#include <DistributedSimEngine.h>
Public Member Functions | |
DistributedSimEngine (SimEngine &localEngine, DistributedIncomingSpikeScheduler &incomingScheduler, SpikeScheduler &spikeScheduler, DistributedCycledAnalogMsgDispatcher &distCycledAnalogMsgDispatcher, MPIAllToAllCommunicator &mpiCommunicator, SimNetwork &net) | |
Constructs a DistributedSimEngine. | |
virtual | ~DistributedSimEngine () |
virtual void | advance (int numSteps=1) |
advances the engine for a specified number of simulation timesteps. | |
virtual void | advanceOneFullCycle () |
Advances only one simulation cycle (one cycle is consisted of several number of steps usualy equal to minimum synapse delay). | |
virtual void | advanceSeveralStepsWithinACycle (int nsteps) |
virtual void | finalizeCycle () |
virtual void | reset () |
resets the simulation, and returns the simulation clock to time = 0. | |
virtual void | addObject (SimObjectFactory const &objFactory, SimObject::ID &id) |
Adds an advancable object to be advanced by the engine. | |
virtual void | mount (const SimObjectFactory &objFactory, const SimObject::ID &mountpoint, SimObject::ID &gid) |
virtual void | insert (const SimObjectFactory &objFactory, const SimObject::ID &mountpoint, SimObject::ID &gid) |
virtual SimObject * | getObject (const SimObject::ID &id) |
Gets a pointer of a previously stored sim object in the simulation engine. | |
virtual void | initialize () |
Initializes the engine and all the objects it contains, so that they are ready for simulation. | |
virtual void | seed (vector< uint32 > const &noiseSeed) |
virtual void | seed (uint32 noiseSeed) |
Protected Attributes | |
SimEngine & | localEng |
The local simulation engine used. | |
DistributedIncomingSpikeScheduler & | inScheduler |
incoming spike scheduler used for scheduling spikes arriving through mpi from other nodes. | |
MPIAllToAllCommunicator & | _mpiCommunicator |
Has the responsibility to perform all-to-all exchange of mpi spike buffers. | |
DistributedCycledAnalogMsgDispatcher & | distCycledAnalogMsgDispatcher |
analog message dispatcher | |
int | currentStepWithinCycle |
The DistributedSimEngine augments a localSimEngine to be able to perform also distributed spike scheduling, i.e. distributed simulation runniing.
Apart from advancing the local simulation engine, it also controls the distributed incoming spike scheduler and All-To-All spike exchange object.
Definition at line 24 of file DistributedSimEngine.h.
DistributedSimEngine::DistributedSimEngine | ( | SimEngine & | localEngine, | |
DistributedIncomingSpikeScheduler & | incomingScheduler, | |||
SpikeScheduler & | spikeScheduler, | |||
DistributedCycledAnalogMsgDispatcher & | distCycledAnalogMsgDispatcher, | |||
MPIAllToAllCommunicator & | mpiCommunicator, | |||
SimNetwork & | net | |||
) |
Constructs a DistributedSimEngine.
localEngine | The local simulation engine to be used for local simulation. | |
incomingScheduler | distributed incoming spike scheduler used for incoming spike scheduling. | |
mpiCommunicator | object that performs the all to all exchange algorithm each simulation timestep. | |
sp | holds the common parameters of the simulation. |
Definition at line 10 of file DistributedSimEngine.cpp.
References currentStepWithinCycle.
DistributedSimEngine::~DistributedSimEngine | ( | ) | [virtual] |
Definition at line 22 of file DistributedSimEngine.cpp.
void DistributedSimEngine::advance | ( | int | numSteps = 1 |
) | [virtual] |
advances the engine for a specified number of simulation timesteps.
Implements SimEngine.
Definition at line 25 of file DistributedSimEngine.cpp.
References _mpiCommunicator, SimEngine::advanceOneFullCycle(), SimEngine::advanceSeveralStepsWithinACycle(), currentStepWithinCycle, SimEngine::default_steps_per_cycle, DistributedCycledAnalogMsgDispatcher::dispatchDelayerCycledIncomingAnalogMsgs(), distCycledAnalogMsgDispatcher, MPIAllToAllCommunicator::doAllToAllExchange(), SimEngine::finalizeCycle(), inScheduler, localEng, and DistributedIncomingSpikeScheduler::processMPIInputSpikeBuffers().
Referenced by DistributedSingleThreadNetwork::_advance_(), and DistributedMultiThreadNetwork::_advance_().
void DistributedSimEngine::advanceOneFullCycle | ( | ) | [virtual] |
Advances only one simulation cycle (one cycle is consisted of several number of steps usualy equal to minimum synapse delay).
Implements SimEngine.
Definition at line 88 of file DistributedSimEngine.cpp.
References _mpiCommunicator, SimEngine::advanceOneFullCycle(), DistributedCycledAnalogMsgDispatcher::dispatchDelayerCycledIncomingAnalogMsgs(), distCycledAnalogMsgDispatcher, MPIAllToAllCommunicator::doAllToAllExchange(), inScheduler, localEng, and DistributedIncomingSpikeScheduler::processMPIInputSpikeBuffers().
void DistributedSimEngine::advanceSeveralStepsWithinACycle | ( | int | nsteps | ) | [virtual] |
Implements SimEngine.
Definition at line 83 of file DistributedSimEngine.cpp.
References SimEngine::advanceSeveralStepsWithinACycle(), and localEng.
void DistributedSimEngine::finalizeCycle | ( | ) | [virtual] |
Implements SimEngine.
Definition at line 100 of file DistributedSimEngine.cpp.
References _mpiCommunicator, DistributedCycledAnalogMsgDispatcher::dispatchDelayerCycledIncomingAnalogMsgs(), distCycledAnalogMsgDispatcher, MPIAllToAllCommunicator::doAllToAllExchange(), SimEngine::finalizeCycle(), inScheduler, localEng, and DistributedIncomingSpikeScheduler::processMPIInputSpikeBuffers().
void DistributedSimEngine::reset | ( | ) | [virtual] |
resets the simulation, and returns the simulation clock to time = 0.
Implements SimEngine.
Definition at line 112 of file DistributedSimEngine.cpp.
References currentStepWithinCycle, localEng, and SimEngine::reset().
Referenced by DistributedSingleThreadNetwork::_reset_(), and DistributedMultiThreadNetwork::_reset_().
void DistributedSimEngine::addObject | ( | SimObjectFactory const & | objFactory, | |
SimObject::ID & | id | |||
) | [virtual] |
Adds an advancable object to be advanced by the engine.
Implements SimEngine.
Definition at line 123 of file DistributedSimEngine.cpp.
References SimEngine::addObject(), and localEng.
void DistributedSimEngine::mount | ( | const SimObjectFactory & | objFactory, | |
const SimObject::ID & | mountpoint, | |||
SimObject::ID & | gid | |||
) | [virtual] |
Implements SimEngine.
Definition at line 128 of file DistributedSimEngine.cpp.
References localEng, and SimEngine::mount().
void DistributedSimEngine::insert | ( | const SimObjectFactory & | objFactory, | |
const SimObject::ID & | mountpoint, | |||
SimObject::ID & | gid | |||
) | [virtual] |
Implements SimEngine.
Definition at line 133 of file DistributedSimEngine.cpp.
References SimEngine::insert(), and localEng.
SimObject * DistributedSimEngine::getObject | ( | const SimObject::ID & | id | ) | [virtual] |
Gets a pointer of a previously stored sim object in the simulation engine.
Implements SimEngine.
Definition at line 138 of file DistributedSimEngine.cpp.
References SimEngine::getObject(), and localEng.
void DistributedSimEngine::initialize | ( | ) | [virtual] |
Initializes the engine and all the objects it contains, so that they are ready for simulation.
Includes reset() operation inside.
Implements SimEngine.
Definition at line 118 of file DistributedSimEngine.cpp.
References SimEngine::initialize(), and localEng.
virtual void DistributedSimEngine::seed | ( | vector< uint32 > const & | noiseSeed | ) | [inline, virtual] |
virtual void DistributedSimEngine::seed | ( | uint32 | noiseSeed | ) | [inline, virtual] |
SimEngine& DistributedSimEngine::localEng [protected] |
The local simulation engine used.
The distributed sim engine builds on the functionality of the local engine by adding features for distributed spike scheduling (incoming spike scheduling and all-to-all mpi spike buffer exchange)
Definition at line 74 of file DistributedSimEngine.h.
Referenced by addObject(), advance(), advanceOneFullCycle(), advanceSeveralStepsWithinACycle(), finalizeCycle(), getObject(), initialize(), insert(), mount(), and reset().
incoming spike scheduler used for scheduling spikes arriving through mpi from other nodes.
Definition at line 87 of file DistributedSimEngine.h.
Referenced by advance(), advanceOneFullCycle(), and finalizeCycle().
Has the responsibility to perform all-to-all exchange of mpi spike buffers.
Definition at line 90 of file DistributedSimEngine.h.
Referenced by advance(), advanceOneFullCycle(), and finalizeCycle().
DistributedCycledAnalogMsgDispatcher& DistributedSimEngine::distCycledAnalogMsgDispatcher [protected] |
analog message dispatcher
Definition at line 93 of file DistributedSimEngine.h.
Referenced by advance(), advanceOneFullCycle(), and finalizeCycle().
int DistributedSimEngine::currentStepWithinCycle [protected] |
Definition at line 96 of file DistributedSimEngine.h.
Referenced by advance(), DistributedSimEngine(), and reset().