OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order to allow share the same buffer by several communicators. More...
#include <processcomm.h>
Public Member Functions | |
ProcessCommunicatorBuff (CommBuffType t) | |
Constructor, creates empty send and receive com buffs in MPI_COMM_WORLD. More... | |
virtual | ~ProcessCommunicatorBuff () |
virtual int | givePackSizeOfInt (int count) |
virtual int | givePackSizeOfDouble (int count) |
virtual int | givePackSizeOfChar (int count) |
virtual int | givePackSizeOfBool (int count) |
virtual int | givePackSizeOfLong (int count) |
virtual int | write (const int *data, int count) |
Writes count integer values from array pointed by data. More... | |
virtual int | write (const long *data, int count) |
Writes count long values from array pointed by data. More... | |
virtual int | write (const unsigned long *data, int count) |
Writes count unsigned long values from array pointed by data. More... | |
virtual int | write (const double *data, int count) |
Writes count double values from array pointed by data. More... | |
virtual int | write (const char *data, int count) |
Writes count char values from array pointed by data. More... | |
virtual int | write (bool data) |
Writes a bool value. More... | |
virtual int | read (int *data, int count) |
Reads count integer values into array pointed by data. More... | |
virtual int | read (long *data, int count) |
Reads count long values into array pointed by data. More... | |
virtual int | read (unsigned long *data, int count) |
Reads count unsigned long values into array pointed by data. More... | |
virtual int | read (double *data, int count) |
Reads count double values into array pointed by data. More... | |
virtual int | read (char *data, int count) |
Reads count char values into array pointed by data. More... | |
virtual int | read (bool &data) |
Reads a bool value from data. More... | |
void | initSendBuff () |
Initializes send buffer to empty state. All packed data are lost. More... | |
void | initRecvBuff () |
Initializes send buffer to empty state. All packed data are lost. More... | |
void | init () |
Initializes receiver buffers. More... | |
void | initForPacking () |
Initialize for packing. More... | |
void | initForUnpacking () |
Initialize for Unpacking (data already received). More... | |
int | initExchange (int rank, int tag) |
Initializes data exchange with associated problem. More... | |
int | initSend (int rank, int tag) |
Initialize the send data exchange with associate problem. More... | |
int | initReceive (int rank, int tag) |
Initialize the receive data exchange with associate problem. More... | |
void | clearBuffers () |
Clears all buffer contents. More... | |
void | resizeSendBuffer (int size) |
void | resizeReceiveBuffer (int size) |
CommunicationBuffer * | giveSendBuff () |
Returns send buffer of receiver. More... | |
CommunicationBuffer * | giveRecvBuff () |
Returns receive buffer of receiver. More... | |
Methods for manipulating/testing receiver state | |
int | sendCompleted () |
int | receiveCompleted () |
int | testCompletion () |
int | waitCompletion () |
Public Member Functions inherited from oofem::DataStream | |
virtual | ~DataStream () |
Destructor. More... | |
int | read (int &data) |
int | read (unsigned long &data) |
int | read (long &data) |
int | read (double &data) |
int | read (char &data) |
int | read (std::string &data) |
Reads a string (stored as an int for the length followed by char*). More... | |
int | write (int data) |
int | write (unsigned long data) |
int | write (long data) |
int | write (double data) |
int | write (char data) |
int | write (const std::string &data) |
Reads a string (stored as an int for the length followed by char*). More... | |
int | write (const char *data) |
Writes a string (wrapper needed, otherwise write(bool) is called ) More... | |
Protected Attributes | |
CommunicationBuffer * | send_buff |
Send buffer. More... | |
CommunicationBuffer * | recv_buff |
Receive buffer. More... | |
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order to allow share the same buffer by several communicators.
Here sharing means reusing for different but NON-OVERLAPPING communications. if communications overlap, the different instances of ProcessCommunicatorBuff should be used! The ProcessCommunicatorBuff objects are registered in corresponding communicator, then if maps are available, comBuff should be resized and used in subsequent operations.
The registration is necessary, otherwise before each send operation the buffers (given probably as parameter) will be resized again (size have to be computed again) and this is probably quite cost operation. When comBuff will be registered, resize is needed only when maps change, and this will not occur frequently (its even quite rare).
Definition at line 64 of file processcomm.h.
oofem::ProcessCommunicatorBuff::ProcessCommunicatorBuff | ( | CommBuffType | t | ) |
Constructor, creates empty send and receive com buffs in MPI_COMM_WORLD.
Definition at line 45 of file processcomm.C.
References oofem::CBT_static, recv_buff, and send_buff.
|
virtual |
Definition at line 66 of file processcomm.C.
|
inline |
Clears all buffer contents.
Definition at line 147 of file processcomm.h.
|
inlinevirtual |
Implements oofem::DataStream.
Definition at line 79 of file processcomm.h.
References oofem::CommunicationBuffer::givePackSizeOfBool().
|
inlinevirtual |
Implements oofem::DataStream.
Definition at line 78 of file processcomm.h.
References oofem::CommunicationBuffer::givePackSizeOfChar().
|
inlinevirtual |
Implements oofem::DataStream.
Definition at line 77 of file processcomm.h.
References oofem::CommunicationBuffer::givePackSizeOfDouble().
|
inlinevirtual |
Implements oofem::DataStream.
Definition at line 76 of file processcomm.h.
References oofem::CommunicationBuffer::givePackSizeOfInt().
|
inlinevirtual |
Implements oofem::DataStream.
Definition at line 80 of file processcomm.h.
References oofem::CommunicationBuffer::givePackSizeOfLong(), and oofem::DataStream::write().
|
inline |
Returns receive buffer of receiver.
Definition at line 167 of file processcomm.h.
Referenced by oofem::FETISolver::masterUnpackQQProduct(), oofem::FETISolver::masterUnpackRBM(), oofem::FETISolver::unpackDirectionVector(), oofem::FETISolver::unpackGammas(), oofem::FETISolver::unpackPPVector(), oofem::EngngModel::unpackRemoteElementData(), oofem::FETISolver::unpackResiduals(), and oofem::FETISolver::unpackSolution().
|
inline |
Returns send buffer of receiver.
Definition at line 163 of file processcomm.h.
Referenced by oofem::FETISolver::packDirectionVector(), oofem::FETISolver::packGammas(), oofem::FETISolver::packPPVector(), oofem::FETISolver::packQQProducts(), oofem::FETISolver::packRBM(), oofem::EngngModel::packRemoteElementData(), oofem::FETISolver::packResiduals(), and oofem::FETISolver::packSolution().
|
inline |
Initializes receiver buffers.
Definition at line 103 of file processcomm.h.
Referenced by oofem::ProcessCommunicator::clearBuffers().
|
inline |
Initializes data exchange with associated problem.
if send or receive pool is empty, the send or receive communication is not performed.
rank | Partition number. |
tag | Message tag. |
Definition at line 120 of file processcomm.h.
|
inline |
Initialize for packing.
Definition at line 109 of file processcomm.h.
References oofem::CommunicationBuffer::initForPacking().
|
inline |
Initialize for Unpacking (data already received).
Definition at line 111 of file processcomm.h.
References oofem::CommunicationBuffer::initForUnpacking().
|
inline |
Initialize the receive data exchange with associate problem.
if receive pool is empty, the receive communication is not performed.
rank | Partition number. |
tag | Message tag. |
Definition at line 142 of file processcomm.h.
References oofem::CommunicationBuffer::iRecv().
Referenced by oofem::ProcessCommunicator::initReceive().
|
inline |
Initializes send buffer to empty state. All packed data are lost.
Definition at line 101 of file processcomm.h.
References oofem::CommunicationBuffer::init().
Referenced by oofem::ProcessCommunicator::initReceive().
|
inline |
Initialize the send data exchange with associate problem.
if send pool is empty, the send communication is not performed.
rank | Partition number. |
tag | Message tag. |
Definition at line 134 of file processcomm.h.
References oofem::CommunicationBuffer::iSend().
Referenced by oofem::ProcessCommunicator::initSend().
|
inline |
Initializes send buffer to empty state. All packed data are lost.
Definition at line 99 of file processcomm.h.
References oofem::CommunicationBuffer::init().
Referenced by oofem::ProcessCommunicator::initSend().
|
inlinevirtual |
Reads count integer values into array pointed by data.
Implements oofem::DataStream.
Definition at line 91 of file processcomm.h.
References oofem::CommunicationBuffer::read().
Referenced by oofem::EngngModel::unpackDofManagers(), oofem::Subdivision::unpackIrregularSharedGlobnums(), oofem::LoadBalancer::unpackMigratingData(), oofem::NonlocalMaterialWTP::unpackMigratingElementDependencies(), oofem::NonlocalMaterialWTP::unpackRemoteElements(), oofem::Subdivision::unpackRemoteElements(), oofem::ParmetisLoadBalancer::unpackSharedDmanPartitions(), oofem::NodalAveragingRecoveryModel::unpackSharedDofManData(), oofem::ZZNodalRecoveryModel::unpackSharedDofManData(), oofem::SPRNodalRecoveryModel::unpackSharedDofManData(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalIndicatorVals(), oofem::Subdivision::unpackSharedEdges(), and oofem::Subdivision::unpackSharedIrregulars().
|
inlinevirtual |
Reads count long values into array pointed by data.
Implements oofem::DataStream.
Definition at line 92 of file processcomm.h.
References oofem::CommunicationBuffer::read().
|
inlinevirtual |
Reads count unsigned long values into array pointed by data.
Implements oofem::DataStream.
Definition at line 93 of file processcomm.h.
References oofem::CommunicationBuffer::read().
|
inlinevirtual |
Reads count double values into array pointed by data.
Implements oofem::DataStream.
Definition at line 94 of file processcomm.h.
References oofem::CommunicationBuffer::read().
|
inlinevirtual |
Reads count char values into array pointed by data.
Implements oofem::DataStream.
Definition at line 95 of file processcomm.h.
References oofem::CommunicationBuffer::read().
|
inlinevirtual |
Reads a bool value from data.
Implements oofem::DataStream.
Definition at line 96 of file processcomm.h.
References oofem::CommunicationBuffer::read().
|
inline |
Definition at line 155 of file processcomm.h.
References oofem::CommunicationBuffer::testCompletion().
Referenced by oofem::ProcessCommunicator::receiveCompleted().
|
inline |
Definition at line 150 of file processcomm.h.
References oofem::CommunicationBuffer::resize().
|
inline |
Definition at line 149 of file processcomm.h.
References oofem::CommunicationBuffer::resize().
|
inline |
Definition at line 154 of file processcomm.h.
References oofem::CommunicationBuffer::testCompletion().
Referenced by oofem::ProcessCommunicator::sendCompleted().
|
inline |
Definition at line 156 of file processcomm.h.
References oofem::CommunicationBuffer::testCompletion().
|
inline |
Definition at line 157 of file processcomm.h.
References oofem::CommunicationBuffer::waitCompletion().
|
inlinevirtual |
Writes count integer values from array pointed by data.
Implements oofem::DataStream.
Definition at line 83 of file processcomm.h.
References oofem::CommunicationBuffer::write().
Referenced by oofem::EngngModel::packDofManagers(), oofem::Subdivision::packIrregularSharedGlobnums(), oofem::LoadBalancer::packMigratingData(), oofem::NonlocalMaterialWTP::packMigratingElementDependencies(), oofem::NonlocalMaterialWTP::packRemoteElements(), oofem::Subdivision::packRemoteElements(), oofem::ParmetisLoadBalancer::packSharedDmanPartitions(), oofem::NodalAveragingRecoveryModel::packSharedDofManData(), oofem::ZZNodalRecoveryModel::packSharedDofManData(), oofem::SPRNodalRecoveryModel::packSharedDofManData(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalIndicatorVals(), oofem::Subdivision::packSharedEdges(), and oofem::Subdivision::packSharedIrregulars().
|
inlinevirtual |
Writes count long values from array pointed by data.
Implements oofem::DataStream.
Definition at line 84 of file processcomm.h.
References oofem::CommunicationBuffer::write().
|
inlinevirtual |
Writes count unsigned long values from array pointed by data.
Implements oofem::DataStream.
Definition at line 85 of file processcomm.h.
References oofem::CommunicationBuffer::write().
|
inlinevirtual |
Writes count double values from array pointed by data.
Implements oofem::DataStream.
Definition at line 86 of file processcomm.h.
References oofem::CommunicationBuffer::write().
|
inlinevirtual |
Writes count char values from array pointed by data.
Implements oofem::DataStream.
Definition at line 87 of file processcomm.h.
References oofem::CommunicationBuffer::write().
|
inlinevirtual |
Writes a bool value.
Implements oofem::DataStream.
Definition at line 88 of file processcomm.h.
References oofem::DataStream::read(), and oofem::CommunicationBuffer::write().
|
protected |
Receive buffer.
Definition at line 70 of file processcomm.h.
Referenced by ProcessCommunicatorBuff().
|
protected |