OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
#include <combuff.h>
Public Member Functions | |
StaticCommunicationBuffer (MPI_Comm comm, int size, bool dynamic=0) | |
StaticCommunicationBuffer (MPI_Comm comm, bool dynamic=0) | |
Constructor. Creates empty buffer, using given communicator for packing. More... | |
virtual | ~StaticCommunicationBuffer () |
Destructor. More... | |
virtual int | resize (int newSize) |
Resizes buffer to given size. More... | |
virtual void | init () |
Initializes buffer to empty state. More... | |
virtual void | initForPacking () |
Initialize for packing. More... | |
virtual void | initForUnpacking () |
Initialize for Unpacking (data already received) More... | |
virtual int | write (const int *src, int n) |
Writes count integer values from array pointed by data. More... | |
virtual int | write (const long *src, int n) |
Writes count long values from array pointed by data. More... | |
virtual int | write (const unsigned long *src, int n) |
Writes count unsigned long values from array pointed by data. More... | |
virtual int | write (const double *src, int n) |
Writes count double values from array pointed by data. More... | |
virtual int | write (const char *src, int n) |
Writes count char values from array pointed by data. More... | |
virtual int | read (int *dest, int n) |
Reads count integer values into array pointed by data. More... | |
virtual int | read (long *dest, int n) |
Reads count long values into array pointed by data. More... | |
virtual int | read (unsigned long *dest, int n) |
Reads count unsigned long values into array pointed by data. More... | |
virtual int | read (double *dest, int n) |
Reads count double values into array pointed by data. More... | |
virtual int | read (char *dest, int n) |
Reads count char values into array pointed by data. More... | |
virtual int | iSend (int dest, int tag) |
Starts standard mode, nonblocking send. More... | |
virtual int | iRecv (int source, int tag, int count=0) |
Starts standard mode, nonblocking receive. More... | |
virtual int | testCompletion () |
Tests if the operation identified by this->request is complete. More... | |
int | testCompletion (int &source, int &tag) |
virtual int | waitCompletion () |
Waits until a completion of a nonblocking communication. More... | |
virtual int | bcast (int root) |
Initializes broadcast over collaborating processes. More... | |
Public Member Functions inherited from oofem::CommunicationBuffer | |
CommunicationBuffer (MPI_Comm comm, int size, bool dynamic=0) | |
CommunicationBuffer (MPI_Comm comm, bool dynamic=0) | |
Constructor. Creates empty buffer, using given communicator for packing. More... | |
virtual | ~CommunicationBuffer () |
Destructor. More... | |
virtual int | read (bool &data) |
Reads a bool value from data. More... | |
virtual int | write (bool data) |
Writes a bool value. More... | |
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) |
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... | |
Public Member Functions inherited from oofem::MPIBuffer | |
MPIBuffer (int size, bool dynamic=0) | |
Constructor. Creates buffer of given size, using given communicator for packing. More... | |
MPIBuffer (bool dynamic=0) | |
Constructor. Creates empty buffer, using given communicator for packing. More... | |
virtual | ~MPIBuffer () |
Destructor. More... | |
int | resize (int newSize) |
Resizes buffer to given size. More... | |
int | giveSize () |
int | giveAvailableSpace () |
MPI_Request | giveRequest () |
Returns associated MPI request handle. More... | |
int | packArray (MPI_Comm communicator, const void *src, int n, MPI_Datatype type) |
Packs array of a values of given type into buffer. More... | |
int | unpackArray (MPI_Comm communicator, void *dest, int n, MPI_Datatype type) |
Unpacks array of values of given type from buffer. More... | |
int | givePackSize (MPI_Comm communicator, MPI_Datatype type, int size) |
Returns pack size required to pack array of given type and size (c-style). More... | |
virtual int | iSend (MPI_Comm communicator, int dest, int tag) |
Starts standard mode, nonblocking send. More... | |
virtual int | iRecv (MPI_Comm communicator, int source, int tag, int count=0) |
Starts standard mode, nonblocking receive. More... | |
int | testCompletion () |
Tests if the operation identified by this->request is complete. More... | |
int | testCompletion (int &source, int &tag) |
Tests if the operation identified by this->request is complete. More... | |
int | bcast (MPI_Comm communicator, int root) |
Initializes broadcast over collaborating processes. More... | |
void | dump () |
Additional Inherited Members | |
Protected Attributes inherited from oofem::CommunicationBuffer | |
MPI_Comm | communicator |
Protected Attributes inherited from oofem::MPIBuffer | |
int | size |
Size and current position in buffer in bytes (sizeof(char)). More... | |
int | curr_pos |
bool | isDynamic |
Dynamic flag (if true, buffer can grow, but reallocation is needed). More... | |
ComBuff_BYTE_TYPE * | buff |
Buffer. Dynamically allocated. More... | |
MPI_Request | request |
MPI request handle. More... | |
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Initializes broadcast over collaborating processes.
The whole buffer size is broadcasted. All buffers participating in broadcast should have the same size.
root | Rank of broadcast root. |
Implements oofem::CommunicationBuffer.
Definition at line 354 of file combuff.h.
References oofem::MPIBuffer::bcast().
Referenced by oofem::NonlocalMaterialWTP::migrate(), oofem::ElementCommunicator::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inlinevirtual |
Initializes buffer to empty state.
All packed data are lost.
Reimplemented from oofem::MPIBuffer.
Definition at line 316 of file combuff.h.
References oofem::MPIBuffer::init().
Referenced by oofem::NonlocalMaterialWTP::migrate(), oofem::FETICommunicator::setUpCommunicationMaps(), oofem::FETISolver::setUpCommunicationMaps(), oofem::ElementCommunicator::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inlinevirtual |
Initialize for packing.
Implements oofem::CommunicationBuffer.
|
inlinevirtual |
Initialize for Unpacking (data already received)
Implements oofem::CommunicationBuffer.
Definition at line 318 of file combuff.h.
References oofem::CommunicationBuffer::write().
|
inlinevirtual |
Starts standard mode, nonblocking receive.
The buffer must be large enough to receive all data.
source | Rank of source. |
tag | Message tag. |
count | Number of elements to receive (bytes). Causes receive buffer to resize to count elements. If zero (default value) buffer is not resized. |
Implements oofem::CommunicationBuffer.
Definition at line 346 of file combuff.h.
References oofem::MPIBuffer::iRecv().
Referenced by oofem::FETICommunicator::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inlinevirtual |
Starts standard mode, nonblocking send.
dest | Rank of destination. |
tag | Message tag. |
Implements oofem::CommunicationBuffer.
Definition at line 344 of file combuff.h.
References oofem::MPIBuffer::iSend().
Referenced by oofem::FETISolver::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inlinevirtual |
Reads count integer values into array pointed by data.
Implements oofem::DataStream.
Definition at line 333 of file combuff.h.
References oofem::MPIBuffer::unpackArray().
Referenced by oofem::NonlocalMaterialWTP::migrate(), oofem::FETICommunicator::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inlinevirtual |
Reads count long values into array pointed by data.
Implements oofem::DataStream.
Definition at line 335 of file combuff.h.
References oofem::MPIBuffer::unpackArray().
|
inlinevirtual |
Reads count unsigned long values into array pointed by data.
Implements oofem::DataStream.
Definition at line 337 of file combuff.h.
References oofem::MPIBuffer::unpackArray().
|
inlinevirtual |
Reads count double values into array pointed by data.
Implements oofem::DataStream.
Definition at line 339 of file combuff.h.
References oofem::MPIBuffer::unpackArray().
|
inlinevirtual |
Reads count char values into array pointed by data.
Implements oofem::DataStream.
Definition at line 341 of file combuff.h.
References oofem::MPIBuffer::unpackArray().
|
inlinevirtual |
Resizes buffer to given size.
If buffer size is to be enlarged, then previously packed data are kept in new buffer. Otherwise buffer is cleared using init service. Current implementation only performs buffer growing, request for size decrease is ignored to avoid reallocation if further request for growing is encountered.
newSize | New buffer size in bytes. |
Implements oofem::CommunicationBuffer.
Definition at line 314 of file combuff.h.
References oofem::MPIBuffer::resize().
Referenced by oofem::NonlocalMaterialWTP::migrate(), oofem::FETICommunicator::setUpCommunicationMaps(), oofem::FETISolver::setUpCommunicationMaps(), oofem::ElementCommunicator::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inlinevirtual |
Tests if the operation identified by this->request is complete.
In such case, true is returned and if communication was initiated by nonblocking send/receive, then request handle is set to MPI_REQUEST_NULL. Otherwise call returns flag=false.
Implements oofem::CommunicationBuffer.
Definition at line 348 of file combuff.h.
References oofem::MPIBuffer::testCompletion().
Referenced by oofem::FETICommunicator::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inline |
Definition at line 350 of file combuff.h.
References oofem::MPIBuffer::testCompletion().
|
inlinevirtual |
Waits until a completion of a nonblocking communication.
The completion of a send operation indicates that the sender is now free to update the locations in the send buffer, the completion of a receive operation indicates that the receive buffer contains the received message, the receiver is now free to access it, and that the status object is set. If the communication object associated with this request was created (nonblocking send or receive call), then the object is deallocated by the call to MPI_WAIT and the request handle is set to MPI_REQUEST_NULL.
Reimplemented from oofem::MPIBuffer.
Definition at line 352 of file combuff.h.
References oofem::MPIBuffer::waitCompletion().
|
inlinevirtual |
Writes count integer values from array pointed by data.
Implements oofem::DataStream.
Definition at line 321 of file combuff.h.
References oofem::MPIBuffer::packArray().
Referenced by oofem::NonlocalMaterialWTP::migrate(), oofem::FETISolver::setUpCommunicationMaps(), and oofem::FETISolver::solve().
|
inlinevirtual |
Writes count long values from array pointed by data.
Implements oofem::DataStream.
Definition at line 323 of file combuff.h.
References oofem::MPIBuffer::packArray().
|
inlinevirtual |
Writes count unsigned long values from array pointed by data.
Implements oofem::DataStream.
Definition at line 325 of file combuff.h.
References oofem::MPIBuffer::packArray().
|
inlinevirtual |
Writes count double values from array pointed by data.
Implements oofem::DataStream.
Definition at line 327 of file combuff.h.
References oofem::MPIBuffer::packArray().
|
inlinevirtual |
Writes count char values from array pointed by data.
Implements oofem::DataStream.
Definition at line 329 of file combuff.h.
References oofem::MPIBuffer::packArray(), and oofem::CommunicationBuffer::read().