OOFEM  2.1
Public Member Functions | Protected Attributes | Private Member Functions
oofem::ProblemCommunicator Class Reference

Class representing communicator for engng model. More...

#include <problemcomm.h>

+ Inheritance diagram for oofem::ProblemCommunicator:
+ Collaboration diagram for oofem::ProblemCommunicator:

List of all members.

Public Member Functions

 ProblemCommunicator (EngngModel *emodel, CommunicatorBuff *b, int rank, int size, ProblemCommunicatorMode mode)
 Constructor.
virtual ~ProblemCommunicator ()
 Destructor.
void setUpCommunicationMaps (EngngModel *emodel, bool excludeSelfCommFlag, bool forceReinit=false)
 Service for setting up the communication patterns with other remote process.
int setProcessCommunicatorToSendArry (ProcessCommunicator *processComm, IntArray &map)
 Assigns given map to given process communicator.
int setProcessCommunicatorToRecvArry (ProcessCommunicator *processComm, IntArray &map)
 Assigns given map to given process communicator.

Protected Attributes

ProblemCommunicatorMode mode
 Mode.
bool initialized

Private Member Functions

void sortCommMap (IntArray &map, int(ProblemCommunicator::*cmp)(int, int))
 Sorts given communication map, containing local DofManager numbers according to their corresponding global numbers.
void quickSortCommMap (IntArray &map, int l, int r, int(ProblemCommunicator::*cmp)(int, int))
 Implementation of quicksort algorithm.
int quickSortPartition (IntArray &map, int l, int r, int(ProblemCommunicator::*cmp)(int, int))
 Partitioning used in quicksort.
int DofManCmp (int, int)
 Global dofManager number comparison function.
int ElemCmp (int, int)
 Global element comparison function.
void setUpCommunicationMapsForNodeCut (EngngModel *emodel, bool excludeSelfCommFlag)
 Service for setting up the receiver for node cut communication patterns with other remote process.
void setUpCommunicationMapsForElementCut (EngngModel *emodel, bool excludeSelfCommFlag)
 Service for setting up the receiver for element cut communication patterns with other remote process.
void setUpCommunicationMapsForRemoteElementMode (EngngModel *emodel, bool excludeSelfCommFlag)
 Service for setting up the receiver for remote element communication patterns with other remote process.

Detailed Description

Class representing communicator for engng model.

It is assumed to be an attribute of an engineering model. The communicator provides all services for communication with associated remote partitions. It manages several process communicators.

Definition at line 52 of file problemcomm.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
emodelAssociated engineering model.
bBuffer object.
rankRank of associated partition.
sizeNumber of collaborating processes.
modeCommunicator mode.

Definition at line 47 of file problemcomm.C.

References initialized, and mode.

Destructor.

Definition at line 56 of file problemcomm.C.


Member Function Documentation

int oofem::ProblemCommunicator::DofManCmp ( int  i,
int  j 
) [private]
int oofem::ProblemCommunicator::ElemCmp ( int  i,
int  j 
) [private]
void oofem::ProblemCommunicator::quickSortCommMap ( IntArray map,
int  l,
int  r,
int(ProblemCommunicator::*)(int, int)  cmp 
) [private]

Implementation of quicksort algorithm.

Definition at line 953 of file problemcomm.C.

References quickSortPartition().

Referenced by sortCommMap().

int oofem::ProblemCommunicator::quickSortPartition ( IntArray map,
int  l,
int  r,
int(ProblemCommunicator::*)(int, int)  cmp 
) [private]

Partitioning used in quicksort.

Definition at line 968 of file problemcomm.C.

References oofem::IntArray::at().

Referenced by quickSortCommMap().

Assigns given map to given process communicator.

Sorts map according to global entity (dofmanagers or element) numbers to ensure, that local and corresponding remote process have the identical map with same ordering. This will ensure proper packing/unpacking order. The corresponding processCommunicator buffer takes care about resizing itself accordingly to hold all outgoing/incoming data using engngModel->estimateMaxPackSize service.

Parameters:
processCommProcess comm which received map will be set.
mapReceived map.

Definition at line 928 of file problemcomm.C.

References _error, DofManCmp(), ElemCmp(), oofem::Communicator::engngModel, mode, oofem::ProblemCommMode__ELEMENT_CUT, oofem::ProblemCommMode__NODE_CUT, oofem::ProblemCommMode__REMOTE_ELEMENT_MODE, oofem::ProcessCommunicator::setToRecvArry(), and sortCommMap().

Referenced by setUpCommunicationMapsForElementCut(), setUpCommunicationMapsForNodeCut(), and setUpCommunicationMapsForRemoteElementMode().

Assigns given map to given process communicator.

