#include <DistributedMultiThreadNetwork.h>
Messages | |
virtual void | _addAnalogMessage_ (const SimObject::ID &sender, int sender_port, const SimObject::ID &receiver, int recv_port, const Time &delay) |
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) |
virtual gl_engineid_t | maxLocalEngineID (void) const |
Return the largest local simulation engine ID at the executing node. | |
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 | |
DistributedMultiThreadNetwork (int numThreads, SimParameter sp=SimParameter::Default) | |
Constructor assuming MPI::COMM_WORLD for communicator (for python interface). | |
DistributedMultiThreadNetwork (int numThreads, MPI::Intracomm &mpiCommunicator, SimParameter sp=SimParameter::Default) | |
Constructor. | |
virtual | ~DistributedMultiThreadNetwork () |
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. | |
void | init () |
Auxiliary method used for constructing the network, allowing multiple constructors. | |
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 | |
int | nThreads |
Number of threads the network utilizes on the local node. | |
MTDistributedIncomingSpikeScheduler * | 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 sim objects. | |
GlobalMultiTargetDelayMap * | 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. | |
MTSpikeRoutingTables * | mtTables |
Tables used for spike routing just for local multi-threaded spike exchange. | |
ThreadPool | thrPool |
ThreadPool holding thread objects used in multi-thread processing. | |
vector< PropagatedSpikeBuffer * > | STBuffers |
Array of Propagated spike buffers, one for each SingleThreadSimEngine. | |
MultiThreadSpikeScheduler * | localSpikeScheduler |
Spike scheduler used for scheduling local spikes (spikes originating and terminating in the same node). | |
AnalogDelayObjectMap * | analogDelayObjectsMap |
vector < MultiThreadAnalogMsgDispatcher * > | mTanalogMsgDispatchers |
vector < DistributedAnalogMessageDispatcher * > | distAnalogMsgDispatchers |
MTDistributedCycledAnalogMsgDispatcher * | mtDistCycledAnalogMsgDispatcher |
vector< STAnalogMessageCreator * > | stAnalogMsgCreators |
MTAnalogMessageCreator * | mtAnalogMsgCreator |
vector < DistributedAnalogMessageCreator * > | distAnalogMessageCreators |
vector< vector < DistributedIncomingAnalogMsgDispatcher * > > | incomingDispatchers |
vector < DistIncomingAnalogSources2BufPosMap * > | sources2BufPositionsMaps |
vector< vector < DistributedOutgoingAnalogMsgDispatcher * > > | outgoingDispatchers |
Friends | |
class | NoiseRandomEngineTest |
Network class used for setup and running simulations on many multi-processor machines (distributed multi-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 39 of file DistributedMultiThreadNetwork.h.
DistributedMultiThreadNetwork::DistributedMultiThreadNetwork | ( | int | numThreads, | |
SimParameter | sp = SimParameter::Default | |||
) |
Constructor assuming MPI::COMM_WORLD for communicator (for python interface).
Definition at line 21 of file DistributedMultiThreadNetwork.cpp.
References init().
DistributedMultiThreadNetwork::DistributedMultiThreadNetwork | ( | int | numThreads, | |
MPI::Intracomm & | mpiCommunicator, | |||
SimParameter | sp = SimParameter::Default | |||
) |
Constructor.
Constructs a distributed multi-thread (DMT) network object on the local node with specified number of threads, which connects to other DMT network objects on other nodes wiht MPI to perform multi-node simulation.
nThreads | number of threads the local node uses (on each machine different number of threads may be specified) | |
simPar | SimParameter structure which contains global simulation parameters like dt and the minimal synaptic delay | |
mpiCommunicator | the mpi communicator which is used for distributed spike exchange. |
Definition at line 27 of file DistributedMultiThreadNetwork.cpp.
References init().
DistributedMultiThreadNetwork::~DistributedMultiThreadNetwork | ( | ) | [virtual] |
Definition at line 34 of file DistributedMultiThreadNetwork.cpp.
References analogDelayObjectsMap, distAnalogMessageCreators, distAnalogMsgDispatchers, DistributedNetwork::distEngine, distIncomingSpikeScheduler, globalDelayMap, incomingDispatchers, DistributedNetwork::localSimEngine, localSpikeScheduler, DistributedNetwork::mpi_comm, mpiAllToAllComm, mpiInBuffers, mpiOutBuffers, mtAnalogMsgCreator, mTanalogMsgDispatchers, mtDistCycledAnalogMsgDispatcher, mtTables, nThreads, outgoingDispatchers, sources2BufPositionsMaps, spikeScheduler, stAnalogMsgCreators, STBuffers, and targetNodesMap.
void DistributedMultiThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
int | sender_port, | |||
const SimObject::ID & | receiver, | |||
int | recv_port, | |||
const Time & | delay | |||
) | [virtual] |
Reimplemented from SimNetwork.
Definition at line 324 of file DistributedMultiThreadNetwork.cpp.
References addGenericAnalogMessage(), SimParameter::dt, Time::in_steps(), and SimNetwork::simParam.
void DistributedMultiThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
int | sender_port, | |||
const SimObject::ID & | receiver, | |||
string | destfield, | |||
const Time & | delay | |||
) | [virtual] |
Reimplemented from SimNetwork.
Definition at line 330 of file DistributedMultiThreadNetwork.cpp.
References addGenericAnalogMessage(), SimParameter::dt, Time::in_steps(), and SimNetwork::simParam.
void DistributedMultiThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
string | srcfield, | |||
const SimObject::ID & | receiver, | |||
int | recv_port, | |||
const Time & | delay | |||
) | [virtual] |
Reimplemented from SimNetwork.
Definition at line 336 of file DistributedMultiThreadNetwork.cpp.
References addGenericAnalogMessage(), SimParameter::dt, Time::in_steps(), and SimNetwork::simParam.
void DistributedMultiThreadNetwork::_addAnalogMessage_ | ( | const SimObject::ID & | sender, | |
string | srcfield, | |||
const SimObject::ID & | receiver, | |||
string | destfield, | |||
const Time & | delay | |||
) | [virtual] |
Reimplemented from SimNetwork.
Definition at line 342 of file DistributedMultiThreadNetwork.cpp.
References addGenericAnalogMessage(), SimParameter::dt, Time::in_steps(), and SimNetwork::simParam.
gl_engineid_t DistributedMultiThreadNetwork::maxLocalEngineID | ( | void | ) | const [virtual] |
Return the largest local simulation engine ID at the executing node.
Reimplemented from DistributedNetwork.
Definition at line 351 of file DistributedMultiThreadNetwork.cpp.
References nThreads.
void DistributedMultiThreadNetwork::addGenericAnalogMessage | ( | const SimObject::ID & | sender, | |
analogSrcType | srcPortOrField, | |||
const SimObject::ID & | receiver, | |||
analogDestType | destPortOrField, | |||
delay_t | delay | |||
) | [inline, protected] |
Definition at line 270 of file DistributedMultiThreadNetwork.cpp.
References MTAnalogMessageCreator::addAnalogMessage(), distAnalogMessageCreators, SimParameter::dt, SimObject::ID::eng, SimNetwork::get_dt(), Time::in_ms(), Time::in_steps(), DistributedNetwork::incomingConnections, SimParameter::maxDelay, SimParameter::minDelay, DistributedNetwork::mpi_comm, mtAnalogMsgCreator, SimObject::ID::node, DistributedNetwork::outgoingConnections, SimNetwork::simParam, and stAnalogMsgCreators.
Referenced by _addAnalogMessage_().
void DistributedMultiThreadNetwork::_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 369 of file DistributedMultiThreadNetwork.cpp.
References distAnalogMsgDispatchers, DistributedNetwork::distEngine, SimNetwork::get_dt(), SimNetwork::initialize(), SimNetwork::initialized, mpiOutBuffers, MPIOutputBufferVector::nextCycle(), nThreads, DistributedSimEngine::reset(), DistributedSpikeScheduler::reset(), SimNetwork::reseted, and spikeScheduler.
void DistributedMultiThreadNetwork::_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 382 of file DistributedMultiThreadNetwork.cpp.
References DistributedSimEngine::advance(), DistributedNetwork::distEngine, SimNetwork::reset(), and SimNetwork::reseted.
void DistributedMultiThreadNetwork::_initialize_ | ( | ) | [protected, virtual] |
Initialize the network for forthcoming simulation. Should be called after construction and before simulation.
Reimplemented from SimNetwork.
Definition at line 357 of file DistributedMultiThreadNetwork.cpp.
References distAnalogMsgDispatchers, SimNetwork::get_dt(), Time::in_steps(), SimNetwork::initialize(), MPIOutputBufferVector::initialize(), MPIInputBufferVector::initialize(), SimEngine::initialize(), SimNetwork::initialized, DistributedNetwork::localSimEngine, SimParameter::minDelay, MPIBUFFER_BLOCK_SIZE, mpiInBuffers, mpiOutBuffers, nThreads, and SimNetwork::simParam.
SimObject * DistributedMultiThreadNetwork::_getObject_ | ( | const SimObject::ID & | id | ) | [protected, virtual] |
Reimplemented from SimNetwork.
Definition at line 206 of file DistributedMultiThreadNetwork.cpp.
References SimEngine::getObject(), DistributedNetwork::localSimEngine, and DistributedNetwork::mpi_comm.
void DistributedMultiThreadNetwork::init | ( | ) | [protected] |
Auxiliary method used for constructing the network, allowing multiple constructors.
Reimplemented from DistributedNetwork.
Definition at line 76 of file DistributedMultiThreadNetwork.cpp.
References analogDelayObjectsMap, MPIAllToAllCommunicatorFactory::Default, distAnalogMessageCreators, distAnalogMsgDispatchers, DistributedNetwork::distEngine, distIncomingSpikeScheduler, SimParameter::dt, SimNetwork::get_dt(), DistributedNetwork::glengineids, globalDelayMap, Time::in_sec(), Time::in_steps(), DistributedNetwork::incomingConnections, incomingDispatchers, DistributedNetwork::localSimEngine, localSpikeScheduler, SimNetwork::makeSeed(), SimParameter::maxDelay, SimParameter::minDelay, DistributedNetwork::mpi_comm, mpiAllToAllComm, mpiInBuffers, mpiOutBuffers, mtAnalogMsgCreator, mTanalogMsgDispatchers, mtDistCycledAnalogMsgDispatcher, mtTables, nThreads, DistributedNetwork::outgoingConnections, outgoingDispatchers, DistributedNetwork::seed_noise_rng(), SimNetwork::setupConstructRNGEngines(), SimNetwork::simParam, SimParameter::simulationRNGSeed, sources2BufPositionsMaps, spikeScheduler, stAnalogMsgCreators, STBuffers, targetNodesMap, and thrPool.
Referenced by DistributedMultiThreadNetwork().
void DistributedMultiThreadNetwork::_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 213 of file DistributedMultiThreadNetwork.cpp.
References SimNetwork::_nSpikeMessages, MultiThreadNetwork::addLocalSpikeMessage(), SpikeTargetGroupPool::addSpikeTarget(), TargetNodesMap::addTargetNode(), SimParameter::dt, SimObject::ID::eng, SimNetwork::get_dt(), SimEngine::getObject(), DistributedNetwork::glengineids, Time::in_ms(), Time::in_steps(), DistributedNetwork::incomingConnections, SimObject::ID::isInTheSameSTEngineWith(), DistributedNetwork::localSimEngine, SimParameter::maxDelay, SimParameter::minDelay, DistributedNetwork::mpi_comm, mtTables, no_spikegroup, SimObject::ID::node, DistributedNetwork::outgoingConnections, SimNetwork::simParam, MTSpikeRoutingTables::stgPool, and targetNodesMap.
friend class NoiseRandomEngineTest [friend] |
int DistributedMultiThreadNetwork::nThreads [protected] |
Number of threads the network utilizes on the local node.
Definition at line 107 of file DistributedMultiThreadNetwork.h.
Referenced by _initialize_(), _reset_(), init(), maxLocalEngineID(), and ~DistributedMultiThreadNetwork().
MTDistributedIncomingSpikeScheduler* DistributedMultiThreadNetwork::distIncomingSpikeScheduler [protected] |
Distributed incoming spike scheduler used for processing the incoming spikes from other nodes.
Definition at line 110 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
Spike scheduler used for scheduling the outgoing spikes originating from the local node, and delivering spikes to destination sim objects.
Definition at line 113 of file DistributedMultiThreadNetwork.h.
Referenced by _reset_(), init(), and ~DistributedMultiThreadNetwork().
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 121 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
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 128 of file DistributedMultiThreadNetwork.h.
Referenced by _addSpikeMessage_(), init(), and ~DistributedMultiThreadNetwork().
Object that encapsulates the all to all exchange algorithm of mpi spike buffers.
Definition at line 131 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
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 137 of file DistributedMultiThreadNetwork.h.
Referenced by _initialize_(), _reset_(), init(), and ~DistributedMultiThreadNetwork().
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 143 of file DistributedMultiThreadNetwork.h.
Referenced by _initialize_(), init(), and ~DistributedMultiThreadNetwork().
Tables used for spike routing just for local multi-threaded spike exchange.
Definition at line 146 of file DistributedMultiThreadNetwork.h.
Referenced by _addSpikeMessage_(), init(), and ~DistributedMultiThreadNetwork().
ThreadPool DistributedMultiThreadNetwork::thrPool [protected] |
ThreadPool holding thread objects used in multi-thread processing.
Definition at line 149 of file DistributedMultiThreadNetwork.h.
Referenced by init().
vector<PropagatedSpikeBuffer*> DistributedMultiThreadNetwork::STBuffers [protected] |
Array of Propagated spike buffers, one for each SingleThreadSimEngine.
Definition at line 152 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
Spike scheduler used for scheduling local spikes (spikes originating and terminating in the same node).
A member of DistributedSpikeScheduler. Distributed spike scheduler delegates the local spike scheduling to it.
Definition at line 158 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
Definition at line 164 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
vector<MultiThreadAnalogMsgDispatcher *> DistributedMultiThreadNetwork::mTanalogMsgDispatchers [protected] |
Definition at line 166 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
vector< DistributedAnalogMessageDispatcher *> DistributedMultiThreadNetwork::distAnalogMsgDispatchers [protected] |
Definition at line 168 of file DistributedMultiThreadNetwork.h.
Referenced by _initialize_(), _reset_(), init(), and ~DistributedMultiThreadNetwork().
MTDistributedCycledAnalogMsgDispatcher* DistributedMultiThreadNetwork::mtDistCycledAnalogMsgDispatcher [protected] |
Definition at line 170 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
vector< STAnalogMessageCreator * > DistributedMultiThreadNetwork::stAnalogMsgCreators [protected] |
Definition at line 172 of file DistributedMultiThreadNetwork.h.
Referenced by addGenericAnalogMessage(), init(), and ~DistributedMultiThreadNetwork().
Definition at line 174 of file DistributedMultiThreadNetwork.h.
Referenced by addGenericAnalogMessage(), init(), and ~DistributedMultiThreadNetwork().
vector< DistributedAnalogMessageCreator *> DistributedMultiThreadNetwork::distAnalogMessageCreators [protected] |
Definition at line 176 of file DistributedMultiThreadNetwork.h.
Referenced by addGenericAnalogMessage(), init(), and ~DistributedMultiThreadNetwork().
vector<vector< DistributedIncomingAnalogMsgDispatcher *> > DistributedMultiThreadNetwork::incomingDispatchers [protected] |
Definition at line 178 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
vector<DistIncomingAnalogSources2BufPosMap *> DistributedMultiThreadNetwork::sources2BufPositionsMaps [protected] |
Definition at line 180 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().
vector< vector< DistributedOutgoingAnalogMsgDispatcher *> > DistributedMultiThreadNetwork::outgoingDispatchers [protected] |
Definition at line 182 of file DistributedMultiThreadNetwork.h.
Referenced by init(), and ~DistributedMultiThreadNetwork().