|
OOFEM 3.0
|
#include <communicator.h>
Public Member Functions | |
| Communicator (EngngModel *emodel, CommunicatorBuff *buff, int rank, int size, CommunicatorMode mode=CommMode_Static) | |
| virtual | ~Communicator () |
| Destructor. | |
| ProcessCommunicator * | giveProcessCommunicator (int i) |
| template<class T> | |
| int | packAllData (T *ptr, int(T ::*packFunc)(ProcessCommunicator &)) |
| template<class T, class P> | |
| int | packAllData (T *ptr, P *src, int(T ::*packFunc)(P *, ProcessCommunicator &)) |
| template<class T> | |
| int | unpackAllData (T *ptr, int(T ::*unpackFunc)(ProcessCommunicator &)) |
| template<class T, class P> | |
| int | unpackAllData (T *ptr, P *src, int(T ::*unpackFunc)(P *, ProcessCommunicator &)) |
| int | initExchange (int tag) |
| int | initSend (int tag) |
| int | initReceive (int tag) |
| int | finishExchange () |
| void | clearBuffers () |
| virtual void | setUpCommunicationMaps (EngngModel *pm) |
| std::string | errorInfo (const char *func) const |
| Returns string for prepending output (used by error reporting macros). | |
Protected Attributes | |
| int | rank |
| Rank of process. | |
| std::vector< ProcessCommunicator > | processComms |
| Array of process communicators. | |
| EngngModel * | engngModel |
| Engineering model. | |
| CommunicatorMode | mode |
| Mode. | |
Class representing communicator. It is usually attribute of an engineering model. Problem communicator provides all services for communication with associated remote problems. It manages several process (task) communicators.
The communicator mode determines the communication:
(Static) The mode can be static, meaning that each node can assemble its communication maps independently (or by independent communication). This implies that the size of communication buffers is known in advance. Also if no data are planned to send to remote node, there is no communication with this node (both sender and receiver know that there will be no data to send).
(Dynamic) In this case the communication pattern and the amount of data sent between nodes is not known in advance. This requires to use dynamic (packeted) buffering.
Definition at line 99 of file communicator.h.
| oofem::Communicator::Communicator | ( | EngngModel * | emodel, |
| CommunicatorBuff * | buff, | ||
| int | rank, | ||
| int | size, | ||
| CommunicatorMode | mode = CommMode_Static ) |
Constructor. Creates new communicator associated to partition with number (rank) irank.
| emodel | Associated engineering model. |
| buff | Communicator buffer. |
| rank | Rank of associated partition. |
| size | Number of collaborating processes. |
| mode | Communicator mode. |
Definition at line 55 of file communicator.C.
References engngModel, oofem::CommunicatorBuff::giveProcessCommunicatorBuff(), mode, processComms, and rank.
Referenced by oofem::FETICommunicator::FETICommunicator(), and oofem::ProblemCommunicator::ProblemCommunicator().
|
inlinevirtual |
Destructor.
Definition at line 123 of file communicator.h.
| void oofem::Communicator::clearBuffers | ( | ) |
| std::string oofem::Communicator::errorInfo | ( | const char * | func | ) | const |
Returns string for prepending output (used by error reporting macros).
Definition at line 122 of file communicator.C.
References rank.
| int oofem::Communicator::finishExchange | ( | ) |
Finishes the exchange. After this call all communication buffers can be reused.
Definition at line 79 of file communicator.C.
References processComms.
Referenced by oofem::Subdivision::assignGlobalNumbersToSharedIrregulars(), oofem::Subdivision::exchangeRemoteElements(), oofem::Subdivision::exchangeSharedEdges(), oofem::Subdivision::exchangeSharedIrregulars(), oofem::NonlocalMaterialWTP::init(), oofem::ParmetisLoadBalancer::labelDofManagers(), oofem::NonlocalMaterialWTP::migrate(), and oofem::LoadBalancer::migrateLoad().
|
inline |
Returns i-th problem communicator. The problems are numbered from rank 0.
| i | Problem communicator index [0..size-1]. |
Definition at line 131 of file communicator.h.
Referenced by oofem::Subdivision::packRemoteElements(), oofem::ElementCommunicator::setUpCommunicationMaps(), oofem::FETICommunicator::setUpCommunicationMaps(), and oofem::NodeCommunicator::setUpCommunicationMaps().
| int oofem::Communicator::initExchange | ( | int | tag | ) |
Initializes data exchange with all problems. if send or receive pool is empty, communication is not performed.
| tag | message tag |
Definition at line 68 of file communicator.C.
References processComms.
Referenced by oofem::Subdivision::assignGlobalNumbersToSharedIrregulars(), oofem::Subdivision::exchangeRemoteElements(), oofem::Subdivision::exchangeSharedEdges(), oofem::Subdivision::exchangeSharedIrregulars(), oofem::NonlocalMaterialWTP::init(), oofem::ParmetisLoadBalancer::labelDofManagers(), oofem::NonlocalMaterialWTP::migrate(), and oofem::LoadBalancer::migrateLoad().
| int oofem::Communicator::initReceive | ( | int | tag | ) |
Initializes data receive exchange with all problems. if receive pool is empty, communication is not performed.
| tag | Message tag. |
Definition at line 103 of file communicator.C.
References processComms.
| int oofem::Communicator::initSend | ( | int | tag | ) |
Initializes data send exchange with all problems. if send pool is empty, communication is not performed.
| tag | Message tag. |
Definition at line 92 of file communicator.C.
References processComms.
| int oofem::Communicator::packAllData | ( | T * | ptr, |
| int(T ::* | packFunc )(ProcessCommunicator &) ) |
Pack all problemCommunicators data to their send buffers.
| ptr | Pointer problem communicator. |
| packFunc | Function used to pack nodal data in to buffer. |
Definition at line 211 of file communicator.h.
References processComms.
Referenced by oofem::Subdivision::assignGlobalNumbersToSharedIrregulars(), oofem::Subdivision::exchangeRemoteElements(), oofem::Subdivision::exchangeSharedEdges(), oofem::Subdivision::exchangeSharedIrregulars(), oofem::NonlocalMaterialWTP::init(), oofem::ParmetisLoadBalancer::labelDofManagers(), oofem::NonlocalMaterialWTP::migrate(), and oofem::LoadBalancer::migrateLoad().
| int oofem::Communicator::packAllData | ( | T * | ptr, |
| P * | src, | ||
| int(T ::* | packFunc )(P *, ProcessCommunicator &) ) |
Pack all problemCommuncators data to their send buffers.
| ptr | Pointer problem communicator. |
| src | Pointer to source. |
| packFunc | Function used to pack nodal data in to buffer. |
Definition at line 234 of file communicator.h.
|
inlinevirtual |
Service for setting up the communication patterns with other remote processes. Sets up the toSend and toRecv attributes in associated problem communicators.
| pm | Engineering model to use for setup. |
Reimplemented in oofem::FETICommunicator.
Definition at line 204 of file communicator.h.
| int oofem::Communicator::unpackAllData | ( | T * | ptr, |
| int(T ::* | unpackFunc )(ProcessCommunicator &) ) |
Unpack all problemCommuncators data from recv buffers. Waits until receive completion before unpacking buffer.
| ptr | Pointer problem communicator. |
| unpackFunc | Function used to unpack nodal data from buffer. |
Definition at line 246 of file communicator.h.
References oofem::CommMode_Dynamic, OOFEM_LOG_DEBUG, processComms, rank, and VERBOSEPARALLEL_PRINT.
Referenced by oofem::Subdivision::assignGlobalNumbersToSharedIrregulars(), oofem::Subdivision::exchangeRemoteElements(), oofem::Subdivision::exchangeSharedEdges(), oofem::Subdivision::exchangeSharedIrregulars(), oofem::NonlocalMaterialWTP::init(), oofem::ParmetisLoadBalancer::labelDofManagers(), oofem::NonlocalMaterialWTP::migrate(), and oofem::LoadBalancer::migrateLoad().
| int oofem::Communicator::unpackAllData | ( | T * | ptr, |
| P * | src, | ||
| int(T ::* | unpackFunc )(P *, ProcessCommunicator &) ) |
Unpack all problemCommuncators data from recv buffers. Waits until receive completion before unpacking buffer.
| ptr | Pointer problem communicator. |
| src | Pointer to source. |
| unpackFunc | Function used to unpack nodal data from buffer. |
Definition at line 357 of file communicator.h.
References oofem::CommMode_Dynamic, OOFEM_LOG_DEBUG, processComms, rank, and VERBOSEPARALLEL_PRINT.
|
protected |
Engineering model.
Definition at line 107 of file communicator.h.
Referenced by Communicator(), oofem::ProblemCommunicator::DofManCmp(), oofem::ProblemCommunicator::ElemCmp(), oofem::ElementCommunicator::setProcessCommunicatorToRecvArry(), oofem::NodeCommunicator::setProcessCommunicatorToRecvArry(), oofem::ElementCommunicator::setProcessCommunicatorToSendArry(), oofem::NodeCommunicator::setProcessCommunicatorToSendArry(), and oofem::FETICommunicator::setUpCommunicationMaps().
|
protected |
|
protected |
Array of process communicators.
Definition at line 105 of file communicator.h.
Referenced by clearBuffers(), Communicator(), finishExchange(), initExchange(), initReceive(), initSend(), packAllData(), oofem::ElementCommunicator::setUpCommunicationMaps(), oofem::FETICommunicator::setUpCommunicationMaps(), oofem::NodeCommunicator::setUpCommunicationMaps(), unpackAllData(), and unpackAllData().
|
protected |
Rank of process.
Definition at line 103 of file communicator.h.
Referenced by Communicator(), oofem::ElementCommunicator::ElementCommunicator(), errorInfo(), oofem::FETICommunicator::FETICommunicator(), oofem::NodeCommunicator::NodeCommunicator(), oofem::ProblemCommunicator::ProblemCommunicator(), oofem::ElementCommunicator::setUpCommunicationMaps(), oofem::FETICommunicator::setUpCommunicationMaps(), oofem::NodeCommunicator::setUpCommunicationMaps(), unpackAllData(), and unpackAllData().