DistributedNetwork Class Reference

Network holding the common functionalities for distributed simulations. More...

#include <DistributedNetwork.h>

Inheritance diagram for DistributedNetwork:

Inheritance graph
[legend]
Collaboration diagram for DistributedNetwork:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DistributedNetwork (int nThreads, SimParameter sp=SimParameter::Default)
 Constructor setting the common attributes for simulation.
 DistributedNetwork (int nThreads, MPI::Intracomm &mpiCommunicator, SimParameter sp=SimParameter::Default)
 Constructor setting the common attributes for simulation.
virtual ~DistributedNetwork ()
 Destructor.
MPI::Intracomm & getMpiComm ()
 Return a reference of the MPI communicator in use.
virtual void _addObject_ (const SimObjectFactory &objFactory, const SimEngine::ID &loc, SimObject::ID &gid)
 One instance of a simulation object is created by the factory and added at the specified simulation engine of the network.
virtual void _addObject_ (const SimObjectFactory &objFactory, SimObject::ID &id)
 One instance of a simulation object is created and added to the network using the current distribution strategy. The SimObject::ID is returned.
virtual void _addSpikeMessage_ (const SimObject::ID &sender, const port_t out, const SimObject::ID &receiver, const port_t in, const Time &delay)
 Set up a spike message channel with a given delay.
Converting between local and global engine IDs
virtual gl_engineid_t getGlobalEngineID (const SimEngine::ID &eid) const
 Return the global ID of a given SingleThreadSimEngine.
virtual gl_engineid_t getGlobalEngineID (engineid_t eng) const
 Return the global ID of a given SingleThreadSimEngine on the executing MPI node.
virtual gl_engineid_t maxGlobalEngineID (void) const
 Return the largest global simulation engine ID.
virtual gl_engineid_t maxLocalEngineID (void) const
 Return the largest local simulation engine ID at the executing node.
virtual const SimEngine::ID getLocation (gl_engineid_t gEID) const
 Return the reference to the location of a given global engine ID.

Protected Member Functions

virtual void _mount_ (const SimObjectFactory &objFactory, const SimObject::ID &mountpoint, SimObject::ID &gid)
 One instance of a simulation object is created and "mounted" to the mount simulation object.
virtual void _insert_ (const SimObjectFactory &objFactory, const SimObject::ID &container, SimObject::ID &gid)
 One instance of a simulation object is "inserted" into the container simulation object. The SimObject::quadID of the newly created object is returned.
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)
virtual void _connect_ (SimObject::ID const &src, port_t out, const SimObject::ID &dst, port_t in, int delay)
 Make a connection (i.e. spike or analog message) from the src-out port to the dest-in port.
spike_port_id_t getFirstSenderSpikePort (const SimObject::ID &oid)
void setupGlEngineIDs (unsigned int numLocalEngines=1)
 method that constructs the glengineids table
local_objectid_t getGhostID (gl_engineid_t gEID, SimObjectFactory const &objFactory)
virtual void seed_noise_rng (uint32 noise_seed)
virtual uint32 getUniqueSeedOverMpi (uint32 seed)

Protected Attributes

MPI::Intracomm & mpi_comm
 mpi intra-communicator used for inter-node communication.
DistributedSimEnginedistEngine
 pointer to the distributed sim engine the network uses for advancing the simulation.
SimEnginelocalSimEngine
 Engine which runs the local (sinlge-threaded) simulation, advances local objects and controls localSpikeScheduler.
vector< vector< gl_engineid_t > > glengineids
 Table used to convert the local engine id for some node to global engine id.
vector< boolincomingConnections
 connectivity matrix saying if there are any object-object connections from one node to another.
vector< booloutgoingConnections
gl_engineid_t _max_global_engine_id
 Maximal global engine id.
vector< SimEngine::IDlocation
 Vector storing the location (i.e. node, local engie id) associated with a global engine ID.
vector< vector
< local_objectid_t > > 
objectCounter
 Count to be used to magically get the local object ID's of an object on an arbitrary node and thread.
vector< spike_port_id_tspikePortCounter
 Count to be used to magically get the first spike port ID of an object on an arbitrary node and thread.
vector< vector< vector
< spike_port_id_t > > > 
ghostFirstPortInfo

Friends

