#include <MPIAllToAllCommunicator.h>
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 |
MPIInputBufferVector & | inputBuffers |
reference to the array of the mpi input buffers used in the exchange. | |
MPIOutputBufferVector & | outputBuffers |
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< bool > | hasNextToSend |
vector< bool > | needsToSend |
vector< bool > | needsToReceive |
int * | send_displ |
displacements of sending mpi buffers. | |
int * | recv_displ |
displacements of receiving mpi buffers. | |
int * | send_count |
Number of elements in the sending messages. | |
int * | recv_count |
Maximum number of elements expected in the receiving buffers. |
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.
Definition at line 19 of file MPIAllToAllCommunicator.h.
MPIAllToAllCommunicator::MPIAllToAllCommunicator | ( | MPIInputBufferVector & | mpiInputBuffers, | |
MPIOutputBufferVector & | mpiOutputBuffers, | |||
MPI::Intracomm & | comm, | |||
vector< bool > & | incomingConnections, | |||
vector< bool > & | outgoingConnections | |||
) |
Constructor.
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.
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().
int MPIAllToAllCommunicator::getRank | ( | ) |
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().
bool MPIAllToAllCommunicator::finished [protected] |
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().
vector<bool>& MPIAllToAllCommunicator::incoming_connections [protected] |
Definition at line 71 of file MPIAllToAllCommunicator.h.
Referenced by MPISynchroShuffleAllToAllComm::prepare().
vector<bool>& MPIAllToAllCommunicator::outgoing_connections [protected] |
Definition at line 73 of file MPIAllToAllCommunicator.h.
Referenced by MPISynchroShuffleAllToAllComm::prepare().
int MPIAllToAllCommunicator::numNodes [protected] |
Specifies number of mpi nodes.
Definition at line 76 of file MPIAllToAllCommunicator.h.
Referenced by doAllToAllExchange(), MPISynchroShuffleAllToAllComm::doExchangeAlgorithm(), MPIAllToAllCommunicator(), and MPISynchroShuffleAllToAllComm::MPISynchroShuffleAllToAllComm().
MPI::Intracomm& MPIAllToAllCommunicator::mpi_comm [protected] |
reference to the mpi intra communicator used.
Definition at line 79 of file MPIAllToAllCommunicator.h.
Referenced by doAllToAllExchange(), MPISynchroShuffleAllToAllComm::doExchangeAlgorithm(), MPIDefaultAllToAllCommunicator::doExchangeAlgorithm(), getRank(), MPIAllToAllCommunicator(), and MPIDefaultAllToAllCommunicator::prepare().
vector<bool> MPIAllToAllCommunicator::hasNextToSend [protected] |
Definition at line 81 of file MPIAllToAllCommunicator.h.
Referenced by doAllToAllExchange(), MPISynchroShuffleAllToAllComm::doExchangeAlgorithm(), MPIDefaultAllToAllCommunicator::doExchangeAlgorithm(), MPIAllToAllCommunicator(), MPISynchroShuffleAllToAllComm::prepare(), and MPIDefaultAllToAllCommunicator::prepare().
vector<bool> MPIAllToAllCommunicator::needsToSend [protected] |
Definition at line 83 of file MPIAllToAllCommunicator.h.
Referenced by doAllToAllExchange(), MPISynchroShuffleAllToAllComm::doExchangeAlgorithm(), MPIDefaultAllToAllCommunicator::MPIDefaultAllToAllCommunicator(), MPISynchroShuffleAllToAllComm::MPISynchroShuffleAllToAllComm(), MPISynchroShuffleAllToAllComm::prepare(), and MPIDefaultAllToAllCommunicator::prepare().
vector<bool> MPIAllToAllCommunicator::needsToReceive [protected] |
Definition at line 85 of file MPIAllToAllCommunicator.h.
Referenced by doAllToAllExchange(), MPISynchroShuffleAllToAllComm::doExchangeAlgorithm(), MPIDefaultAllToAllCommunicator::MPIDefaultAllToAllCommunicator(), MPISynchroShuffleAllToAllComm::MPISynchroShuffleAllToAllComm(), MPISynchroShuffleAllToAllComm::prepare(), and MPIDefaultAllToAllCommunicator::prepare().
int* MPIAllToAllCommunicator::send_displ [protected] |
int* MPIAllToAllCommunicator::recv_displ [protected] |
int* MPIAllToAllCommunicator::send_count [protected] |
Number of elements in the sending messages.
Definition at line 94 of file MPIAllToAllCommunicator.h.
int* MPIAllToAllCommunicator::recv_count [protected] |
Maximum number of elements expected in the receiving buffers.
Definition at line 97 of file MPIAllToAllCommunicator.h.