BUG: send-receive addressing could be recalculated asymmetrically in parallel
ENH: Avoid recalculation off addressing on plain attach/detach
This commit is contained in:
parent
d5326a7d27
commit
fee3998d24
5 changed files with 49 additions and 13 deletions
|
@ -82,6 +82,15 @@ Foam::tmp<Foam::Field<Type> > Foam::ggiPolyPatch::fastExpand
|
|||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// HR, 10/Jul/2013
|
||||
// This function requires send-receive-addressing, but usage is not
|
||||
// symmetric across processors. Hence trigger re-calculate at this point
|
||||
if (Pstream::parRun() && !localParallel())
|
||||
{
|
||||
receiveAddr();
|
||||
shadow().receiveAddr();
|
||||
}
|
||||
|
||||
// Expand the field to zone size
|
||||
tmp<Field<Type> > texpandField
|
||||
(
|
||||
|
|
|
@ -318,13 +318,13 @@ void Foam::regionCouplePolyPatch::calcLocalParallel() const
|
|||
localParallelPtr_ = new bool(false);
|
||||
bool& emptyOrComplete = *localParallelPtr_;
|
||||
|
||||
// If running in serial, all GGIs are expanded to zone size.
|
||||
// If running in parallel, all GGIs are expanded to zone size.
|
||||
// This happens on decomposition and reconstruction where
|
||||
// size and shadow size may be zero, but zone size may not
|
||||
// HJ, 1/Jun/2011
|
||||
if (!Pstream::parRun())
|
||||
{
|
||||
emptyOrComplete = false;
|
||||
emptyOrComplete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -346,7 +346,7 @@ void Foam::regionCouplePolyPatch::calcLocalParallel() const
|
|||
|
||||
if (emptyOrComplete)
|
||||
{
|
||||
Info<< "local parallel" << endl;
|
||||
Info<< "local parallel" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -468,9 +468,15 @@ Foam::regionCouplePolyPatch& Foam::regionCouplePolyPatch::shadow()
|
|||
}
|
||||
|
||||
|
||||
void Foam::regionCouplePolyPatch::clearGeom() const
|
||||
void Foam::regionCouplePolyPatch::clearDeltas() const
|
||||
{
|
||||
deleteDemandDrivenData(reconFaceCellCentresPtr_);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCouplePolyPatch::clearGeom() const
|
||||
{
|
||||
clearDeltas();
|
||||
|
||||
// Remote addressing and send-receive maps depend on the local
|
||||
// position. Therefore, it needs to be recalculated at mesh motion.
|
||||
|
@ -480,16 +486,19 @@ void Foam::regionCouplePolyPatch::clearGeom() const
|
|||
|
||||
deleteDemandDrivenData(receiveAddrPtr_);
|
||||
deleteDemandDrivenData(sendAddrPtr_);
|
||||
|
||||
// localParallel depends on geometry - must be cleared!
|
||||
// HR, 11/Jul/2013
|
||||
deleteDemandDrivenData(localParallelPtr_);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCouplePolyPatch::clearOut()
|
||||
void Foam::regionCouplePolyPatch::clearOut() const
|
||||
{
|
||||
clearGeom();
|
||||
|
||||
deleteDemandDrivenData(zoneAddressingPtr_);
|
||||
deleteDemandDrivenData(patchToPatchPtr_);
|
||||
deleteDemandDrivenData(localParallelPtr_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -800,7 +809,11 @@ void Foam::regionCouplePolyPatch::attach() const
|
|||
// Patch-to-patch interpolation does not need to be cleared,
|
||||
// only face/cell centres and interpolation factors
|
||||
// HJ, 6/Jun/2011
|
||||
clearGeom();
|
||||
//clearGeom()
|
||||
|
||||
// Clear delta coefficients, but keep the rest.
|
||||
// HR, 10/Jul/2013
|
||||
clearDeltas();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -815,7 +828,11 @@ void Foam::regionCouplePolyPatch::detach() const
|
|||
// Patch-to-patch interpolation does not need to be cleared,
|
||||
// only face/cell centres and interpolation factors
|
||||
// HJ, 6/Jun/2011
|
||||
clearGeom();
|
||||
//clearGeom()
|
||||
|
||||
// Clear delta coefficients, but keep the rest.
|
||||
// HR, 10/Jul/2013
|
||||
clearDeltas();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -155,11 +155,14 @@ class regionCouplePolyPatch
|
|||
|
||||
// Memory management
|
||||
|
||||
//- Clear delta coefficients
|
||||
void clearDeltas() const;
|
||||
|
||||
//- Clear geometry
|
||||
void clearGeom() const;
|
||||
void clearGeom() const;
|
||||
|
||||
//- Clear out
|
||||
void clearOut();
|
||||
void clearOut() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
|
|
@ -51,7 +51,7 @@ Foam::tmp<Foam::Field<Type> > Foam::regionCouplePolyPatch::fastExpand
|
|||
// Notes:
|
||||
// A) If the size of zone addressing is zero, data is not sent
|
||||
// B) Communicated data on each processor has the size of live faces
|
||||
// C) Expanded data will be equal to actual data fronm other processors
|
||||
// C) Expanded data will be equal to actual data from other processors
|
||||
// only for the faces marked in remote; for other faces, it will be
|
||||
// equal to zero
|
||||
// D) On processor zero, complete data is available
|
||||
|
@ -81,6 +81,15 @@ Foam::tmp<Foam::Field<Type> > Foam::regionCouplePolyPatch::fastExpand
|
|||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// This function requires send-receive-addressing, but usage is not
|
||||
// symmetric across processors. Hence trigger re-calculate at this point
|
||||
// HR, 10/Jul/2013
|
||||
if (Pstream::parRun() && !localParallel())
|
||||
{
|
||||
receiveAddr();
|
||||
shadow().receiveAddr();
|
||||
}
|
||||
|
||||
// Expand the field to zone size
|
||||
tmp<Field<Type> > texpandField
|
||||
(
|
||||
|
|
|
@ -410,7 +410,6 @@ void regionCouplingFvPatchField<Type>::initInterfaceMatrixUpdate
|
|||
"regionCouplingFvPatchField<Type>::initInterfaceMatrixUpdate"
|
||||
) << "init matrix update called in detached state"
|
||||
<< abort(FatalError);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -461,7 +460,6 @@ void regionCouplingFvPatchField<Type>::updateInterfaceMatrix
|
|||
"regionCouplingFvPatchField<Type>::updateInterfaceMatrix"
|
||||
) << "Matrix update called in detached state"
|
||||
<< abort(FatalError);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue