mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: additional control and access methods for PstreamBuffers
- PstreamBuffers nProcs() and allProcs() methods to recover the rank
information consistent with the communicator used for construction
- allowClearRecv() methods for more control over buffer reuse
For example,
pBufs.allowClearRecv(false);
forAll(particles, particlei)
{
pBufs.clear();
fill...
read via IPstream(..., pBufs);
}
This preserves the receive buffers memory allocation between calls.
- finishedNeighbourSends() method as compact wrapper for
finishedSends() when send/recv ranks are identically
(eg, neighbours)
- hasSendData()/hasRecvData() methods for PstreamBuffers.
Can be useful for some situations to skip reading entirely.
For example,
pBufs.finishedNeighbourSends(neighProcs);
if (!returnReduce(pBufs.hasRecvData(), orOp<bool>()))
{
// Nothing to do
continue;
}
...
On an individual basis:
for (const int proci : pBufs.allProcs())
{
if (pBufs.hasRecvData(proci))
{
...
}
}
Also conceivable to do the following instead (nonBlocking only):
if (!returnReduce(pBufs.hasSendData(), orOp<bool>()))
{
// Nothing to do
pBufs.clear();
continue;
}
pBufs.finishedNeighbourSends(neighProcs);
...
This commit is contained in:
committed by
Andrew Heather
parent
bfca84d11a
commit
14631984df
@ -162,7 +162,7 @@ void Foam::faMeshReconstructor::calcAddressing
|
||||
{
|
||||
labelList localOrder;
|
||||
|
||||
UIPstream fromProc(Pstream::master(), pBufs);
|
||||
UIPstream fromProc(Pstream::masterNo(), pBufs);
|
||||
fromProc >> localOrder;
|
||||
|
||||
faFaceProcAddr_ = labelList(faFaceProcAddr_, localOrder);
|
||||
|
||||
Reference in New Issue
Block a user