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.
This commit is contained in:
parent
a809265432
commit
9c1f94d4fd
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user