#include <DistributedSingleThreadNetwork.h>
Messages | |
virtual void | _addAnalogMessage_ (const SimObject::ID &sender, int sender_port, const SimObject::ID &receiver, int recv_port, const Time &delay) |
Set up a spike message channel with delay in simulation time steps. | |
virtual void | _addAnalogMessage_ (const SimObject::ID &sender, int sender_port, const SimObject::ID &receiver, string destfield, const Time &delay) |
virtual void | _addAnalogMessage_ (const SimObject::ID &sender, string srcfield, const SimObject::ID &receiver, int recv_port, const Time &delay) |
virtual void | _addAnalogMessage_ (const SimObject::ID &sender, string srcfield, const SimObject::ID &receiver, string destfield, const Time &delay) |
template<typename analogSrcType, typename analogDestType> | |
void | addGenericAnalogMessage (const SimObject::ID &sender, analogSrcType srcPortOrField, const SimObject::ID &receiver, analogDestType destPortOrField, delay_t delay) |
Public Member Functions | |
DistributedSingleThreadNetwork (SimParameter sp=SimParameter::Default) | |
Constructor for the python interface. | |
DistributedSingleThreadNetwork (MPI::Intracomm &mpiCommunicator, SimParameter sp=SimParameter::Default) | |
Constructor. | |
virtual | ~DistributedSingleThreadNetwork () |
Protected Member Functions | |
virtual void | _reset_ () |
Resets the simulation. | |
virtual void | _advance_ (int nSteps=1) |
Advances the simulation of the network for a specified number of simulation timesteps. | |
virtual void | _initialize_ () |
Initialize the network for forthcoming simulation. Should be called after construction and before simulation. | |
virtual void | _addSpikeMessage_ (const SimObject::ID &sender, const port_t out, const spike_port_id_t sender_port, const SimObject::ID &receiver, const port_t port, const step_t delay) |
Getting acces to objects | |
virtual SimObject * | _getObject_ (const SimObject::ID &id) |
Protected Attributes | |
STDistributedIncomingSpikeScheduler * | distIncomingSpikeScheduler |
Distributed incoming spike scheduler used for processing the incoming spikes from other nodes. | |
DistributedSpikeScheduler * | spikeScheduler |
Spike scheduler used for scheduling the outgoing spikes originating from the local node, and delivering spikes to destination local sim objects. | |
GlobalSingleTargetDelayMap * | globalDelayMap |
A inter-node spike routing table used for scheduling incoming spikes from other nodes. | |
TargetNodesMap * | targetNodesMap |
Spike routing table used for routing the spikes originating from the local processing node to other target nodes. | |
MPIAllToAllCommunicator * | mpiAllToAllComm |
Object that encapsulates the all to all exchange algorithm of mpi spike buffers. | |
MPIOutputBufferVector * | mpiOutBuffers |
MPI storage buffer for outgoing spikes occuring in the local node, which need to be communicated to other target nodes. | |
MPIInputBufferVector * | mpiInBuffers |
MPI Input buffer holding the arrived spikes from other nodes after complete exchange. | |
PropagatedSpikeBuffer * | spikeBuffer |
Buffer for storing the scheduled spikes for later delivering. | |
LocalDelayMap * | localDelayMap |
A Table holding the routing information for local spike scheduling. | |
SingleThreadSpikeScheduler * | localSpikeScheduler |
Spike scheduler used for scheduling of spikes that originate and terminate in the local node (travel through a intra-node connection). | |
AnalogMessageDispatcher * | localAnalogMsgDispatcher |
Dispatcher of local analog messages that are within the local single thread engine. | |
AnalogDelayObjectMap * | delayObjectMap |
DistributedAnalogMessageDispatcher * | distAnalogMsgDispatcher |
STAnalogMessageCreator * | localAnalogMsgCreator |
DistributedAnalogMessageCreator * | distAnalogMsgCreator |
vector < DistributedIncomingAnalogMsgDispatcher * > | incomingDispatchers |
vector < DistIncomingAnalogSources2BufPosMap * > | sources2BufPositionsMaps |
vector < DistributedOutgoingAnalogMsgDispatcher * > | outgoingDispatchers |
SpikeTargetGroupPool * | stgPool |
Storage of all spike target groups of sim objects. |
Network class used for setup and running simulations on multiple single-processor machines (distributed single-thread scenario). Contains interfaces for construction of the network, i.e. adding SimObject objects (neurons, synapses, etc.) and connecting them, and for simulation control.
Definition at line 34 of file DistributedSingleThreadNetwork.h.
DistributedSingleThreadNetwork::DistributedSingleThreadNetwork | ( | SimParameter | sp = SimParameter::Default |
) |
Constructor for the python interface.
Definition at line 23 of file DistributedSingleThreadNetwork.cpp.
DistributedSingleThreadNetwork::DistributedSingleThreadNetwork | ( | MPI::Intracomm & | mpiCommunicator, | |
SimParameter | sp = SimParameter::Default | |||
) |
Constructor.
Constructs a distributed single-thread (DST) network object on the local node, which connects to other DST network objects on other nodes with MPI to perform multi-node simulation.
sp | SimParameter structure holding global parameters of the simulation | |
mpiCommunicator | the MPI intra-communicator which is used for distributed spike exchange. |
Definition at line 29 of file DistributedSingleThreadNetwork.cpp.
DistributedSingleThreadNetwork::~DistributedSingleThreadNetwork | ( | ) | [virtual] |
Definition at line 128 of file DistributedSingleThreadNetwork.cpp.
References delayObjectMap, distAnalogMsgDispatcher, DistributedNetwork::distEngine, globalDelayMap, incomingDispatchers, localAnalogMsgCreator, localAnalogMsgDispatcher, DistributedNetwork::localSimEngine, localSpikeScheduler, DistributedNetwork::mpi_comm, mpiAllToAllComm, mpiOutBuffers, sources2BufPositionsMaps, spikeBuffer, stgPool, and targetNodesMap.
void DistributedSingleThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
int | sender_port, | |||
const SimObject::ID & | receiver, | |||
int | recv_port, | |||
const Time & | delay | |||
) | [virtual] |
Set up a spike message channel with delay in simulation time steps.
Each spike of the sender is sent to the given port of receiver (after delay simuation steps)
Reimplemented from SimNetwork.
Definition at line 250 of file DistributedSingleThreadNetwork.cpp.
References addGenericAnalogMessage(), SimNetwork::get_dt(), and Time::in_steps().
void DistributedSingleThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
int | sender_port, | |||
const SimObject::ID & | receiver, | |||
string | destfield, | |||
const Time & | delay | |||
) | [virtual] |
Reimplemented from SimNetwork.
Definition at line 255 of file DistributedSingleThreadNetwork.cpp.
References addGenericAnalogMessage(), SimNetwork::get_dt(), and Time::in_steps().
void DistributedSingleThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
string | srcfield, | |||
const SimObject::ID & | receiver, | |||
int | recv_port, | |||
const Time & | delay | |||
) | [virtual] |
Reimplemented from SimNetwork.
Definition at line 260 of file DistributedSingleThreadNetwork.cpp.
References addGenericAnalogMessage(), SimNetwork::get_dt(), and Time::in_steps().
void DistributedSingleThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
string | srcfield, | |||
const SimObject::ID & | receiver, | |||
string | destfield, | |||
const Time & | delay | |||
) | [virtual] |
Reimplemented from SimNetwork.
Definition at line 265 of file DistributedSingleThreadNetwork.cpp.
References addGenericAnalogMessage(), SimNetwork::get_dt(), and Time::in_steps().
void DistributedSingleThreadNetwork::addGenericAnalogMessage | ( | const SimObject::ID & | sender, | |
analogSrcType | srcPortOrField, | |||
const SimObject::ID & | receiver, | |||
analogDestType | destPortOrField, | |||
delay_t | delay | |||
) | [inline, protected] |
Definition at line 219 of file DistributedSingleThreadNetwork.cpp.
References STAnalogMessageCreator::addAnalogMessage(), SimParameter::dt, SimNetwork::get_dt(), Time::in_ms(), Time::in_steps(), DistributedNetwork::incomingConnections, localAnalogMsgCreator, SimParameter::maxDelay, SimParameter::minDelay, DistributedNetwork::mpi_comm, SimObject::ID::node, DistributedNetwork::outgoingConnections, and SimNetwork::simParam.
Referenced by _addAnalogMessage_().
void DistributedSingleThreadNetwork::_reset_ | ( | ) | [protected, virtual] |
Resets the simulation.
Resets the simulation to time = 0. Discardes the pending spikes and reinitalizes the states of the sim objects.
Reimplemented from SimNetwork.
Definition at line 284 of file DistributedSingleThreadNetwork.cpp.
References distAnalogMsgDispatcher, DistributedNetwork::distEngine, SimNetwork::get_dt(), SimNetwork::initialize(), SimNetwork::initialized, DistributedAnalogMessageDispatcher::reset(), DistributedSimEngine::reset(), and SimNetwork::reseted.
void DistributedSingleThreadNetwork::_advance_ | ( | int | nSteps = 1 |
) | [protected, virtual] |
Advances the simulation of the network for a specified number of simulation timesteps.
Advancing continues from exactly where the simulation from the previous advance() invocation stopped. reset() should be used to restart the simulation of the network from time = 0.
nSteps | number of timesteps the simulation is advanced. |
Reimplemented from SimNetwork.
Definition at line 295 of file DistributedSingleThreadNetwork.cpp.
References DistributedSimEngine::advance(), DistributedNetwork::distEngine, SimNetwork::reset(), and SimNetwork::reseted.
void DistributedSingleThreadNetwork::_initialize_ | ( | ) | [protected, virtual] |
Initialize the network for forthcoming simulation. Should be called after construction and before simulation.
Reimplemented from SimNetwork.
Definition at line 273 of file DistributedSingleThreadNetwork.cpp.
References distAnalogMsgDispatcher, SimNetwork::get_dt(), Time::in_steps(), DistributedAnalogMessageDispatcher::initialize(), MPIOutputBufferVector::initialize(), SimEngine::initialize(), SimNetwork::initialized, DistributedNetwork::localSimEngine, SimParameter::minDelay, MPIBUFFER_BLOCK_SIZE, mpiOutBuffers, and SimNetwork::simParam.
SimObject * DistributedSingleThreadNetwork::_getObject_ | ( | const SimObject::ID & | id | ) | [protected, virtual] |
Reimplemented from SimNetwork.
Definition at line 156 of file DistributedSingleThreadNetwork.cpp.
References SimEngine::getObject(), DistributedNetwork::localSimEngine, and DistributedNetwork::mpi_comm.
void DistributedSingleThreadNetwork::_addSpikeMessage_ | ( | const SimObject::ID & | sender, | |
const port_t | out, | |||
const spike_port_id_t | sender_port, | |||
const SimObject::ID & | receiver, | |||
const port_t | port, | |||
const step_t | delay | |||
) | [protected, virtual] |
Reimplemented from DistributedNetwork.
Definition at line 166 of file DistributedSingleThreadNetwork.cpp.
References SimNetwork::_nSpikeMessages, SingleThreadNetwork::addLocalSpikeMessage(), SpikeTargetGroupPool::addSpikeTarget(), TargetNodesMap::addTargetNode(), SimParameter::dt, SimObject::ID::eng, GlobalSingleTargetDelayMap::find(), SimNetwork::get_dt(), SimEngine::getObject(), DistributedNetwork::glengineids, globalDelayMap, Time::in_ms(), Time::in_steps(), DistributedNetwork::incomingConnections, GlobalSingleTargetDelayMap::insert(), DistributedNetwork::localSimEngine, SimParameter::maxDelay, SimParameter::minDelay, DistributedNetwork::mpi_comm, no_spikegroup, SimObject::ID::node, DistributedNetwork::outgoingConnections, SimNetwork::simParam, stgPool, and targetNodesMap.
STDistributedIncomingSpikeScheduler* DistributedSingleThreadNetwork::distIncomingSpikeScheduler [protected] |
Distributed incoming spike scheduler used for processing the incoming spikes from other nodes.
Definition at line 111 of file DistributedSingleThreadNetwork.h.
Spike scheduler used for scheduling the outgoing spikes originating from the local node, and delivering spikes to destination local sim objects.
Definition at line 114 of file DistributedSingleThreadNetwork.h.
A inter-node spike routing table used for scheduling incoming spikes from other nodes.
For each source spike emiting object, the map returns the target groups of objects which are destination for the spikes from the source, and their associated delays. Used by distributed incoming spike scheduler to schedule incoming spikes to propagated spike buffers.
Definition at line 123 of file DistributedSingleThreadNetwork.h.
Referenced by _addSpikeMessage_(), and ~DistributedSingleThreadNetwork().
Spike routing table used for routing the spikes originating from the local processing node to other target nodes.
Used by the DistributedSpikeScheduler to acquire the target nodes to which some generated spike should be sent via MPI.
Definition at line 130 of file DistributedSingleThreadNetwork.h.
Referenced by _addSpikeMessage_(), and ~DistributedSingleThreadNetwork().
Object that encapsulates the all to all exchange algorithm of mpi spike buffers.
Definition at line 133 of file DistributedSingleThreadNetwork.h.
Referenced by ~DistributedSingleThreadNetwork().
MPI storage buffer for outgoing spikes occuring in the local node, which need to be communicated to other target nodes.
The buffers is filled by DistributedSpikeScheduler and then used by MPIAllToAllCommunicator to send the buffers to appropriate nodes.
Definition at line 139 of file DistributedSingleThreadNetwork.h.
Referenced by _initialize_(), and ~DistributedSingleThreadNetwork().
MPI Input buffer holding the arrived spikes from other nodes after complete exchange.
mpiInputBuffers hold the transferred MPI buffers after complete exchange, one for each node.
Definition at line 145 of file DistributedSingleThreadNetwork.h.
Buffer for storing the scheduled spikes for later delivering.
Spikes are stored as target groups (which contain set of target objects). Incoming spikes from other nodes are scheduled in the buffer, as well as local originating spikes.
Definition at line 152 of file DistributedSingleThreadNetwork.h.
Referenced by ~DistributedSingleThreadNetwork().
A Table holding the routing information for local spike scheduling.
For each spiking objects it gives the local target groups and their corresponding delays.
Definition at line 159 of file DistributedSingleThreadNetwork.h.
Spike scheduler used for scheduling of spikes that originate and terminate in the local node (travel through a intra-node connection).
Definition at line 162 of file DistributedSingleThreadNetwork.h.
Referenced by ~DistributedSingleThreadNetwork().
Dispatcher of local analog messages that are within the local single thread engine.
Definition at line 169 of file DistributedSingleThreadNetwork.h.
Referenced by ~DistributedSingleThreadNetwork().
Definition at line 171 of file DistributedSingleThreadNetwork.h.
Referenced by ~DistributedSingleThreadNetwork().
DistributedAnalogMessageDispatcher* DistributedSingleThreadNetwork::distAnalogMsgDispatcher [protected] |
Definition at line 173 of file DistributedSingleThreadNetwork.h.
Referenced by _initialize_(), _reset_(), and ~DistributedSingleThreadNetwork().
Definition at line 175 of file DistributedSingleThreadNetwork.h.
Referenced by addGenericAnalogMessage(), and ~DistributedSingleThreadNetwork().
Definition at line 177 of file DistributedSingleThreadNetwork.h.
vector< DistributedIncomingAnalogMsgDispatcher *> DistributedSingleThreadNetwork::incomingDispatchers [protected] |
Definition at line 179 of file DistributedSingleThreadNetwork.h.
Referenced by ~DistributedSingleThreadNetwork().
vector<DistIncomingAnalogSources2BufPosMap *> DistributedSingleThreadNetwork::sources2BufPositionsMaps [protected] |
Definition at line 181 of file DistributedSingleThreadNetwork.h.
Referenced by ~DistributedSingleThreadNetwork().
vector< DistributedOutgoingAnalogMsgDispatcher *> DistributedSingleThreadNetwork::outgoingDispatchers [protected] |
Definition at line 183 of file DistributedSingleThreadNetwork.h.
Storage of all spike target groups of sim objects.
For each spike sending object, the receiver objects of the spiking connections with the same delay, which also reside on one SingleThreadSimEngine form one spike target group.
Definition at line 194 of file DistributedSingleThreadNetwork.h.
Referenced by _addSpikeMessage_(), and ~DistributedSingleThreadNetwork().