133 #ifndef Foam_PstreamBuffers_H 134 #define Foam_PstreamBuffers_H 157 enum class modeOption : unsigned char
170 bool finishedSendsCalled_;
173 bool allowClearRecv_;
207 inline void setFinished(
bool on)
noexcept;
210 inline void initFinalExchange();
216 enum modeOption
mode,
243 label& accessRecvPosition(
const label proci);
434 void registerSend(const label proci, const
bool toggleOn = true);
466 const
bool wait = true
479 const
bool wait = true
497 const
bool wait = true
514 const
bool wait = true
532 const
bool wait = true
558 const
bool wait = true
581 const
bool wait = true
int tag() const noexcept
The transfer message tag.
commsTypes
Communications types.
void finishedScatters(const bool wait=true)
Mark all sends to sub-procs as done.
Base class for input inter-processor communications stream (ie, parallel streams). Not to be used directly, thus contructors are protected.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An interval of (signed) integers defined by a start and a size.
IntRange< int > rangeType
Int ranges are used for MPI ranks (processes)
void clearRecv(const label proci)
Clear an individual receive buffer (eg, data not required)
IOstreamOption::streamFormat format() const noexcept
The associated buffer format (ascii | binary)
static int & msgType() noexcept
Message tag of standard messages.
labelList recvDataCounts() const
Number of unconsumed receive bytes for all processors. Must call finishedSends() or other finished...
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
label comm() const noexcept
The communicator index.
void clearSend(const label proci)
Clear an individual send buffer (eg, data not required)
bool allowClearRecv() const noexcept
Is clearStorage of individual receive buffer by external hooks allowed? (default: true) ...
bool hasSendData() const
True if any (local) send buffers have data.
void finishedSends(const bool wait=true)
Mark the send phase as being finished.
void clearUnregistered()
Clear any 'unregistered' send buffers.
label sendDataCount(const label proci) const
Number of send bytes for the specified processor.
UPstream::rangeType subProcs() const noexcept
Range of sub-processes indices associated with PstreamBuffers.
~PstreamBuffers()
Destructor - checks that all data have been consumed.
label recvDataCount(const label proci) const
Number of unconsumed receive bytes for the specified processor. Must call finishedSends() or other fi...
void finishedNeighbourSends(const labelUList &neighProcs, const bool wait=true)
Mark the send phase as being finished, with communication being limited to a known subset of send/rec...
Buffers for inter-processor communications streams (UOPstream, UIPstream).
UPstream::commsTypes commsType() const noexcept
The communications type of the stream.
void finishedGathers(const bool wait=true)
Mark all sends to master as done.
bool finished() const noexcept
True if finishedSends() or finishedNeighbourSends() has been called.
void clearRecvs()
Clear all recv buffer and positions (does not remove buffer storage)
void finishedSendsNBX(const bool wait=true)
Mark the send phase as being finished.
void clear()
Clear all send/recv buffers and reset states.
void initRegisterSend()
Initialise registerSend() bookkeeping by mark all send buffers as 'unregistered'. ...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void clearSends()
Clear all send buffers (does not remove buffer storage)
PstreamBuffers(UPstream::commsTypes commsType=UPstream::commsTypes::nonBlocking, int tag=UPstream::msgType(), label communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct given communication type (default: nonBlocking), message tag, communicator (default: worldC...
void registerSend(const label proci, const bool toggleOn=true)
Toggle an individual send buffer as 'registered'. The setting is sticky (does not turn off) ...
static int algorithm
Preferred exchange algorithm (may change or be removed in future)
streamFormat
Data format (ascii | binary)
"nonBlocking" : (MPI_Isend, MPI_Irecv)
label maxNonLocalRecvCount() const
Maximum receive size, excluding current processor rank Must call finishedSends() or other finished...
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
void clearStorage()
Clear storage for all send/recv buffers and reset states.
Base class for output inter-processor communications stream (ie, parallel streams). Not to be used directly, thus contructors are protected.
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
label maxRecvCount() const
Maximum receive size from any rocessor rank. Must call finishedSends() or other finished.. method first!
bool hasRecvData() const
True if any (local) recv buffers have unconsumed data. Must call finishedSends() or other finished...
const UList< char > peekRecvData(const label proci) const
Number of unconsumed receive bytes for the specified processor. Must call finishedSends() or other fi...
UPstream::rangeType allProcs() const noexcept
Range of ranks indices associated with PstreamBuffers.