Buffers for inter-processor communications streams (UOPstream, UIPstream). More...
Public Member Functions | |
PstreamBuffers (const UPstream::commsTypes commsType, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) | |
Construct given comms type, communication options, IO format. More... | |
~PstreamBuffers () | |
Destructor - checks that all data have been consumed. More... | |
int | tag () const noexcept |
The transfer message type. More... | |
label | comm () const noexcept |
Communicator. More... | |
void | finishedSends (const bool block=true) |
Mark all sends as having been done. More... | |
void | finishedSends (labelList &recvSizes, const bool block=true) |
Mark all sends as having been done. More... | |
void | clear () |
Reset (clear) individual buffers and reset state. More... | |
Friends | |
class | UOPstream |
class | UIPstream |
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Use UOPstream to stream data into buffers, call finishedSends() to notify that data is in buffers and then use IUPstream to get data out of received buffers. Works with both blocking and nonBlocking. Does not make much sense with scheduled since there you would not need these explicit buffers.
Example usage:
Definition at line 88 of file PstreamBuffers.H.
|
explicit |
Construct given comms type, communication options, IO format.
Definition at line 34 of file PstreamBuffers.C.
~PstreamBuffers | ( | ) |
Destructor - checks that all data have been consumed.
Definition at line 54 of file PstreamBuffers.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and Foam::nl.
|
inlinenoexcept |
The transfer message type.
Definition at line 141 of file PstreamBuffers.H.
|
inlinenoexcept |
Communicator.
Definition at line 147 of file PstreamBuffers.H.
Referenced by processorPolyPatch::initGeometry(), processorPolyPatch::initUpdateMesh(), and syncObjects::sync().
void finishedSends | ( | const bool | block = true | ) |
Mark all sends as having been done.
This will start receives in non-blocking mode. If block will wait for all transfers to finish (only relevant for nonBlocking mode)
Definition at line 73 of file PstreamBuffers.C.
References UPstream::nonBlocking.
Referenced by fvMeshDistribute::distribute(), mapDistributeBase::distribute(), distributedTriSurfaceMesh::distribute(), box::doRefineBoxes(), globalIndex::get(), zoneDistribute::getDatafromOtherProc(), FaceCellWave< Type, TrackingData >::handleProcPatches(), trackingInverseDistance::markDonors(), inverseDistance::markDonors(), trackingInverseDistance::markPatchesAsHoles(), inverseDistance::markPatchesAsHoles(), pointBoundaryMesh::movePoints(), polyBoundaryMesh::movePoints(), masterUncollatedFileOperation::NewIFstream(), RecycleInteraction< CloudType >::postEvolve(), masterUncollatedFileOperation::read(), decomposedBlockData::readBlocks(), surfaceNoise::readSurfaceData(), masterUncollatedFileOperation::scatterList(), mapDistributeBase::send(), box::setRefineFlags(), zoneDistribute::setUpCommforZone(), surfaceNoise::surfaceAverage(), syncObjects::sync(), syncTools::syncBoundaryFaceList(), syncTools::syncEdgeMap(), syncTools::syncPointMap(), pointBoundaryMesh::updateMesh(), polyBoundaryMesh::updateMesh(), energySpectrum::write(), and surfaceNoise::writeSurfaceData().
Mark all sends as having been done.
Same as above but also returns sizes (bytes) received.
Definition at line 92 of file PstreamBuffers.C.
References UPstream::commsTypeNames, Foam::endl(), Pstream::exchangeSizes(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and UPstream::nonBlocking.
void clear | ( | ) |
Reset (clear) individual buffers and reset state.
Does not clear buffer storage
Definition at line 125 of file PstreamBuffers.C.
Referenced by fvMeshDistribute::distribute(), trackingInverseDistance::markDonors(), inverseDistance::markDonors(), trackingInverseDistance::markPatchesAsHoles(), inverseDistance::markPatchesAsHoles(), RecycleInteraction< CloudType >::postEvolve(), and surfaceNoise::readSurfaceData().
|
friend |
Definition at line 90 of file PstreamBuffers.H.
|
friend |
Definition at line 91 of file PstreamBuffers.H.