mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use non-blocking comms
This commit is contained in:
@ -466,40 +466,6 @@ void Foam::FaceCellWave<Type>::transform
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Send face info to neighbour.
|
|
||||||
template <class Type>
|
|
||||||
void Foam::FaceCellWave<Type>::sendPatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
const label nFaces,
|
|
||||||
const labelList& faceLabels,
|
|
||||||
const List<Type>& faceInfo
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
OPstream toNeighbour(Pstream::blocking, neighbour);
|
|
||||||
|
|
||||||
writeFaces(nFaces, faceLabels, faceInfo, toNeighbour);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Receive face info from neighbour
|
|
||||||
template <class Type>
|
|
||||||
Foam::label Foam::FaceCellWave<Type>::receivePatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
labelList& faceLabels,
|
|
||||||
List<Type>& faceInfo
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
IPstream fromNeighbour(Pstream::blocking, neighbour);
|
|
||||||
|
|
||||||
label nFaces = 0;
|
|
||||||
readFaces(nFaces, faceLabels, faceInfo, fromNeighbour);
|
|
||||||
|
|
||||||
return nFaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Offset mesh face. Used for transferring from one cyclic half to the other.
|
// Offset mesh face. Used for transferring from one cyclic half to the other.
|
||||||
template <class Type>
|
template <class Type>
|
||||||
void Foam::FaceCellWave<Type>::offset
|
void Foam::FaceCellWave<Type>::offset
|
||||||
@ -523,6 +489,8 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
|
|||||||
{
|
{
|
||||||
// Send all
|
// Send all
|
||||||
|
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
forAll(mesh_.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||||
@ -564,16 +532,13 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPatchInfo
|
UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
writeFaces(nSendFaces, sendFaces, sendFacesInfo, toNeighbour);
|
||||||
procPatch.neighbProcNo(),
|
|
||||||
nSendFaces,
|
|
||||||
sendFaces,
|
|
||||||
sendFacesInfo
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive all
|
// Receive all
|
||||||
|
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
forAll(mesh_.boundaryMesh(), patchI)
|
||||||
@ -586,16 +551,20 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
|
|||||||
refCast<const processorPolyPatch>(patch);
|
refCast<const processorPolyPatch>(patch);
|
||||||
|
|
||||||
// Allocate buffers
|
// Allocate buffers
|
||||||
label nReceiveFaces;
|
label nReceiveFaces = 0;
|
||||||
labelList receiveFaces(patch.size());
|
labelList receiveFaces(patch.size());
|
||||||
List<Type> receiveFacesInfo(patch.size());
|
List<Type> receiveFacesInfo(patch.size());
|
||||||
|
|
||||||
nReceiveFaces = receivePatchInfo
|
{
|
||||||
(
|
UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
procPatch.neighbProcNo(),
|
readFaces
|
||||||
receiveFaces,
|
(
|
||||||
receiveFacesInfo
|
nReceiveFaces,
|
||||||
);
|
receiveFaces,
|
||||||
|
receiveFacesInfo,
|
||||||
|
fromNeighbour
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -225,23 +225,6 @@ class FaceCellWave
|
|||||||
List<Type>& faceInfo
|
List<Type>& faceInfo
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Send info to neighbour
|
|
||||||
void sendPatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
const label nFaces,
|
|
||||||
const labelList&,
|
|
||||||
const List<Type>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Receive info from neighbour. Returns number of faces received.
|
|
||||||
label receivePatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
labelList&,
|
|
||||||
List<Type>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Offset face labels by constant value
|
//- Offset face labels by constant value
|
||||||
static void offset
|
static void offset
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user