MPIAllToAllCommunicator Class Reference

Abstract mpi all-to-all Communicator used for distributed mpi spike exchange. More...

#include <MPIAllToAllCommunicator.h>

Inheritance diagram for MPIAllToAllCommunicator:

Inheritance graph
[legend]
Collaboration diagram for MPIAllToAllCommunicator:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MPIAllToAllCommunicator (MPIInputBufferVector &mpiInputBuffers, MPIOutputBufferVector &mpiOutputBuffers, MPI::Intracomm &comm, vector< bool > &incomingConnections, vector< bool > &outgoingConnections)
 Constructor.
virtual ~MPIAllToAllCommunicator ()
bool doAllToAllExchange ()
 Does one iteration of the complete exchange mpi algorithm between all nodes.
int getRank ()

Protected Member Functions

virtual void doExchangeAlgorithm ()=0
virtual void prepare ()=0
 Custom setup of the needstosend and needstoreceive flags at the beginning of the alltoall exchange.

Protected Attributes

bool finished
MPIInputBufferVectorinputBuffers
 reference to the array of the mpi input buffers used in the exchange.
MPIOutputBufferVectoroutputBuffers
 reference to the array of the mpi output buffers used in the exchange.
vector< bool > & incoming_connections
vector< bool > & outgoing_connections
int numNodes
 Specifies number of mpi nodes.
MPI::Intracomm & mpi_comm
 reference to the mpi intra communicator used.
vector< boolhasNextToSend
vector< boolneedsToSend
vector< boolneedsToReceive
intsend_displ
 displacements of sending mpi buffers.
intrecv_displ
 displacements of receiving mpi buffers.
intsend_count
 Number of elements in the sending messages.
intrecv_count
 Maximum number of elements expected in the receiving buffers.


Detailed Description

Abstract mpi all-to-all Communicator used for distributed mpi spike exchange.

It performs all-to-all exchange of the serialized spikes data extracted the mpi output buffers, and after exchagne puts the transfered serialized spikes data to the mpi input buffers.

The actual all-to-all exchange algorithm on the mpi level is left unimplemented giving opportunity to extend to different implementations, suitable for different parallel hardware arhitectures.

See also:
MPIInputSpikeBuffer, MPIOutputSpikeBuffer

Definition at line 19 of file MPIAllToAllCommunicator.h.


Constructor & Destructor Documentation

MPIAllToAllCommunicator::MPIAllToAllCommunicator ( MPIInputBufferVector mpiInputBuffers,
MPIOutputBufferVector mpiOutputBuffers,
MPI::Intracomm &  comm,
vector< bool > &  incomingConnections,
vector< bool > &  outgoingConnections 
)

Constructor.

Parameters:
mpiInputBuffers mpi input buffers providing convenient iterating interface
mpiOutputBuffers mpi output buffers, one for each node, holding outgoing spike data to be communicated via mpi.
comm mpi intra communicator used for mpi communication.
buf_size allocated buffer space for one mpi message. Determines the maximum length of mpi messages.

Definition at line 10 of file MPIAllToAllCommunicator.cpp.

References finished, hasNextToSend, mpi_comm, and numNodes.

MPIAllToAllCommunicator::~MPIAllToAllCommunicator (  )  [virtual]

Definition at line 25 of file MPIAllToAllCommunicator.cpp.


Member Function Documentation

bool MPIAllToAllCommunicator::doAllToAllExchange (  ) 

Does one iteration of the complete exchange mpi algorithm between all nodes.

Maximum message size is limited, so in case of long buffer sizes multiple iterations are performed.

Returns true if finished, false if there are more iterations left.

Definition at line 33 of file MPIAllToAllCommunicator.cpp.

References doExchangeAlgorithm(), finished, hasNextToSend, inputBuffers, mpi_comm, needsToReceive, needsToSend, MPIOutputBufferVector::nextCycle(), numNodes, outputBuffers, prepare(), MPIInputBufferVector::prepareNextBufferSlices(), MPIOutputBufferVector::prepareNextBufferSlices(), MPIOutputBufferVector::startNewMPIExchange(), and MPIInputBufferVector::startNewMPIExchange().

Referenced by DistributedSimEngine::advance(), DistributedSimEngine::advanceOneFullCycle(), and DistributedSimEngine::finalizeCycle().

Here is the call graph for this function:

int MPIAllToAllCommunicator::getRank (  ) 

Definition at line 28 of file MPIAllToAllCommunicator.cpp.

References mpi_comm.

virtual void MPIAllToAllCommunicator::doExchangeAlgorithm (  )  [protected, pure virtual]

Derived classes should implement this method with a specific algorithm.

Implemented in MPIDefaultAllToAllCommunicator, and MPISynchroShuffleAllToAllComm.

Referenced by doAllToAllExchange().

virtual void MPIAllToAllCommunicator::prepare (  )  [protected, pure virtual]

Custom setup of the needstosend and needstoreceive flags at the beginning of the alltoall exchange.

Implemented in MPIDefaultAllToAllCommunicator, and MPISynchroShuffleAllToAllComm.

Referenced by doAllToAllExchange().


Member Data Documentation

Definition at line 63 of file MPIAllToAllCommunicator.h.

Referenced by doAllToAllExchange(), and MPIAllToAllCommunicator().

reference to the array of the mpi input buffers used in the exchange.

Definition at line 66 of file MPIAllToAllCommunicator.h.

Referenced by doAllToAllExchange(), MPISynchroShuffleAllToAllComm::doExchangeAlgorithm(), and MPIDefaultAllToAllCommunicator::doExchangeAlgorithm().

reference to the array of the mpi output buffers used in the exchange.

Definition at line 69 of file MPIAllToAllCommunicator.h.

Referenced by doAllToAllExchange(), MPISynchroShuffleAllToAllComm::doExchangeAlgorithm(), and MPIDefaultAllToAllCommunicator::doExchangeAlgorithm().

Definition at line 71 of file MPIAllToAllCommunicator.h.

Referenced by MPISynchroShuffleAllToAllComm::prepare().

Definition at line 73 of file MPIAllToAllCommunicator.h.

Referenced by MPISynchroShuffleAllToAllComm::prepare().

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

displacements of sending mpi buffers.

Definition at line 88 of file MPIAllToAllCommunicator.h.

displacements of receiving mpi buffers.

Definition at line 91 of file MPIAllToAllCommunicator.h.

Number of elements in the sending messages.

Definition at line 94 of file MPIAllToAllCommunicator.h.

Maximum number of elements expected in the receiving buffers.

Definition at line 97 of file MPIAllToAllCommunicator.h.


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

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