Skip to content
Snippets Groups Projects
Commit 9c1f94d4 authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

BUG: parallel blocking with faFieldDecomposer, faMeshReconstructor (fixes #2237)

- the patch remapping in faFieldDecomposer calls weights
  internalField() which can trigger parallel communication on the
  complete mesh for some processors only (ie, blocks).

  Force a priori creation of weights instead.

- ensure that the complete mesh (reconstruction helper)
  is serial when adding patches.
parent a8092654
Branches
Tags
1 merge request!490parallel construct finiteArea with arbitrary connections
......@@ -293,7 +293,7 @@ void Foam::faFieldDecomposer::reset
new processorEdgePatchFieldDecomposer
(
procMesh_.boundary()[patchi].size(),
static_cast<const labelUList&>(localPatchSlice)
localPatchSlice
)
);
}
......@@ -309,6 +309,15 @@ void Foam::faFieldDecomposer::reset(const faMesh& completeMesh)
processorAreaPatchFieldDecomposerPtrs_.resize(nMappers);
processorEdgePatchFieldDecomposerPtrs_.resize(nMappers);
// Create weightings now - needed for proper parallel synchronization
(void)completeMesh.weights();
// faPatches don't have their own start() - so these are invariant
const labelList completePatchStarts
(
completeMesh.boundary().patchStarts()
);
forAll(boundaryAddressing_, patchi)
{
const label oldPatchi = boundaryAddressing_[patchi];
......@@ -324,7 +333,7 @@ void Foam::faFieldDecomposer::reset(const faMesh& completeMesh)
(
completeMesh.boundary()[oldPatchi].size(),
localPatchSlice,
completeMesh.boundary()[oldPatchi].start()
completePatchStarts[oldPatchi]
)
);
}
......@@ -346,7 +355,7 @@ void Foam::faFieldDecomposer::reset(const faMesh& completeMesh)
new processorEdgePatchFieldDecomposer
(
procMesh_.boundary()[patchi].size(),
static_cast<const labelUList&>(localPatchSlice)
localPatchSlice
)
);
}
......
......@@ -219,9 +219,9 @@ void Foam::faFieldDecomposer::decomposeFields
const PtrList<GeoField>& fields
) const
{
forAll(fields, fieldI)
forAll(fields, fieldi)
{
decomposeField(fields[fieldI])().write();
decomposeField(fields[fieldi])().write();
}
}
......
......@@ -517,7 +517,13 @@ void Foam::faMeshReconstructor::createMesh()
);
}
// Serial mesh - no parallel communication
const bool oldParRun = Pstream::parRun(false);
completeMesh.addFaPatches(completePatches);
Pstream::parRun(oldParRun); // Restore parallel state
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment