35 #include "../sm/FETISolver/feticommunicator.h" 51 OOFEM_ERROR(
"bad rank number, expected rank 0 for master");
64 int globaldofmannum, localNumber, ndofs;
65 int numberOfBoundaryDofMans;
73 map< int, int, less< int > >BoundaryDofManagerMap;
81 if ( this->
rank != 0 ) {
82 OOFEM_ERROR(
"rank 0 (master) expected as receiver");
91 for ( i = 1; i <
size; i++ ) {
99 #ifdef __VERBOSE_PARALLEL 100 OOFEM_LOG_DEBUG(
"[process rank %3d]: %-30s: Received data from partition %3d (received %d)\n",
101 rank,
"FETICommunicator :: setUpCommunicationMaps : received number of boundary dofMans", source, j);
103 numberOfPartitionBoundaryDofMans.
at(source + 1) = j;
107 MPI_Barrier(MPI_COMM_WORLD);
113 for ( i = 1; i <= nnodes; i++ ) {
119 numberOfPartitionBoundaryDofMans.
at(1) = j;
127 for ( i = 0; i <
size; i++ ) {
128 if ( numberOfPartitionBoundaryDofMans.
at(i + 1) > maxRec ) {
129 maxRec = numberOfPartitionBoundaryDofMans.
at(i + 1);
135 for ( i = 0; i <
size; i++ ) {
136 j = numberOfPartitionBoundaryDofMans.
at(i + 1);
144 for ( j = 1; j <= numberOfPartitionBoundaryDofMans.
at(1); j++ ) {
153 for ( l = 1; l <= locNum.
giveSize(); l++ ) {
154 if ( locNum.
at(l) ) {
160 if ( ( localNumber = BoundaryDofManagerMap [ globaldofmannum ] ) == 0 ) {
164 localNumber = BoundaryDofManagerMap [ globaldofmannum ] = (
boundaryDofManList.size() );
174 commMaps [ 0 ]->
at(j) = localNumber;
181 for ( i = 1; i <
size; i++ ) {
188 #ifdef __VERBOSE_PARALLEL 189 OOFEM_LOG_DEBUG(
"[process rank %3d]: %-30s: Received data from partition %3d\n",
190 rank,
"FETICommunicator :: setUpCommunicationMaps : received boundary dofMans records", source);
194 for ( j = 1; j <= numberOfPartitionBoundaryDofMans.
at(source + 1); j++ ) {
195 commBuff.
read(globaldofmannum);
196 commBuff.
read(ndofs);
199 if ( ( localNumber = BoundaryDofManagerMap [ globaldofmannum ] ) == 0 ) {
203 localNumber = BoundaryDofManagerMap [ globaldofmannum ] = (
boundaryDofManList.size() );
213 commMaps [ source ]->
at(j) = localNumber;
219 MPI_Barrier(MPI_COMM_WORLD);
225 for ( i = 1; i <= numberOfBoundaryDofMans; i++ ) {
230 for ( i = 0; i <
size; i++ ) {
238 delete commMaps [ i ];
243 MPI_Barrier(MPI_COMM_WORLD);
245 #ifdef __VERBOSE_PARALLEL
The representation of EngngModel default unknown numbering.
IntArray masterCommMap
Master communication map.
int giveGlobalNumber() const
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
virtual int iRecv(int source, int tag, int count=0)
Starts standard mode, nonblocking receive.
void setToSendArry(T *emodel, const IntArray &src, int packUnpackType)
Sets receiver toSend array to src.
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
int numberOfEquations
Number of equations at master level (determined form boundary nodes).
virtual int testCompletion()
Tests if the operation identified by this->request is complete.
virtual int givePackSizeOfInt(int count)
virtual int resize(int newSize)
Resizes buffer to given size.
FETICommunicator(EngngModel *emodel, CommunicatorBuff *b, int rank, int size)
Creates new communicator.
void setUpCommunicationMaps(EngngModel *pm)
Service for setting up the communication patterns with other remote processes.
#define VERBOSEPARALLEL_PRINT(service, str, rank)
virtual void init()
Initializes buffer to empty state.
virtual int read(int *dest, int n)
Reads count integer values into array pointed by data.
EngngModel * engngModel
Engineering model.
Represent the abstraction for DOF manager.
vector< FETIBoundaryDofManager > boundaryDofManList
List of boundary dof managers records.
void giveCompleteLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s) const
Returns full location array of receiver containing equation numbers of all dofs of receiver...
Class representing communicator.
void setToRecvArry(T *emodel, const IntArray &src, int packUnpackType)
Sets receiver toRecv array to src.
int size
Number of processes.
ProcessCommunicator * giveProcessCommunicator(int i)
Returns i-th problem communicator.
The Communicator and corresponding buffers (represented by this class) are separated in order to allo...
Abstract base class representing the "problem" under consideration.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
virtual ~FETICommunicator()
Destructor.
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.