|
OOFEM 3.0
|
#include <processcomm.h>
Public Member Functions | |
| ProcessCommunicator (ProcessCommunicatorBuff *b, int irank, CommunicatorMode m=CommMode_Static) | |
| int | giveRank () |
| ProcessCommunicatorBuff * | giveProcessCommunicatorBuff () |
| Returns communication buffer. | |
| const IntArray & | giveToSendMap () |
| const IntArray & | giveToRecvMap () |
| template<class T> | |
| void | setToSendArry (T *emodel, const IntArray &src, int packUnpackType) |
| template<class T> | |
| void | setToRecvArry (T *emodel, const IntArray &src, int packUnpackType) |
| template<class T> | |
| int | packData (T *emodel, int(T ::*packFunc)(ProcessCommunicator &)) |
| template<class T, class P> | |
| int | packData (T *emodel, P *src, int(T ::*packFunc)(P *, ProcessCommunicator &)) |
| template<class T> | |
| int | unpackData (T *emodel, int(T ::*unpackFunc)(ProcessCommunicator &)) |
| template<class T, class P> | |
| int | unpackData (T *emodel, P *dest, int(T ::*unpackFunc)(P *, ProcessCommunicator &)) |
| int | initExchange (int tag) |
| int | initSend (int tag) |
| int | initReceive (int tag) |
| int | finishExchange () |
| Finishes the exchange. After this call all communication buffers can be reused. | |
Protected Attributes | |
| int | rank |
| Associated partition (problem) number (rank). | |
| ProcessCommunicatorBuff * | pcBuffer |
| Communicator buffers representation. | |
| IntArray | toSend |
| Nodes to send. | |
| IntArray | toReceive |
| Nodes to receive. | |
| CommunicatorMode | mode |
| Mode. | |
Methods for manipulating/testing receiver state | |
| int | sendCompleted () |
| int | receiveCompleted () |
| int | testCompletion () |
| int | waitCompletion () |
| void | clearBuffers () |
| Clears all buffer contents. | |
| template<class T> | |
| int | resizeSendBuff (T *emodel, int packUnpackType) |
| template<class T> | |
| int | resizeRecvBuff (T *emodel, int packUnpackType) |
Class representing process communicator for engineering model. Process communicator provides all services for communication with associated remote process (problem or task).
Definition at line 179 of file processcomm.h.
| oofem::ProcessCommunicator::ProcessCommunicator | ( | ProcessCommunicatorBuff * | b, |
| int | irank, | ||
| CommunicatorMode | m = CommMode_Static ) |
Constructor. Creates new problem (partition) communicator associated to partition with number (rank) irank.
| b | ProcessCommunicatorBuff to use. |
| irank | Rank of associated partition. |
| m | Mode of communicator. |
Definition at line 57 of file processcomm.C.
References mode, pcBuffer, rank, toReceive, and toSend.
Referenced by packData(), packData(), unpackData(), and unpackData().
| void oofem::ProcessCommunicator::clearBuffers | ( | ) |
Clears all buffer contents.
Definition at line 113 of file processcomm.C.
References giveProcessCommunicatorBuff().
| int oofem::ProcessCommunicator::finishExchange | ( | ) |
Finishes the exchange. After this call all communication buffers can be reused.
Definition at line 107 of file processcomm.C.
References waitCompletion().
|
inline |
Returns communication buffer.
Definition at line 211 of file processcomm.h.
References OOFEM_ERROR, and pcBuffer.
Referenced by clearBuffers(), initReceive(), initSend(), oofem::FETISolver::masterUnpackQQProduct(), oofem::FETISolver::masterUnpackRBM(), packData(), packData(), oofem::FETISolver::packDirectionVector(), oofem::EngngModel::packDofManagers(), oofem::FETISolver::packGammas(), oofem::Subdivision::packIrregularSharedGlobnums(), oofem::LoadBalancer::packMigratingData(), oofem::NonlocalMaterialWTP::packMigratingElementDependencies(), oofem::FETISolver::packPPVector(), oofem::FETISolver::packQQProducts(), oofem::FETISolver::packRBM(), oofem::EngngModel::packRemoteElementData(), oofem::NonlocalMaterialWTP::packRemoteElements(), oofem::Subdivision::packRemoteElements(), oofem::FETISolver::packResiduals(), oofem::ParmetisLoadBalancer::packSharedDmanPartitions(), oofem::NodalAveragingRecoveryModel::packSharedDofManData(), oofem::SPRNodalRecoveryModel::packSharedDofManData(), oofem::ZZNodalRecoveryModel::packSharedDofManData(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalIndicatorVals(), oofem::Subdivision::packSharedEdges(), oofem::Subdivision::packSharedIrregulars(), oofem::FETISolver::packSolution(), receiveCompleted(), resizeRecvBuff(), resizeSendBuff(), sendCompleted(), unpackData(), unpackData(), oofem::FETISolver::unpackDirectionVector(), oofem::EngngModel::unpackDofManagers(), oofem::FETISolver::unpackGammas(), oofem::Subdivision::unpackIrregularSharedGlobnums(), oofem::LoadBalancer::unpackMigratingData(), oofem::NonlocalMaterialWTP::unpackMigratingElementDependencies(), oofem::FETISolver::unpackPPVector(), oofem::EngngModel::unpackRemoteElementData(), oofem::NonlocalMaterialWTP::unpackRemoteElements(), oofem::Subdivision::unpackRemoteElements(), oofem::FETISolver::unpackResiduals(), oofem::ParmetisLoadBalancer::unpackSharedDmanPartitions(), oofem::NodalAveragingRecoveryModel::unpackSharedDofManData(), oofem::SPRNodalRecoveryModel::unpackSharedDofManData(), oofem::ZZNodalRecoveryModel::unpackSharedDofManData(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalIndicatorVals(), oofem::Subdivision::unpackSharedEdges(), oofem::Subdivision::unpackSharedIrregulars(), and oofem::FETISolver::unpackSolution().
|
inline |
Returns corresponding rank of associated partition
Definition at line 208 of file processcomm.h.
References rank.
Referenced by oofem::FETISolver::masterUnpackQQProduct(), oofem::FETISolver::masterUnpackRBM(), oofem::FETISolver::packDirectionVector(), oofem::FETISolver::packGammas(), oofem::Subdivision::packIrregularSharedGlobnums(), oofem::LoadBalancer::packMigratingData(), oofem::NonlocalMaterialWTP::packMigratingElementDependencies(), oofem::NonlocalMaterialWTP::packRemoteElements(), oofem::Subdivision::packRemoteElements(), oofem::ParmetisLoadBalancer::packSharedDmanPartitions(), oofem::Subdivision::packSharedEdges(), oofem::Subdivision::packSharedIrregulars(), oofem::FETISolver::packSolution(), oofem::Subdivision::unpackIrregularSharedGlobnums(), oofem::LoadBalancer::unpackMigratingData(), oofem::NonlocalMaterialWTP::unpackMigratingElementDependencies(), oofem::FETISolver::unpackPPVector(), oofem::NonlocalMaterialWTP::unpackRemoteElements(), oofem::Subdivision::unpackRemoteElements(), oofem::FETISolver::unpackResiduals(), oofem::ParmetisLoadBalancer::unpackSharedDmanPartitions(), oofem::Subdivision::unpackSharedEdges(), and oofem::Subdivision::unpackSharedIrregulars().
|
inline |
Returns receiver to receive map.
Definition at line 228 of file processcomm.h.
References toReceive.
Referenced by oofem::FETISolver::masterUnpackRBM(), oofem::FETISolver::unpackDirectionVector(), oofem::EngngModel::unpackDofManagers(), oofem::FETISolver::unpackPPVector(), oofem::EngngModel::unpackRemoteElementData(), oofem::FETISolver::unpackResiduals(), oofem::NodalAveragingRecoveryModel::unpackSharedDofManData(), oofem::SPRNodalRecoveryModel::unpackSharedDofManData(), oofem::ZZNodalRecoveryModel::unpackSharedDofManData(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::unpackSharedDofManLocalIndicatorVals(), and oofem::FETISolver::unpackSolution().
|
inline |
Returns receiver to send map.
Definition at line 224 of file processcomm.h.
References toSend.
Referenced by oofem::FETISolver::packDirectionVector(), oofem::EngngModel::packDofManagers(), oofem::FETISolver::packPPVector(), oofem::FETISolver::packRBM(), oofem::EngngModel::packRemoteElementData(), oofem::Subdivision::packRemoteElements(), oofem::FETISolver::packResiduals(), oofem::NodalAveragingRecoveryModel::packSharedDofManData(), oofem::SPRNodalRecoveryModel::packSharedDofManData(), oofem::ZZNodalRecoveryModel::packSharedDofManData(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalDensities(), oofem::DirectErrorIndicatorRC::packSharedDofManLocalIndicatorVals(), and oofem::FETISolver::packSolution().
| int oofem::ProcessCommunicator::initExchange | ( | int | tag | ) |
Initializes data exchange with associated problem. if send or receive pool is empty, the send or receive communication is not performed.
| tag | Message tag. |
Definition at line 97 of file processcomm.C.
References initReceive(), and initSend().
| int oofem::ProcessCommunicator::initReceive | ( | int | tag | ) |
Initialize the receive data exchange with associate problem. if receive pool is empty, the receive communication is not performed.
| tag | Message tag. |
Definition at line 82 of file processcomm.C.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), rank, and toReceive.
Referenced by initExchange().
| int oofem::ProcessCommunicator::initSend | ( | int | tag | ) |
Initialize the send data exchange with associate problem. if send pool is empty, the send communication is not performed.
| tag | Message tag. |
Definition at line 67 of file processcomm.C.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), rank, and toSend.
Referenced by initExchange().
|
inline |
Pack nodal data to send buff.
| emodel | Engineering model to pack. |
| packFunc | Function used to pack nodal data in to buffer. It uses toSend array to loop over required nodes. |
Definition at line 260 of file processcomm.h.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), ProcessCommunicator(), and toSend.
|
inline |
Pack nodal data to send buff.
| emodel | Engineering model to pack. |
| src | Source to pack from. |
| packFunc | Function used to pack nodal data in to buffer. It uses toSend array to loop over required nodes. |
Definition at line 277 of file processcomm.h.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), ProcessCommunicator(), and toSend.
| int oofem::ProcessCommunicator::receiveCompleted | ( | ) |
Definition at line 129 of file processcomm.C.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), and toReceive.
Referenced by testCompletion().
|
private |
Resizes receive buffer to needs according to toRecv array. Current implementation uses EngngModel::estimateMaxPackSize function, sending toSend map as parameter.
| emodel | Current engngModel. |
| packUnpackType | Determines the type of packed quantity, used by emodel estimateMaxPackSize service to estimate the size of pack/unpack buffer accordingly. |
Definition at line 411 of file processcomm.h.
References giveProcessCommunicatorBuff(), and toReceive.
Referenced by setToRecvArry().
|
private |
Resizes send buffer to needs according to toSend array. Current implementation uses EngngModel::estimateMaxPackSize function, sending toSend map as parameter.
| emodel | Current engngModel. |
| packUnpackType | Determines the type of packed quantity, used by emodel estimateMaxPackSize service to estimate the size of pack/unpack buffer accordingly. |
Definition at line 399 of file processcomm.h.
References giveProcessCommunicatorBuff(), and toSend.
Referenced by setToSendArry().
| int oofem::ProcessCommunicator::sendCompleted | ( | ) |
Definition at line 119 of file processcomm.C.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), and toSend.
Referenced by testCompletion().
| void oofem::ProcessCommunicator::setToRecvArry | ( | T * | emodel, |
| const IntArray & | src, | ||
| int | packUnpackType ) |
Sets receiver toRecv array to src. The method assumes that toRecv array is sorted according to global number associated to corresponding components given in src array. THis is necessary to ensure proper pack/unpack order on local and remote problem. Recv buff is resized to hold all necessary data.
| emodel | Engng model. |
| src | Source of toRecv array. |
| packUnpackType | Determines the type of packed quantity, used by emodel estimateMaxPackSize service to estimate the size of pack/unpack buffer accordingly. |
Definition at line 389 of file processcomm.h.
References resizeRecvBuff(), and toReceive.
Referenced by oofem::ElementCommunicator::setProcessCommunicatorToRecvArry(), and oofem::NodeCommunicator::setProcessCommunicatorToRecvArry().
| void oofem::ProcessCommunicator::setToSendArry | ( | T * | emodel, |
| const IntArray & | src, | ||
| int | packUnpackType ) |
Sets receiver toSend array to src. The method assumes that toSend array is sorted according to global number associated to corresponding components given in src array. THis is necessary to ensure proper pack/unpack order on local and remote problem. Send buff is resized to hold all necessary data.
| emodel | Engng model. |
| src | Source of toSend array. |
| packUnpackType | Determines the type of packed quantity, used by emodel estimateMaxPackSize service to estimate the size of pack/unpack buffer accordingly. |
Definition at line 379 of file processcomm.h.
References resizeSendBuff(), and toSend.
Referenced by oofem::ElementCommunicator::setProcessCommunicatorToSendArry(), and oofem::NodeCommunicator::setProcessCommunicatorToSendArry().
| int oofem::ProcessCommunicator::testCompletion | ( | ) |
Definition at line 139 of file processcomm.C.
References receiveCompleted(), and sendCompleted().
Referenced by waitCompletion().
|
inline |
Unpack nodal data from recv buff.
| emodel | Engineering model to unpack from. |
| unpackFunc | Function used to unpack nodal data from buffer. It uses toRecv array to loop over required nodes. |
Definition at line 293 of file processcomm.h.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), ProcessCommunicator(), and toReceive.
|
inline |
Unpack nodal data from recv buff.
| emodel | Engineering model to unpack from. |
| dest | Destination. |
| unpackFunc | Function used to unpack nodal data from buffer. It uses toRecv array to loop over required nodes. |
Definition at line 310 of file processcomm.h.
References oofem::CommMode_Dynamic, giveProcessCommunicatorBuff(), ProcessCommunicator(), and toReceive.
| int oofem::ProcessCommunicator::waitCompletion | ( | ) |
Definition at line 145 of file processcomm.C.
References testCompletion().
Referenced by finishExchange().
|
protected |
|
protected |
Communicator buffers representation.
Definition at line 186 of file processcomm.h.
Referenced by giveProcessCommunicatorBuff(), and ProcessCommunicator().
|
protected |
Associated partition (problem) number (rank).
Definition at line 183 of file processcomm.h.
Referenced by giveRank(), initReceive(), initSend(), and ProcessCommunicator().
|
protected |
Nodes to receive.
Definition at line 191 of file processcomm.h.
Referenced by giveToRecvMap(), initReceive(), ProcessCommunicator(), receiveCompleted(), resizeRecvBuff(), setToRecvArry(), unpackData(), and unpackData().
|
protected |
Nodes to send.
Definition at line 189 of file processcomm.h.
Referenced by giveToSendMap(), initSend(), packData(), packData(), ProcessCommunicator(), resizeSendBuff(), sendCompleted(), and setToSendArry().