class DistributedMultiThreadNetworkTest

Classes

struct  ConnectInfo


Detailed Description

Network holding the common functionalities for distributed simulations.

All the network classes which implement distributed simulations should be derived from this class. It implements some functionalities that common to distributed simulations, like global engine ids setup, that can be used by derived classes.

Definition at line 23 of file DistributedNetwork.h.


Constructor & Destructor Documentation

DistributedNetwork::DistributedNetwork ( int  nThreads,
SimParameter  sp = SimParameter::Default 
)

Constructor setting the common attributes for simulation.

Definition at line 18 of file DistributedNetwork.cpp.

References PCSIM::init().

Here is the call graph for this function:

DistributedNetwork::DistributedNetwork ( int  nThreads,
MPI::Intracomm &  mpiCommunicator,
SimParameter  sp = SimParameter::Default 
)

Constructor setting the common attributes for simulation.

Definition at line 24 of file DistributedNetwork.cpp.

References PCSIM::init().

Here is the call graph for this function:

DistributedNetwork::~DistributedNetwork (  )  [virtual]

Destructor.

Definition at line 47 of file DistributedNetwork.cpp.


Member Function Documentation

MPI::Intracomm& DistributedNetwork::getMpiComm (  )  [inline]

Return a reference of the MPI communicator in use.

Definition at line 41 of file DistributedNetwork.h.

References mpi_comm.

void DistributedNetwork::_addObject_ ( const SimObjectFactory objFactory,
const SimEngine::ID loc,
SimObject::ID gid 
) [virtual]

One instance of a simulation object is created by the factory and added at the specified simulation engine of the network.

Parameters:
loc Specifies the node and local engine where the object should be added to. loc.engine is ignored!
id The resulting unique identifier (node,engine,type,localid) of the created object. loc.engine = 0 always holds.

Reimplemented from SimNetwork.

Definition at line 177 of file DistributedNetwork.cpp.

References SimEngine::addObject(), SimEngine::ID::engine, getGhostID(), getGlobalEngineID(), SimObjectFactory::getObjectTypeID(), SimObject::ID::Invalid, INVALID_GLOBAL_ENGINE_ID, localSimEngine, mpi_comm, SimEngine::ID::node, and SimEngine::ID::toString().

Referenced by _addObject_().

Here is the call graph for this function:

virtual void DistributedNetwork::_addObject_ ( const SimObjectFactory objFactory,
SimObject::ID id 
) [inline, virtual]

One instance of a simulation object is created and added to the network using the current distribution strategy. The SimObject::ID is returned.

Reimplemented from SimNetwork.

Definition at line 52 of file DistributedNetwork.h.

References _addObject_(), and SimNetwork::distributionStrategy.

Here is the call graph for this function:

void DistributedNetwork::_addSpikeMessage_ ( const SimObject::ID sender,
const port_t  out,
const SimObject::ID receiver,
const port_t  in,
const Time delay 
) [virtual]

Set up a spike message channel with a given delay.

Reimplemented from SimNetwork.

Definition at line 266 of file DistributedNetwork.cpp.

References SimNetwork::get_dt(), getFirstSenderSpikePort(), SimObjectRegistry::getObject(), Time::in_steps(), SimObject::spiking, theSimObjectRegistry, SimObject::ID::toString(), and SimObject::ID::type.

Referenced by _connect_().

Here is the call graph for this function:

gl_engineid_t DistributedNetwork::getGlobalEngineID ( const SimEngine::ID eid  )  const [virtual]

gl_engineid_t DistributedNetwork::getGlobalEngineID ( engineid_t  eng  )  const [virtual]

Return the global ID of a given SingleThreadSimEngine on the executing MPI node.

Definition at line 113 of file DistributedNetwork.cpp.

References getGlobalEngineID(), and mpi_comm.

Here is the call graph for this function:

gl_engineid_t DistributedNetwork::maxGlobalEngineID ( void   )  const [virtual]

gl_engineid_t DistributedNetwork::maxLocalEngineID ( void   )  const [virtual]

const SimEngine::ID DistributedNetwork::getLocation ( gl_engineid_t  gEID  )  const [virtual]

void DistributedNetwork::_mount_ ( const SimObjectFactory model,
const SimObject::ID mountpoint,
SimObject::ID gid 
) [protected, virtual]

