61FETICommunicator :: setUpCommunicationMaps(
EngngModel *pm)
64 int globaldofmannum, localNumber, ndofs;
65 int numberOfBoundaryDofMans;
68 IntArray numberOfPartitionBoundaryDofMans(size);
74 map< int, int, less< int > >BoundaryDofManagerMap;
76 std::vector<IntArray> commMaps(size);
82 if ( this->
rank != 0 ) {
83 OOFEM_ERROR(
"rank 0 (master) expected as receiver");
92 for (
int i = 1; i < size; i++ ) {
93 commBuff.
iRecv(MPI_ANY_SOURCE, FETICommunicator :: NumberOfBoundaryDofManagersMsg);
100#ifdef __VERBOSE_PARALLEL
101 OOFEM_LOG_DEBUG(
"[process rank %3d]: %-30s: Received data from partition %3d (received %d)\n",
102 rank,
"FETICommunicator :: setUpCommunicationMaps : received number of boundary dofMans", source, j);
104 numberOfPartitionBoundaryDofMans.
at(source + 1) = j;
108 MPI_Barrier(MPI_COMM_WORLD);
114 for (
int i = 1; i <= nnodes; i++ ) {
120 numberOfPartitionBoundaryDofMans.
at(1) = j;
128 for (
int i = 0; i < size; i++ ) {
129 if ( numberOfPartitionBoundaryDofMans.
at(i + 1) > maxRec ) {
130 maxRec = numberOfPartitionBoundaryDofMans.
at(i + 1);
136 for (
int i = 0; i < size; i++ ) {
137 j = numberOfPartitionBoundaryDofMans.
at(i + 1);
138 commMaps [ i ].resize(j);
145 for (
int j = 1; j <= numberOfPartitionBoundaryDofMans.
at(1); j++ ) {
154 for (
int l = 1; l <= locNum.
giveSize(); l++ ) {
155 if ( locNum.
at(l) ) {
161 if ( ( localNumber = BoundaryDofManagerMap [ globaldofmannum ] ) == 0 ) {
165 localNumber = BoundaryDofManagerMap [ globaldofmannum ] = (
boundaryDofManList.size() );
175 commMaps [ 0 ].at(j) = localNumber;
182 for (
int i = 1; i < size; i++ ) {
183 commBuff.
iRecv(MPI_ANY_SOURCE, FETICommunicator :: BoundaryDofManagersRecMsg);
189#ifdef __VERBOSE_PARALLEL
190 OOFEM_LOG_DEBUG(
"[process rank %3d]: %-30s: Received data from partition %3d\n",
191 rank,
"FETICommunicator :: setUpCommunicationMaps : received boundary dofMans records", source);
195 for (
int j = 1; j <= numberOfPartitionBoundaryDofMans.
at(source + 1); j++ ) {
196 commBuff.
read(globaldofmannum);
197 commBuff.
read(ndofs);
200 if ( ( localNumber = BoundaryDofManagerMap [ globaldofmannum ] ) == 0 ) {
204 localNumber = BoundaryDofManagerMap [ globaldofmannum ] = (
boundaryDofManList.size() );
214 commMaps [ source ].at(j) = localNumber;
220 MPI_Barrier(MPI_COMM_WORLD);
226 for (
int i = 1; i <= numberOfBoundaryDofMans; i++ ) {
231 for (
int i = 0; i < size; i++ ) {
240 MPI_Barrier(MPI_COMM_WORLD);
242#ifdef __VERBOSE_PARALLEL
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
DofManager * giveDofManager(int n)