Sorts map according to global entity (dofmanagers or element) numbers to ensure, that local and corresponding remote process have the identical map with same ordering. This will ensure proper packing/unpacking order. The corresponding processCommunicator buffer takes care about resizing itself accordingly to hold all outgoing/incoming data using engngModel->estimateMaxPackSize service.

Parameters:
processCommDomain comm which send map will be set.
mapSend map.

Definition at line 912 of file problemcomm.C.

References _error, DofManCmp(), ElemCmp(), oofem::Communicator::engngModel, mode, oofem::ProblemCommMode__ELEMENT_CUT, oofem::ProblemCommMode__NODE_CUT, oofem::ProblemCommMode__REMOTE_ELEMENT_MODE, oofem::ProcessCommunicator::setToSendArry(), and sortCommMap().

Referenced by setUpCommunicationMapsForElementCut(), setUpCommunicationMapsForNodeCut(), and setUpCommunicationMapsForRemoteElementMode().

void oofem::ProblemCommunicator::setUpCommunicationMaps ( EngngModel emodel,
bool  excludeSelfCommFlag,
bool  forceReinit = false 
)

Service for setting up the communication patterns with other remote process.

Sets up the toSend and toRecv attributes in associated process communicators.

Parameters:
emodelAssociated engineering model.
excludeSelfCommFlagIf set to true, the communication map of receiver with itself will be forced to be empty, otherwise it will be assembled.
forceReinitForces reinitilaization.

Definition at line 582 of file problemcomm.C.

References _error, initialized, mode, oofem::ProblemCommMode__ELEMENT_CUT, oofem::ProblemCommMode__NODE_CUT, oofem::ProblemCommMode__REMOTE_ELEMENT_MODE, oofem::Communicator::rank, setUpCommunicationMapsForElementCut(), setUpCommunicationMapsForNodeCut(), setUpCommunicationMapsForRemoteElementMode(), and VERBOSEPARALLEL_PRINT.

Referenced by oofem::DirectErrorIndicatorRC::estimateMeshDensities(), oofem::NonLinearDynamic::initializeCommMaps(), oofem::EngngModel::initializeCommMaps(), oofem::LinearStatic::solveYourself(), and oofem::NlDEIDynamic::solveYourself().

void oofem::ProblemCommunicator::setUpCommunicationMapsForElementCut ( EngngModel emodel,
bool  excludeSelfCommFlag 
) [private]
void oofem::ProblemCommunicator::setUpCommunicationMapsForNodeCut ( EngngModel emodel,
bool  excludeSelfCommFlag 
) [private]

Service for setting up the receiver for node cut communication patterns with other remote process.

Sets up the toSend and toRecv attributes in associated process communicators.

Parameters:
emodelAssociated engineering model.
excludeSelfCommFlagIf set to true, the communication map of receiver with itself will be forced to be empty, otherwise it will be assembled.

Definition at line 61 of file problemcomm.C.

References _error, oofem::IntArray::at(), oofem::DofManager_shared, oofem::Domain::giveDofManager(), oofem::EngngModel::giveDomain(), oofem::Domain::giveNumberOfDofManagers(), oofem::DofManager::giveParallelMode(), oofem::DofManager::givePartitionList(), oofem::Communicator::giveProcessCommunicator(), oofem::IntArray::giveSize(), mode, oofem::ProblemCommMode__NODE_CUT, oofem::Communicator::rank, setProcessCommunicatorToRecvArry(), setProcessCommunicatorToSendArry(), and oofem::Communicator::size.

Referenced by setUpCommunicationMaps().

void oofem::ProblemCommunicator::setUpCommunicationMapsForRemoteElementMode ( EngngModel emodel,
bool  excludeSelfCommFlag 
) [private]
void oofem::ProblemCommunicator::sortCommMap ( IntArray map,
int(ProblemCommunicator::*)(int, int)  cmp 
) [private]

Sorts given communication map, containing local DofManager numbers according to their corresponding global numbers.

It could not be sorted by standard techniques, because it is necessary to ask DofMAnager form domain and determine its global Number.

Parameters:
mapMap to sort.
cmpComparison function must return a negative value if first argument is less than the second, zero if the arguments are equal, and a positive number otherwise.

Definition at line 946 of file problemcomm.C.

References oofem::IntArray::giveSize(), and quickSortCommMap().

Referenced by setProcessCommunicatorToRecvArry(), and setProcessCommunicatorToSendArry().


Member Data Documentation

Definition at line 57 of file problemcomm.h.

Referenced by ProblemCommunicator(), and setUpCommunicationMaps().


The documentation for this class was generated from the following files:

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Sun Mar 10 2013 18:17:00 for OOFEM by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2011