One instance of a simulation object is created and "mounted" to the mount simulation object.

Parameters:
model A model (factory) which specifis how the instance of the object to be added is created.
id The resulting unique identifier (node,engine,type,localid) of the created object.

Reimplemented from SimNetwork.

Definition at line 196 of file DistributedNetwork.cpp.

References SimObject::ID::eng, SimEngine::ID::engine, getGhostID(), getGlobalEngineID(), SimObjectFactory::getObjectTypeID(), SimObject::ID::Invalid, INVALID_GLOBAL_ENGINE_ID, localSimEngine, SimEngine::mount(), mpi_comm, SimEngine::ID::node, SimObject::ID::node, and SimObject::ID::toString().

Here is the call graph for this function:

void DistributedNetwork::_insert_ ( const SimObjectFactory objFactory,
const SimObject::ID container,
SimObject::ID gid 
) [protected, virtual]

One instance of a simulation object is "inserted" into the container simulation object. The SimObject::quadID of the newly created object is returned.

Reimplemented from SimNetwork.

Definition at line 215 of file DistributedNetwork.cpp.

References SimObject::ID::eng, SimEngine::ID::engine, getGhostID(), getGlobalEngineID(), SimObjectFactory::getObjectTypeID(), SimEngine::insert(), SimObject::ID::Invalid, INVALID_GLOBAL_ENGINE_ID, localSimEngine, mpi_comm, SimEngine::ID::node, SimObject::ID::node, and SimObject::ID::toString().

Here is the call graph for this function:

virtual void DistributedNetwork::_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 
) [inline, protected, virtual]

Reimplemented in DistributedMultiThreadNetwork, and DistributedSingleThreadNetwork.

Definition at line 140 of file DistributedNetwork.h.

void DistributedNetwork::_connect_ ( SimObject::ID const &  src,
port_t  out,
const SimObject::ID dst,
port_t  in,
int  delay 
) [protected, virtual]

spike_port_id_t DistributedNetwork::getFirstSenderSpikePort ( const SimObject::ID oid  )  [protected]

void DistributedNetwork::setupGlEngineIDs ( unsigned int  numLocalEngines = 1  )  [protected]

method that constructs the glengineids table

See also:
glenginids

Definition at line 79 of file DistributedNetwork.cpp.

References _max_global_engine_id, glengineids, location, and mpi_comm.

local_objectid_t DistributedNetwork::getGhostID ( gl_engineid_t  gEID,
SimObjectFactory const &  objFactory 
) [protected]

void DistributedNetwork::seed_noise_rng ( uint32  noise_seed  )  [protected, virtual]

uint32 DistributedNetwork::getUniqueSeedOverMpi ( uint32  seed  )  [protected, virtual]

Reimplemented from SimNetwork.

Definition at line 52 of file DistributedNetwork.cpp.

References mpi_comm.

Referenced by seed_noise_rng().


Friends And Related Function Documentation

friend class DistributedMultiThreadNetworkTest [friend]

Definition at line 133 of file DistributedNetwork.h.


Member Data Documentation

MPI::Intracomm& DistributedNetwork::mpi_comm [protected]

vector< vector< gl_engineid_t > > DistributedNetwork::glengineids [protected]

Maximal global engine id.

Definition at line 196 of file DistributedNetwork.h.

Referenced by maxGlobalEngineID(), and setupGlEngineIDs().

Vector storing the location (i.e. node, local engie id) associated with a global engine ID.

Definition at line 199 of file DistributedNetwork.h.

Referenced by getLocation(), and setupGlEngineIDs().

vector< vector< local_objectid_t > > DistributedNetwork::objectCounter [protected]

Count to be used to magically get the local object ID's of an object on an arbitrary node and thread.

Definition at line 205 of file DistributedNetwork.h.

Referenced by getGhostID().

Count to be used to magically get the first spike port ID of an object on an arbitrary node and thread.

Definition at line 208 of file DistributedNetwork.h.

Referenced by getGhostID().

vector< vector< vector< spike_port_id_t > > > DistributedNetwork::ghostFirstPortInfo [protected]

Definition at line 210 of file DistributedNetwork.h.

Referenced by getFirstSenderSpikePort(), and getGhostID().


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

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