|
OOFEM 3.0
|
#include <processcomm.h>
Public Member Functions | |
| ProcessCommunicatorBuff (CommBuffType t) | |
| Constructor, creates empty send and receive com buffs in MPI_COMM_WORLD. | |
| int | givePackSizeOfInt (std::size_t count) override |
| int | givePackSizeOfDouble (std::size_t count) override |
| int | givePackSizeOfChar (std::size_t count) override |
| int | givePackSizeOfBool (std::size_t count) override |
| int | givePackSizeOfLong (std::size_t count) override |
| int | givePackSizeOfSizet (std::size_t count) override |
| int | write (const int *data, std::size_t count) override |
| Writes count integer values from array pointed by data. | |
| int | write (const long *data, std::size_t count) override |
| Writes count long values from array pointed by data. | |
| int | write (const unsigned long *data, std::size_t count) override |
| Writes count unsigned long values from array pointed by data. | |
| int | write (const double *data, std::size_t count) override |
| Writes count double values from array pointed by data. | |
| int | write (const char *data, std::size_t count) override |
| Writes count char values from array pointed by data. | |
| int | write (bool data) override |
| Writes a bool value. | |
| int | read (int *data, std::size_t count) override |
| Reads count integer values into array pointed by data. | |
| int | read (long *data, std::size_t count) override |
| Reads count long values into array pointed by data. | |
| int | read (unsigned long *data, std::size_t count) override |
| Reads count unsigned long values into array pointed by data. | |
| int | read (double *data, std::size_t count) override |
| Reads count double values into array pointed by data. | |
| int | read (char *data, std::size_t count) override |
| Reads count char values into array pointed by data. | |
| int | read (bool &data) override |
| Reads a bool value from data. | |
| void | initSendBuff () |
| Initializes send buffer to empty state. All packed data are lost. | |
| void | initRecvBuff () |
| Initializes send buffer to empty state. All packed data are lost. | |
| void | init () |
| Initializes receiver buffers. | |
| void | initForPacking () |
| Initialize for packing. | |
| void | initForUnpacking () |
| Initialize for Unpacking (data already received). | |
| int | initExchange (int rank, int tag) |
| int | initSend (int rank, int tag) |
| int | initReceive (int rank, int tag) |
| void | clearBuffers () |
| void | resizeSendBuffer (std::size_t size) |
| void | resizeReceiveBuffer (std::size_t size) |
| 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*). | |
| int | write (const char *data) |
| Writes a string (wrapper needed, otherwise write(bool) is called ). | |
| 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*). | |
Methods for manipulating/testing receiver state | |
| int | sendCompleted () |
| int | receiveCompleted () |
| int | testCompletion () |
| int | waitCompletion () |
| CommunicationBuffer & | giveSendBuff () |
| CommunicationBuffer & | giveRecvBuff () |
| Public Member Functions inherited from oofem::DataStream | |
| virtual | ~DataStream () |
| Destructor. | |
| 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*). | |
| 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*). | |
| int | write (const char *data) |
| Writes a string (wrapper needed, otherwise write(bool) is called ). | |
Protected Attributes | |
| std::unique_ptr< CommunicationBuffer > | send_buff |
| Send buffer. | |
| std::unique_ptr< CommunicationBuffer > | recv_buff |
| Receive buffer. | |
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 66 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.
|
inline |
Clears all buffer contents.
Definition at line 150 of file processcomm.h.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inline |
Returns receive buffer of receiver.
Definition at line 170 of file processcomm.h.
References recv_buff.
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 166 of file processcomm.h.
References send_buff.
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 106 of file processcomm.h.
References initRecvBuff(), and initSendBuff().
|
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 123 of file processcomm.h.
References initReceive(), and initSend().
|
inline |
|
inline |
Initialize for Unpacking (data already received).
Definition at line 114 of file processcomm.h.
References recv_buff.
|
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 145 of file processcomm.h.
References recv_buff.
Referenced by initExchange().
|
inline |
Initializes send buffer to empty state. All packed data are lost.
Definition at line 104 of file processcomm.h.
References recv_buff.
Referenced by init().
|
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 137 of file processcomm.h.
References send_buff.
Referenced by initExchange().
|
inline |
Initializes send buffer to empty state. All packed data are lost.
Definition at line 102 of file processcomm.h.
References send_buff.
Referenced by init().
|
inlineoverridevirtual |
Reads a bool value from data.
Implements oofem::DataStream.
Definition at line 99 of file processcomm.h.
References recv_buff.
|
inline |
Definition at line 85 of file datastream.h.
|
inlineoverridevirtual |
Reads count char values into array pointed by data.
Implements oofem::DataStream.
Definition at line 98 of file processcomm.h.
|
inline |
Definition at line 82 of file datastream.h.
|
inlineoverridevirtual |
Reads count double values into array pointed by data.
Implements oofem::DataStream.
Definition at line 97 of file processcomm.h.
|
inline |
Definition at line 68 of file datastream.h.
|
inlineoverridevirtual |
Reads count integer values into array pointed by data.
Implements oofem::DataStream.
Definition at line 94 of file processcomm.h.
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::SPRNodalRecoveryModel::unpackSharedDofManData(), oofem::ZZNodalRecoveryModel::unpackSharedDofManData(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalIndicatorVals(), oofem::Subdivision::unpackSharedEdges(), and oofem::Subdivision::unpackSharedIrregulars().
|
inline |
Definition at line 79 of file datastream.h.
|
inlineoverridevirtual |
Reads count long values into array pointed by data.
Implements oofem::DataStream.
Definition at line 95 of file processcomm.h.
| int oofem::DataStream::read | ( | std ::string & | data | ) |
Reads a string (stored as an int for the length followed by char*).
Definition at line 89 of file datastream.C.
|
inline |
Definition at line 71 of file datastream.h.
|
inlineoverridevirtual |
Reads count unsigned long values into array pointed by data.
Implements oofem::DataStream.
Definition at line 96 of file processcomm.h.
|
inline |
Definition at line 158 of file processcomm.h.
References recv_buff.
|
inline |
Definition at line 153 of file processcomm.h.
References recv_buff.
|
inline |
Definition at line 152 of file processcomm.h.
References send_buff.
|
inline |
Definition at line 157 of file processcomm.h.
References send_buff.
|
inline |
Definition at line 159 of file processcomm.h.
|
inline |
Definition at line 160 of file processcomm.h.
|
inlineoverridevirtual |
Writes a bool value.
Implements oofem::DataStream.
Definition at line 91 of file processcomm.h.
References send_buff.
|
inline |
Definition at line 117 of file datastream.h.
|
inline |
Writes a string (wrapper needed, otherwise write(bool) is called ).
Definition at line 123 of file datastream.h.
|
inlineoverridevirtual |
Writes count char values from array pointed by data.
Implements oofem::DataStream.
Definition at line 90 of file processcomm.h.
References send_buff.
|
inlineoverridevirtual |
Writes count double values from array pointed by data.
Implements oofem::DataStream.
Definition at line 89 of file processcomm.h.
References send_buff.
|
inlineoverridevirtual |
Writes count integer values from array pointed by data.
Implements oofem::DataStream.
Definition at line 86 of file processcomm.h.
References send_buff.
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::SPRNodalRecoveryModel::packSharedDofManData(), oofem::ZZNodalRecoveryModel::packSharedDofManData(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalIndicatorVals(), oofem::Subdivision::packSharedEdges(), and oofem::Subdivision::packSharedIrregulars().
|
inlineoverridevirtual |
Writes count long values from array pointed by data.
Implements oofem::DataStream.
Definition at line 87 of file processcomm.h.
References send_buff.
| int oofem::DataStream::write | ( | const std ::string & | data | ) |
Reads a string (stored as an int for the length followed by char*).
Definition at line 121 of file datastream.C.
|
inlineoverridevirtual |
Writes count unsigned long values from array pointed by data.
Implements oofem::DataStream.
Definition at line 88 of file processcomm.h.
References send_buff.
|
inline |
Definition at line 114 of file datastream.h.
|
inline |
Definition at line 100 of file datastream.h.
|
inline |
Definition at line 111 of file datastream.h.
|
inline |
Definition at line 103 of file datastream.h.
|
protected |
Receive buffer.
Definition at line 72 of file processcomm.h.
Referenced by giveRecvBuff(), initForUnpacking(), initReceive(), initRecvBuff(), ProcessCommunicatorBuff(), read(), receiveCompleted(), resizeReceiveBuffer(), testCompletion(), and waitCompletion().
|
protected |
Send buffer.
Definition at line 70 of file processcomm.h.
Referenced by givePackSizeOfBool(), givePackSizeOfChar(), givePackSizeOfDouble(), givePackSizeOfInt(), givePackSizeOfLong(), givePackSizeOfSizet(), giveSendBuff(), initForPacking(), initSend(), initSendBuff(), ProcessCommunicatorBuff(), resizeSendBuffer(), sendCompleted(), testCompletion(), waitCompletion(), write(), write(), write(), write(), write(), and write().