Input inter-processor communications stream. More...


Public Member Functions | |
| IPstream (const UPstream::commsTypes commsType, const int fromProcNo, const int bufferSize=0, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) | |
| Construct given process index to read from. More... | |
| IPstream (const int fromProcNo, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) | |
| Construct given process index to read from. Uses MPI_Probe and MPI_Recv. More... | |
| DynamicList< char > | release () |
| Release contents of the input buffer and reset the stream. More... | |
Public Member Functions inherited from Pstream | |
| ClassName ("Pstream") | |
| Declare name of the class and its debug switch. More... | |
| Pstream (UPstream::commsTypes commsType) noexcept | |
| Construct for communication type with empty buffer. More... | |
| Pstream (UPstream::commsTypes commsType, int bufferSize) | |
| Construct for communication type with given buffer size. More... | |
| template<class T > | |
| FOAM_DEPRECATED_FOR (2025-03, "broadcast() or broadcastList()") static void scatterList(UList< T > &values | |
| The inverse of gatherList, but when combined with gatherList it effectively acts like a partial broadcast... More... | |
Public Member Functions inherited from UPstream | |
| ClassName ("UPstream") | |
| Declare name of the class and its debug switch. More... | |
| UPstream (const commsTypes commsType) noexcept | |
| Construct for given communication type. More... | |
| commsTypes | commsType () const noexcept |
| Get the communications type of the stream. More... | |
| commsTypes | commsType (const commsTypes ct) noexcept |
| Set the communications type of the stream. More... | |
Public Member Functions inherited from UIPstream | |
| UIPstream (const UPstream::commsTypes commsType, const int fromProcNo, DynamicList< char > &receiveBuf, label &receiveBufPosition, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, const bool clearAtEnd=false, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) | |
| Construct given process index to read from using the given attached receive buffer, optional communication characteristics and IO format. More... | |
| UIPstream (const int fromProcNo, PstreamBuffers &buffers) | |
| Construct given buffers. More... | |
| UIPstream (const DynamicList< char > &recvBuf, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) | |
| Construct for reading from a standalone buffer that has been obtained externally by the caller. More... | |
| virtual | ~UIPstream ()=default |
| Destructor. More... | |
| virtual Istream & | read (token &) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (char &c) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (word &str) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (string &str) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (int32_t &val) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (int64_t &val) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (uint32_t &val) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (uint64_t &val) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (float &val) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (double &val) override |
| Use all read methods from base. More... | |
| virtual Istream & | read (char *data, std::streamsize count) override |
| Use all read methods from base. More... | |
Public Member Functions inherited from UIPstreamBase | |
| virtual | ~UIPstreamBase () |
| Destructor. Optionally clears external receive buffer. More... | |
| int | source () const noexcept |
| The source rank. More... | |
| virtual std::ios_base::fmtflags | flags () const override |
| Return current stream flags. Dummy for parallel stream, returns 0. More... | |
| virtual std::ios_base::fmtflags | flags (std::ios_base::fmtflags) override |
| Set stream flags, return old stream flags. Dummy for parallel stream, returns 0. More... | |
| virtual Istream & | read (token &) override |
| Return next token from stream. More... | |
| virtual Istream & | read (char &c) override |
| Read a character. More... | |
| virtual Istream & | read (word &str) override |
| Read a word. More... | |
| virtual Istream & | read (string &str) override |
| Read a string (including enclosing double-quotes) More... | |
| virtual Istream & | read (int32_t &val) override |
| Read int32_t. More... | |
| virtual Istream & | read (int64_t &val) override |
| Read int64_t. More... | |
| virtual Istream & | read (uint32_t &val) override |
| Read uint32_t. More... | |
| virtual Istream & | read (uint64_t &val) override |
| Read uint64_t. More... | |
| virtual Istream & | read (float &val) override |
| Read a float. More... | |
| virtual Istream & | read (double &val) override |
| Read a double. More... | |
| virtual Istream & | read (char *data, std::streamsize count) override |
Read binary block with 8-byte alignment, a no-op (also no alignment) if the count == 0. If data is a null pointer: an aligned forward seek of count characters. More... | |
| virtual Istream & | readRaw (char *data, std::streamsize count) override |
Low-level raw binary read (without alignment), a no-op if the count == 0. If data is a null pointer: forward seek of count characters. More... | |
| virtual bool | beginRawRead () override |
| Start of low-level raw binary read. More... | |
| virtual bool | endRawRead () override |
| End of low-level raw binary read. More... | |
| template<class T > | |
| Istream & | read_binary (T *buffer, std::streamsize count) |
Read contiguous content as raw binary with 8-byte alignment, a no-op (also no alignment) if the count == 0. If buffer a null pointer: an aligned forward seek of count items. More... | |
| template<class T > | |
| Istream & | read_binary (T &value) |
| Read single contiguous value as raw binary with 8-byte alignment. More... | |
| void | aligng (size_t alignment) |
| Align the input position (byte boundary) to specified amount. Does not modify the buffer content. [ADVANCED USAGE]. More... | |
| template<class T > | |
| void | aligng () |
| Align the input position (byte boundary) for the data type. [ADVANCED USAGE]. More... | |
| void | seekg (int64_t pos) |
| Set input position pointer to the absolute location, without any EOF checks. Does not modify the buffer content. [ADVANCED USAGE]. More... | |
| int64_t | tellg () const noexcept |
| The current input position (in the buffer). More... | |
| int64_t | remaining () const noexcept |
| The number of characters remaining in the input buffer. More... | |
| int64_t | size () const noexcept |
| The total number of characters in the input buffer. More... | |
| virtual void | rewind () override |
| Rewind the receive stream position so that it may be read again. More... | |
| void | print (Ostream &os) const override |
| Print stream description to Ostream. More... | |
Public Member Functions inherited from Istream | |
| Istream (const Istream &)=default | |
| Copy construct. More... | |
| virtual | ~Istream ()=default |
| Destructor. More... | |
| Istream (IOstreamOption streamOpt=IOstreamOption()) | |
| Default construct (ASCII, uncompressed), construct with specified stream option. More... | |
| Istream (IOstreamOption::streamFormat fmt, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
| Construct with format (uncompressed) More... | |
| const token & | peekBack () const noexcept |
| Examine putback token without removing it. More... | |
| void | putBackClear () |
| Drop the putback token. More... | |
| void | putBack (const token &tok) |
| Put back a token (copy). Only a single put back is permitted. More... | |
| void | putBack (token &&tok) |
| Put back a token (move). Only a single put back is permitted. More... | |
| bool | getBack (token &tok) |
| Retrieve the put-back token if there is one. More... | |
| bool | readBegin (const char *funcName) |
| Begin read of data chunk, starts with '('. More... | |
| bool | readEnd (const char *funcName) |
| End read of data chunk, ends with ')'. More... | |
| char | readBeginList (const char *funcName) |
| Begin read of list data, starts with '(' or '{'. More... | |
| char | readEndList (const char *funcName) |
| End read of list data, ends with ')' or '}'. More... | |
| Istream & | operator() () const |
| Return a non-const reference to const Istream. More... | |
Public Member Functions inherited from IOstream | |
| IOstream (const IOstream &)=default | |
| Copy construct. More... | |
| virtual | ~IOstream ()=default |
| Destructor. More... | |
| IOstream (IOstreamOption streamOpt=IOstreamOption()) | |
| Default construct (ASCII, uncompressed), construct with specified stream option. More... | |
| IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
| Construct with format, version (compression) More... | |
| virtual const fileName & | name () const |
| The name of the stream. More... | |
| fileName | relativeName () const |
| Return the name of the stream relative to the current case. More... | |
| virtual bool | check (const char *operation) const |
| Check IOstream status for given operation. More... | |
| bool | fatalCheck (const char *operation) const |
| Check IOstream status for given operation. More... | |
| bool | opened () const noexcept |
| True if stream has been opened. More... | |
| bool | closed () const noexcept |
| True if stream is closed. More... | |
| bool | good () const noexcept |
| True if next operation might succeed. More... | |
| bool | eof () const noexcept |
| True if end of input seen. More... | |
| bool | fail () const noexcept |
| True if next operation will fail. More... | |
| bool | bad () const noexcept |
| True if stream is corrupted. More... | |
| operator bool () const noexcept | |
| True if the stream has not failed. More... | |
| bool | operator! () const noexcept |
| True if the stream has failed. More... | |
| unsigned | labelByteSize () const noexcept |
| The sizeof (label) in bytes associated with the stream. More... | |
| unsigned | scalarByteSize () const noexcept |
| The sizeof (scalar) in bytes associated with the stream. More... | |
| void | setLabelByteSize (unsigned nbytes) noexcept |
| Set the sizeof (label) in bytes associated with the stream. More... | |
| void | setScalarByteSize (unsigned nbytes) noexcept |
| Set the sizeof (scalar) in bytes associated with the stream. More... | |
| template<class T , class = std::enable_if_t<std::is_integral_v<T>>> | |
| bool | checkLabelSize () const noexcept |
| Test if the label byte-size associated with the stream is the same as the given type. More... | |
| template<class T , class = std::enable_if_t<std::is_floating_point_v<T>>> | |
| bool | checkScalarSize () const noexcept |
| Test if the scalar byte-size associated with the stream is the same as the given type. More... | |
| bool | checkNativeSizes () const noexcept |
| Test if the label/scalar byte-size associated with the stream are the native label/scalar sizes. More... | |
| bool | fatalCheckNativeSizes (const char *operation) const |
| Assert that the label/scalar byte-size associated with the stream are the native label/scalar sizes. More... | |
| label | lineNumber () const noexcept |
| Const access to the current stream line number. More... | |
| label & | lineNumber () noexcept |
| Non-const access to the current stream line number. More... | |
| label | lineNumber (const label num) noexcept |
| Set the stream line number. More... | |
| void | setEof () noexcept |
| Set stream state as reached 'eof'. More... | |
| void | setFail () noexcept |
| Set stream state as 'failed'. More... | |
| void | setBad () noexcept |
| Set stream state to be 'bad'. More... | |
| std::ios_base::fmtflags | setf (std::ios_base::fmtflags f) |
| Set stream flag(s), return old stream flags. More... | |
| std::ios_base::fmtflags | setf (const std::ios_base::fmtflags f, const std::ios_base::fmtflags mask) |
| Set stream flag(s) with mask, return old stream flags. More... | |
| std::ios_base::fmtflags | unsetf (std::ios_base::fmtflags f) |
| Unset stream flags, return old stream flags. More... | |
| void | print (Ostream &os, const int streamState) const |
| Print information about the stream state bits. More... | |
| InfoProxy< IOstream > | info () const noexcept |
| Return info proxy, used to print IOstream information to a stream. More... | |
Public Member Functions inherited from IOstreamOption | |
| constexpr | IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
| Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression. More... | |
| constexpr | IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept |
| Construct from components (format, compression, version) More... | |
| constexpr | IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
| Construct from components (format, version, compression) More... | |
| IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept | |
| Copy construct with change of format. More... | |
| streamFormat | format () const noexcept |
| Get the current stream format. More... | |
| streamFormat | format (const streamFormat fmt) noexcept |
| Set the stream format. More... | |
| streamFormat | format (const word &formatName) |
| Set the stream format from string value. More... | |
| compressionType | compression () const noexcept |
| Get the stream compression. More... | |
| compressionType | compression (const compressionType comp) noexcept |
| Set the stream compression. More... | |
| compressionType | compression (const word &compName) |
| Set the stream compression from string value. More... | |
| versionNumber | version () const noexcept |
| Get the stream version. More... | |
| versionNumber | version (const versionNumber ver) noexcept |
| Set the stream version. More... | |
| versionNumber | version (const token &tok) |
| Set the stream version from token. More... | |
Static Public Member Functions | |
| template<class Type > | |
| static void | recv (Type &value, const int fromProcNo, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) |
Receive and deserialize a value. Uses operator>> for de-serialization. More... | |
Static Public Member Functions inherited from Pstream | |
| template<class Type > | |
| static void | broadcast (Type &value, const int communicator=UPstream::worldComm) |
| Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-parallel. More... | |
| template<class Type , unsigned N> | |
| static void | broadcast (FixedList< Type, N > &list, const int communicator=UPstream::worldComm) |
| Broadcast fixed-list content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-parallel. More... | |
| template<class Type , class... Args> | |
| static void | broadcasts (const int communicator, Type &value, Args &&... values) |
| Broadcast multiple items to all communicator ranks. Does nothing in non-parallel. More... | |
| template<class ListType > | |
| static void | broadcastList (ListType &list, const int communicator=UPstream::worldComm) |
| Broadcast list content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-parallel. More... | |
| template<class T , class BinaryOp , bool InplaceMode = false> | |
| static void | gather (T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Gather (reduce) data, applying bop to combine value from different processors. The basis for Foam::reduce(). More... | |
| template<class T > | |
| static List< T > | listGatherValues (const T &localValue, const int communicator=UPstream::worldComm, const int tag=UPstream::msgType()) |
| Gather individual values into list locations. More... | |
| template<class T > | |
| static T | listScatterValues (const UList< T > &allValues, const int communicator=UPstream::worldComm, const int tag=UPstream::msgType()) |
| Scatter individual values from list locations. More... | |
| template<class T , class CombineOp > | |
| static void | combineGather (T &value, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Forwards to Pstream::gather with an in-place cop. More... | |
| template<class T , class CombineOp > | |
| static void | combineReduce (T &value, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors. More... | |
| template<class T , class CombineOp > | |
| static void | combineAllGather (T &value, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Same as Pstream::combineReduce. More... | |
| template<class T , class BinaryOp , bool InplaceMode = false> | |
| static void | listGather (UList< T > &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Gather (reduce) list elements, applying bop to each list element. More... | |
| template<class T , class CombineOp > | |
| static void | listCombineGather (UList< T > &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Forwards to Pstream::listGather with an in-place cop. More... | |
| template<class T , class BinaryOp , bool InplaceMode = false> | |
| static void | listReduce (UList< T > &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Reduce list elements (list must be equal size on all ranks), applying bop to each list element. More... | |
| template<class T , class CombineOp > | |
| static void | listCombineReduce (UList< T > &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Forwards to Pstream::listReduce with an in-place cop. More... | |
| template<class T , class CombineOp > | |
| static void | listCombineAllGather (UList< T > &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Same as Pstream::listCombineReduce. More... | |
| template<class Container , class BinaryOp , bool InplaceMode = false> | |
| static void | mapGather (Container &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Gather (reduce) Map/HashTable containers, applying bop to combine entries from different processors. More... | |
| template<class Container , class CombineOp > | |
| static void | mapCombineGather (Container &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Forwards to Pstream::mapGather with an in-place cop. More... | |
| template<class Container , class BinaryOp , bool InplaceMode = false> | |
| static void | mapReduce (Container &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Reduce inplace (cf. MPI Allreduce) applying bop to combine map values from different processors. After completion all processors have the same data. More... | |
| template<class Container , class CombineOp > | |
| static void | mapCombineReduce (Container &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
Forwards to Pstream::mapReduce with an in-place cop. More... | |
| template<class Container , class CombineOp > | |
| static void | mapCombineAllGather (Container &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Same as Pstream::mapCombineReduce. More... | |
| template<class T > | |
| static void | gatherList (UList< T > &values, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Gather data, but keep individual values separate. More... | |
| template<class T > | |
| static void | allGatherList (UList< T > &values, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Gather data, but keep individual values separate. Uses MPI_Allgather or manual communication. More... | |
| template<class Container > | |
| static void | exchangeSizes (const labelUList &sendProcs, const labelUList &recvProcs, const Container &sendBufs, labelList &sizes, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm) |
| Helper: exchange sizes of sendBufs for specified send/recv ranks. More... | |
| template<class Container > | |
| static void | exchangeSizes (const labelUList &neighProcs, const Container &sendBufs, labelList &sizes, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm) |
| Helper: exchange sizes of sendBufs for specified neighbour ranks. More... | |
| template<class Container > | |
| static void | exchangeSizes (const Container &sendBufs, labelList &recvSizes, const int comm=UPstream::worldComm) |
| Helper: exchange sizes of sendBufs. The sendBufs is the data per processor (in the communicator). More... | |
| template<class Container > | |
| static void | exchangeSizes (const Map< Container > &sendBufs, Map< label > &recvSizes, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm) |
| Exchange the non-zero sizes of sendBufs entries (sparse map) with other ranks in the communicator using non-blocking consensus exchange. More... | |
| template<class Container , class Type > | |
| static void | exchange (const UList< Container > &sendBufs, const labelUList &recvSizes, List< Container > &recvBufs, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm, const bool wait=true) |
| Helper: exchange contiguous data. Sends sendBufs, receives into recvBufs using predetermined receive sizing. More... | |
| template<class Container , class Type > | |
| static void | exchange (const Map< Container > &sendBufs, const Map< label > &recvSizes, Map< Container > &recvBufs, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm, const bool wait=true) |
| Exchange contiguous data. Sends sendBufs, receives into recvBufs. More... | |
| template<class Container , class Type > | |
| static void | exchange (const UList< Container > &sendBufs, List< Container > &recvBufs, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm, const bool wait=true) |
| Exchange contiguous data. Sends sendBufs, receives into recvBufs. Determines sizes to receive. More... | |
| template<class Container , class Type > | |
| static void | exchange (const Map< Container > &sendBufs, Map< Container > &recvBufs, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm, const bool wait=true) |
| Exchange contiguous data. Sends sendBufs, receives into recvBufs. Determines sizes to receive. More... | |
| template<class Container , class Type > | |
| static void | exchangeConsensus (const UList< Container > &sendBufs, List< Container > &recvBufs, const int tag, const int comm, const bool wait=true) |
| Exchange contiguous data using non-blocking consensus (NBX) Sends sendData, receives into recvData. More... | |
| template<class Container , class Type > | |
| static void | exchangeConsensus (const Map< Container > &sendBufs, Map< Container > &recvBufs, const int tag, const int comm, const bool wait=true) |
| Exchange contiguous data using non-blocking consensus (NBX) Sends sendData, receives into recvData. More... | |
| template<class Container , class Type > | |
| static Map< Container > | exchangeConsensus (const Map< Container > &sendBufs, const int tag, const int comm, const bool wait=true) |
| Exchange contiguous data using non-blocking consensus (NBX) Sends sendData returns receive information. More... | |
| template<class T > | |
| static void | scatter (T &value, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm) |
| template<class T > | |
| static void | combineScatter (T &value, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm) |
| template<class T > | |
| static void | listCombineScatter (List< T > &value, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm) |
| template<class Container > | |
| static void | mapCombineScatter (Container &values, const int tag=UPstream::msgType(), const int comm=UPstream::worldComm) |
| template<class Type > | |
| static bool | broadcast (Type *buffer, std::streamsize count, const int communicator, const int root=UPstream::masterNo()) |
| Broadcast buffer content to all processes in communicator. More... | |
| template<class Type , unsigned N> | |
| static bool | broadcast (FixedList< Type, N > &list, const int communicator, const int root=UPstream::masterNo()) |
| Broadcast buffer content to all processes in communicator. More... | |
Static Public Member Functions inherited from UPstream | |
| static bool | usingTopoControl (UPstream::topoControls ctrl) noexcept |
| Test for selection of given topology-aware routine. More... | |
| static constexpr int | commGlobal () noexcept |
| Communicator for all ranks, irrespective of any local worlds. More... | |
| static constexpr int | commSelf () noexcept |
| Communicator within the current rank only. More... | |
| static int | commConstWorld () noexcept |
| Communicator for all ranks (respecting any local worlds). More... | |
| static label | commWorld () noexcept |
| Communicator for all ranks (respecting any local worlds) More... | |
| static label | commWorld (label communicator) noexcept |
| Set world communicator. Negative values are a no-op. More... | |
| static label | commWarn (label communicator) noexcept |
| Alter communicator debugging setting. Warns for use of any communicator differing from specified. Negative values disable. More... | |
| static label | nComms () noexcept |
| Number of currently defined communicators. More... | |
| static void | printCommTree (int communicator, bool linear=false) |
| Debugging: print the communication tree. More... | |
| static int | commInterNode () noexcept |
| Communicator between nodes/hosts (respects any local worlds) More... | |
| static int | commLocalNode () noexcept |
| Communicator within the node/host (respects any local worlds) More... | |
| static bool | hasNodeCommunicators () noexcept |
| Both inter-node and local-node communicators have been created. More... | |
| static bool | usingNodeComms (const int communicator) |
| True if node topology-aware routines have been enabled, it is running in parallel, the starting point is the world-communicator and it is not an odd corner case (ie, all processes on one node, all processes on different nodes) More... | |
| static label | newCommunicator (const label parent, const labelRange &subRanks, const bool withComponents=true) |
| Create new communicator with sub-ranks on the parent communicator. More... | |
| static label | newCommunicator (const label parent, const labelUList &subRanks, const bool withComponents=true) |
| Create new communicator with sub-ranks on the parent communicator. More... | |
| static label | dupCommunicator (const label parent) |
| Duplicate the parent communicator. More... | |
| static label | splitCommunicator (const label parent, const int colour, const bool two_step=true) |
| Allocate a new communicator by splitting the parent communicator on the given colour. More... | |
| static void | freeCommunicator (const label communicator, const bool withComponents=true) |
| Free a previously allocated communicator. More... | |
| static int | baseProcNo (label comm, int procID) |
| Return physical processor number (i.e. processor number in worldComm) given communicator and processor. More... | |
| static label | procNo (const label comm, const int baseProcID) |
| Return processor number in communicator (given physical processor number) (= reverse of baseProcNo) More... | |
| static label | procNo (const label comm, const label currentComm, const int currentProcID) |
| Return processor number in communicator (given processor number and communicator) More... | |
| static void | addValidParOptions (HashTable< string > &validParOptions) |
| Add the valid option this type of communications library adds/requires on the command line. More... | |
| static bool | init (int &argc, char **&argv, const bool needsThread) |
| Initialisation function called from main. More... | |
| static bool | initNull () |
| Special purpose initialisation function. More... | |
| static void | barrier (const int communicator, UPstream::Request *req=nullptr) |
| Impose a synchronisation barrier (optionally non-blocking) More... | |
| static void | send_done (const int toProcNo, const int communicator, const int tag=UPstream::msgType()+1970) |
| Impose a point-to-point synchronisation barrier by sending a zero-byte "done" message to given rank. More... | |
| static int | wait_done (const int fromProcNo, const int communicator, const int tag=UPstream::msgType()+1970) |
| Impose a point-to-point synchronisation barrier by receiving a zero-byte "done" message from given rank. More... | |
| static std::pair< int, int64_t > | probeMessage (const UPstream::commsTypes commsType, const int fromProcNo, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| A standard or non-blocking probe for an incoming message. More... | |
| static std::pair< int, int64_t > | probeMessage (const int fromProcNo, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| A standard probe for an incoming message. More... | |
| static void | probeMessages (DynamicList< int64_t > &messageSizes, const UList< int > &fromProcs, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Probe incoming message sizes from specified ranks. More... | |
| static void | printNodeCommsControl (Ostream &os) |
| Report the node-communication settings. More... | |
| static void | printTopoControl (Ostream &os) |
| Report the topology routines settings. More... | |
| static label | nRequests () noexcept |
| Number of outstanding requests (on the internal list of requests) More... | |
| static void | resetRequests (const label n) |
| Truncate outstanding requests to given length, which is expected to be in the range [0 to nRequests()]. More... | |
| static void | addRequest (UPstream::Request &req) |
| Transfer the (wrapped) MPI request to the internal global list and invalidate the parameter (ignores null requests) More... | |
| static void | cancelRequest (const label i) |
| Non-blocking comms: cancel and free outstanding request. Corresponds to MPI_Cancel() + MPI_Request_free() More... | |
| static void | cancelRequest (UPstream::Request &req) |
| Non-blocking comms: cancel and free outstanding request. Corresponds to MPI_Cancel() + MPI_Request_free() More... | |
| static void | cancelRequests (UList< UPstream::Request > &requests) |
| Non-blocking comms: cancel and free outstanding requests. Corresponds to MPI_Cancel() + MPI_Request_free() More... | |
| static void | removeRequests (label pos, label len=-1) |
| Non-blocking comms: cancel/free outstanding requests (from position onwards) and remove from internal list of requests. Corresponds to MPI_Cancel() + MPI_Request_free() More... | |
| static void | freeRequest (UPstream::Request &req) |
| Non-blocking comms: free outstanding request. Corresponds to MPI_Request_free() More... | |
| static void | freeRequests (UList< UPstream::Request > &requests) |
| Non-blocking comms: free outstanding requests. Corresponds to MPI_Request_free() More... | |
| static void | waitRequests (label pos, label len=-1) |
| Wait until all requests (from position onwards) have finished. Corresponds to MPI_Waitall() More... | |
| static void | waitRequests (UList< UPstream::Request > &requests) |
| Wait until all requests have finished. Corresponds to MPI_Waitall() More... | |
| static bool | waitAnyRequest (label pos, label len=-1) |
| Wait until any request (from position onwards) has finished. Corresponds to MPI_Waitany() More... | |
| static bool | waitSomeRequests (label pos, label len=-1, DynamicList< int > *indices=nullptr) |
| Wait until some requests (from position onwards) have finished. Corresponds to MPI_Waitsome() More... | |
| static bool | waitSomeRequests (label pos, DynamicList< int > &indices) |
| Wait until some requests (from position onwards) have finished. Corresponds to MPI_Waitsome() More... | |
| static bool | waitSomeRequests (UList< UPstream::Request > &requests, DynamicList< int > *indices=nullptr) |
| Wait until some requests have finished. Corresponds to MPI_Waitsome() More... | |
| static int | waitAnyRequest (UList< UPstream::Request > &requests) |
| Wait until any request has finished and return its index. Corresponds to MPI_Waitany() More... | |
| static void | waitRequest (const label i) |
| Wait until request i has finished. Corresponds to MPI_Wait() More... | |
| static void | waitRequest (UPstream::Request &req) |
| Wait until specified request has finished. Corresponds to MPI_Wait() More... | |
| static bool | activeRequest (const label i) |
Is request i active (!= MPI_REQUEST_NULL)? More... | |
| static bool | activeRequest (const UPstream::Request &req) |
| Is request active (!= MPI_REQUEST_NULL)? More... | |
| static bool | finishedRequest (const label i) |
| Non-blocking comms: has request i finished? Corresponds to MPI_Test() More... | |
| static bool | finishedRequest (UPstream::Request &req) |
| Non-blocking comms: has request finished? Corresponds to MPI_Test() More... | |
| static bool | finishedRequests (label pos, label len=-1) |
| Non-blocking comms: have all requests (from position onwards) finished? Corresponds to MPI_Testall() More... | |
| static bool | finishedRequests (UList< UPstream::Request > &requests) |
| Non-blocking comms: have all requests finished? Corresponds to MPI_Testall() More... | |
| static bool | finishedRequestPair (label &req0, label &req1) |
| Non-blocking comms: have both requests finished? Corresponds to pair of MPI_Test() More... | |
| static void | waitRequestPair (label &req0, label &req1) |
| Non-blocking comms: wait for both requests to finish. Corresponds to pair of MPI_Wait() More... | |
| static bool | parRun (bool on) noexcept |
| Set as parallel run on/off. More... | |
| static bool & | parRun () noexcept |
| Test if this a parallel run. More... | |
| static bool | haveThreads () noexcept |
| Have support for threads. More... | |
| static constexpr int | masterNo () noexcept |
| Relative rank for the master process - is always 0. More... | |
| static label | nProcs (label communicator=worldComm) |
| Number of ranks in parallel run (for given communicator). It is 1 for serial run. More... | |
| static int | myProcNo (label communicator=worldComm) |
| Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a rank in the communicator. More... | |
| static bool | master (label communicator=worldComm) |
| True if process corresponds to the master rank in the communicator. More... | |
| static bool | is_rank (label communicator=worldComm) |
| True if process corresponds to any rank (master or sub-rank) in the given communicator. More... | |
| static bool | is_subrank (label communicator=worldComm) |
| True if process corresponds to a sub-rank in the given communicator. More... | |
| static bool | is_parallel (label communicator=worldComm) |
| True if parallel algorithm or exchange is required. More... | |
| static int | numNodes () noexcept |
| The number of shared/host nodes in the (const) world communicator. More... | |
| static label | parent (int communicator) |
| The parent communicator. More... | |
| static List< int > & | procID (int communicator) |
| The list of ranks within a given communicator. More... | |
| static bool | sameProcs (int communicator1, int communicator2) |
| Test for communicator equality. More... | |
| template<typename T1 , typename = std::void_t <std::enable_if_t<std::is_integral_v<T1>>>> | |
| static bool | sameProcs (int communicator, const UList< T1 > &procs) |
| Test equality of communicator procs with the given list of ranks. Includes a guard for the communicator index. More... | |
| template<typename T1 , typename T2 , typename = std::void_t < std::enable_if_t<std::is_integral_v<T1>>, std::enable_if_t<std::is_integral_v<T2>> >> | |
| static bool | sameProcs (const UList< T1 > &procs1, const UList< T2 > &procs2) |
| Test the equality of two lists of ranks. More... | |
| static const wordList & | allWorlds () noexcept |
| All worlds. More... | |
| static const labelList & | worldIDs () noexcept |
| The indices into allWorlds for all processes. More... | |
| static label | myWorldID () |
| My worldID. More... | |
| static const word & | myWorld () |
| My world. More... | |
| static rangeType | allProcs (label communicator=worldComm) |
| Range of process indices for all processes. More... | |
| static rangeType | subProcs (label communicator=worldComm) |
| Range of process indices for sub-processes. More... | |
| static const List< int > & | interNode_offsets () |
| Processor offsets corresponding to the inter-node communicator. More... | |
| static const rangeType & | localNode_parentProcs () |
| The range (start/size) of the commLocalNode ranks in terms of the (const) world communicator processors. More... | |
| static const commsStructList & | linearCommunication (int communicator) |
| Linear communication schedule (special case) for given communicator. More... | |
| static const commsStructList & | treeCommunication (int communicator) |
| Tree communication schedule (standard case) for given communicator. More... | |
| static const commsStructList & | whichCommunication (const int communicator, bool linear=false) |
Communication schedule for all-to-master (proc 0) as linear/tree/none with switching based on UPstream::nProcsSimpleSum, the is_parallel() state and the optional linear parameter. More... | |
| static int & | msgType () noexcept |
| Message tag of standard messages. More... | |
| static int | msgType (int val) noexcept |
| Set the message tag for standard messages. More... | |
| static int | incrMsgType (int val=1) noexcept |
| Increment the message tag for standard messages. More... | |
| static void | shutdown (int errNo=0) |
| Shutdown (finalize) MPI as required. More... | |
| static void | abort (int errNo=1) |
| Call MPI_Abort with no other checks or cleanup. More... | |
| static void | exit (int errNo=1) |
| Shutdown (finalize) MPI as required and exit program with errNo. More... | |
| static void | allToAll (const UList< int32_t > &sendData, UList< int32_t > &recvData, const int communicator=UPstream::worldComm) |
Exchange int32_t data with all ranks in communicator. More... | |
| static void | allToAllConsensus (const UList< int32_t > &sendData, UList< int32_t > &recvData, const int tag, const int communicator=UPstream::worldComm) |
Exchange non-zero int32_t data between ranks [NBX]. More... | |
| static void | allToAllConsensus (const Map< int32_t > &sendData, Map< int32_t > &recvData, const int tag, const int communicator=UPstream::worldComm) |
Exchange int32_t data between ranks [NBX]. More... | |
| static Map< int32_t > | allToAllConsensus (const Map< int32_t > &sendData, const int tag, const int communicator=UPstream::worldComm) |
Exchange int32_t data between ranks [NBX]. More... | |
| static void | allToAll (const UList< int64_t > &sendData, UList< int64_t > &recvData, const int communicator=UPstream::worldComm) |
Exchange int64_t data with all ranks in communicator. More... | |
| static void | allToAllConsensus (const UList< int64_t > &sendData, UList< int64_t > &recvData, const int tag, const int communicator=UPstream::worldComm) |
Exchange non-zero int64_t data between ranks [NBX]. More... | |
| static void | allToAllConsensus (const Map< int64_t > &sendData, Map< int64_t > &recvData, const int tag, const int communicator=UPstream::worldComm) |
Exchange int64_t data between ranks [NBX]. More... | |
| static Map< int64_t > | allToAllConsensus (const Map< int64_t > &sendData, const int tag, const int communicator=UPstream::worldComm) |
Exchange int64_t data between ranks [NBX]. More... | |
| template<class Type > | |
| static void | mpiGather (const Type *sendData, Type *recvData, int count, const int communicator=UPstream::worldComm) |
| Receive identically-sized (contiguous) data from all ranks. More... | |
| template<class Type > | |
| static void | mpiScatter (const Type *sendData, Type *recvData, int count, const int communicator=UPstream::worldComm) |
| Send identically-sized (contiguous) data to all ranks. More... | |
| template<class Type > | |
| static void | mpiAllGather (Type *allData, int count, const int communicator=UPstream::worldComm) |
| Gather/scatter identically-sized data. More... | |
| template<class Type > | |
| static void | mpiGatherv (const Type *sendData, int sendCount, Type *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const int communicator=UPstream::worldComm) |
| Receive variable length data from all ranks. More... | |
| template<class Type > | |
| static void | mpiScatterv (const Type *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, Type *recvData, int recvCount, const int communicator=UPstream::worldComm) |
| Send variable length data to all ranks. More... | |
| template<class T > | |
| static List< T > | allGatherValues (const T &localValue, const int communicator=UPstream::worldComm) |
| Allgather individual values into list locations. More... | |
| template<class T > | |
| static List< T > | listGatherValues (const T &localValue, const int communicator=UPstream::worldComm) |
| Gather individual values into list locations. More... | |
| template<class T > | |
| static T | listScatterValues (const UList< T > &allValues, const int communicator=UPstream::worldComm) |
| Scatter individual values from list locations. More... | |
| template<class Type > | |
| static bool | broadcast (Type *buffer, std::streamsize count, const int communicator, const int root=UPstream::masterNo()) |
| Broadcast buffer contents (contiguous types) to all ranks (default: from rank=0). The sizes must match on all processes. More... | |
| template<class Type , unsigned N> | |
| static bool | broadcast (FixedList< Type, N > &list, const int communicator, const int root=UPstream::masterNo()) |
| Broadcast fixed-list content (contiguous types) to all ranks (default: from rank=0). The sizes must match on all processes. More... | |
| template<class T > | |
| static void | mpiReduce (T values[], int count, const UPstream::opCodes opCodeId, const int communicator=UPstream::worldComm) |
| MPI_Reduce (blocking) for known operators. More... | |
| template<UPstream::opCodes opCode, class T > | |
| static void | mpiReduce (T values[], int count, const int communicator=UPstream::worldComm) |
| MPI_Reduce (blocking) for known operators. More... | |
| template<class T > | |
| static void | mpiAllReduce (T values[], int count, const UPstream::opCodes opCodeId, const int communicator=UPstream::worldComm) |
| MPI_Allreduce (blocking) for known operators. More... | |
| template<UPstream::opCodes opCode, class T > | |
| static void | mpiAllReduce (T values[], int count, const int communicator=UPstream::worldComm) |
| MPI_Allreduce (blocking) for known operators. More... | |
| template<class T > | |
| static void | mpiAllReduce (T values[], int count, const UPstream::opCodes opCodeId, const int communicator, UPstream::Request &req) |
| MPI_Iallreduce (non-blocking) for known operators. More... | |
| template<UPstream::opCodes opCode, class T > | |
| static void | mpiAllReduce (T values[], int count, const int communicator, UPstream::Request &req) |
| MPI_Iallreduce (non-blocking) for known operators. More... | |
| template<class T > | |
| static void | mpiReduce_min (T values[], int count, const int communicator=UPstream::worldComm) |
MPI Reduce min. More... | |
| template<class T > | |
| static void | mpiAllReduce_min (T values[], int count, const int communicator=UPstream::worldComm) |
MPI Allreduce min. More... | |
| template<class T > | |
| static void | mpiReduce_max (T values[], int count, const int communicator=UPstream::worldComm) |
MPI Reduce max. More... | |
| template<class T > | |
| static void | mpiAllReduce_max (T values[], int count, const int communicator=UPstream::worldComm) |
MPI Allreduce max. More... | |
| template<class T > | |
| static void | mpiReduce_sum (T values[], int count, const int communicator=UPstream::worldComm) |
MPI Reduce sum. More... | |
| template<class T > | |
| static void | mpiAllReduce_sum (T values[], int count, const int communicator=UPstream::worldComm) |
MPI Allreduce sum. More... | |
| template<Foam::UPstream::opCodes opCode, class T > | |
| static void | mpiScan (T values[], int count, const int communicator, const bool exclusive=false) |
| Inclusive/exclusive scan (in-place). More... | |
| template<Foam::UPstream::opCodes opCode, class T > | |
| static T | mpiScan (const T &localValue, const int communicator, const bool exclusive=false) |
| Inclusive/exclusive scan returning the result. In exclusive mode, the degenerate value on rank=0 has no meaning but is treated like non-exclusive mode (ie, original values) More... | |
| template<class T > | |
| static void | mpiScan_min (T values[], int count, const int communicator, const bool exclusive=false) |
Inclusive/exclusive min scan (in-place) More... | |
| template<class T > | |
| static void | mpiExscan_min (T values[], int count, const int communicator) |
Exclusive min scan (in-place) More... | |
| template<class T > | |
| static T | mpiScan_min (const T &value, const int communicator, const bool exclusive=false) |
Inclusive/exclusive min scan returning result. More... | |
| template<class T > | |
| static T | mpiExscan_min (const T &value, const int communicator) |
Exclusive min scan returning result. More... | |
| template<class T > | |
| static void | mpiScan_max (T values[], int count, const int communicator, const bool exclusive=false) |
Inclusive/exclusive max scan (in-place) More... | |
| template<class T > | |
| static void | mpiExscan_max (T values[], int count, const int communicator) |
Exclusive max scan (in-place) More... | |
| template<class T > | |
| static T | mpiScan_max (const T &value, const int communicator, const bool exclusive=false) |
Inclusive/exclusive max scan returning result. More... | |
| template<class T > | |
| static T | mpiExscan_max (const T &value, const int communicator) |
Exclusive max scan returning result. More... | |
| template<class T > | |
| static void | mpiScan_sum (T values[], int count, const int communicator, const bool exclusive=false) |
Inclusive/exclusive sum scan (in-place) More... | |
| template<class T > | |
| static void | mpiExscan_sum (T values[], int count, const int communicator) |
Exclusive sum scan (in-place) More... | |
| template<class T > | |
| static T | mpiScan_sum (const T &value, const int communicator, const bool exclusive=false) |
Inclusive/exclusive sum scan returning result. More... | |
| template<class T > | |
| static T | mpiExscan_sum (const T &value, const int communicator) |
Exclusive sum scan returning result. More... | |
| static void | reduceAnd (bool &value, const int communicator=UPstream::worldComm) |
| Logical (and) reduction (MPI_AllReduce) More... | |
| static void | reduceOr (bool &value, const int communicator=UPstream::worldComm) |
| Logical (or) reduction (MPI_AllReduce) More... | |
| static int | find_first (bool condition, int communicator) |
Locate the first rank for which the condition is true, or -1 if no ranks satisfy the condition. More... | |
| static int | find_last (bool condition, int communicator) |
Locate the last rank for which the condition is true, or -1 if no ranks satisfy the condition. More... | |
| static label | allocateCommunicator (const label parent, const labelRange &subRanks, const bool withComponents=true) |
| static label | allocateCommunicator (const label parent, const labelUList &subRanks, const bool withComponents=true) |
| static void | waitRequests () |
| Wait for all requests to finish. More... | |
| template<class Type > | |
| static void | gather (const Type *send, int count, Type *recv, const UList< int > &counts, const UList< int > &offsets, const int comm=UPstream::worldComm) |
| template<class Type > | |
| static void | scatter (const Type *send, const UList< int > &counts, const UList< int > &offsets, Type *recv, int count, const int comm=UPstream::worldComm) |
Static Public Member Functions inherited from UIPstream | |
| template<class Type > | |
| static std::streamsize | read (const UPstream::commsTypes commsType, const int fromProcNo, Type *buffer, std::streamsize count, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, UPstream::Request *req=nullptr) |
| Receive buffer contents (contiguous types) from given processor. More... | |
| template<class Type > | |
| static std::streamsize | read (UPstream::Request &req, const int fromProcNo, Type *buffer, std::streamsize count, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Read buffer contents (non-blocking) from given processor. More... | |
| template<class Type > | |
| static std::streamsize | read (const UPstream::commsTypes commsType, const int fromProcNo, UList< Type > &buffer, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, UPstream::Request *req=nullptr) |
| Receive into UList storage from given processor. More... | |
| template<class Type > | |
| static std::streamsize | read (const UPstream::commsTypes commsType, const int fromProcNo, SubList< Type > buffer, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, UPstream::Request *req=nullptr) |
| Receive into SubList storage from given processor. More... | |
| template<class Type > | |
| static std::streamsize | read (UPstream::Request &req, const int fromProcNo, UList< Type > &buffer, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Receive into UList storage (non-blocking) from given processor. More... | |
| template<class Type > | |
| static std::streamsize | read (UPstream::Request &req, const int fromProcNo, SubList< Type > buffer, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm) |
| Receive into SubList storage (non-blocking) from given processor. More... | |
Static Public Member Functions inherited from IOstream | |
| static unsigned int | defaultPrecision () noexcept |
| Return the default precision. More... | |
| static unsigned int | defaultPrecision (unsigned int prec) noexcept |
| Reset the default precision. More... | |
| static unsigned int | minPrecision (unsigned int prec) noexcept |
| Set the minimum default precision. More... | |
Static Public Member Functions inherited from IOstreamOption | |
| static floatFormat | floatFormatEnum (const word &fmtName, const floatFormat deflt=floatFormat::general) |
| Lookup floatFormat enum corresponding to the string (general | fixed | scientific). More... | |
| static floatFormat | floatFormatEnum (const word &key, const dictionary &dict, const floatFormat deflt=floatFormat::general) |
| getOrDefault floatFormat from dictionary, warn only on bad enumeration. More... | |
| static streamFormat | formatEnum (const word &fmtName, const streamFormat deflt=streamFormat::ASCII) |
| Lookup streamFormat enum corresponding to the string (ascii | binary). More... | |
| static streamFormat | formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII) |
| getOrDefault streamFormat from dictionary, warn only on bad enumeration. More... | |
| static compressionType | compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED) |
| The compression enum corresponding to the string. More... | |
| static compressionType | compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED) |
| getOrDefault compressionType from dictionary, warn only on bad enumeration. More... | |
Additional Inherited Members | |
Public Types inherited from UPstream | |
| enum | commsTypes : char { buffered, scheduled, nonBlocking, blocking = buffered } |
| Communications types. More... | |
| enum | sendModes : char { normal, sync } |
| Different MPI-send modes (ignored for commsTypes::buffered) More... | |
| enum | dataTypes : char { Basic_begin, type_byte = Basic_begin, type_int16, type_int32, type_int64, type_uint16, type_uint32, type_uint64, type_float, type_double, type_long_double, Basic_end, User_begin = Basic_end, type_3float = User_begin, type_3double, type_6float, type_6double, type_9float, type_9double, invalid, User_end = invalid, DataTypes_end = invalid } |
| Mapping of some fundamental and aggregate types to MPI data types. More... | |
| enum | opCodes : char { Basic_begin, op_min = Basic_begin, op_max, op_sum, op_prod, op_bool_and, op_bool_or, op_bool_xor, op_bit_and, op_bit_or, op_bit_xor, Basic_end, Extra_begin = Basic_end, op_replace = Extra_begin, op_no_op, invalid, Extra_end = invalid, OpCodes_end = invalid } |
| Mapping of some MPI op codes. More... | |
| enum | topoControls : int { broadcast = 1, reduce = 2, gather = 4, combine = 16, mapGather = 32, gatherList = 64 } |
| Some bit masks corresponding to topology controls. More... | |
| typedef IntRange< int > | rangeType |
| Int ranges are used for MPI ranks (processes) More... | |
Public Types inherited from IOstream | |
| enum | streamAccess : char { CLOSED = 0, OPENED } |
| Enumeration for stream open/closed state. More... | |
Public Types inherited from IOstreamOption | |
| enum | streamFormat : char { ASCII = 0, BINARY, COHERENT, UNKNOWN_FORMAT } |
| Data format (ascii | binary | coherent) More... | |
| enum | compressionType : char { UNCOMPRESSED = 0, COMPRESSED } |
| Compression treatment (UNCOMPRESSED | COMPRESSED) More... | |
| enum | appendType : char { NO_APPEND = 0, APPEND_APP, APPEND_ATE, NON_APPEND = NO_APPEND, APPEND = APPEND_APP } |
| File appending (NO_APPEND | APPEND_APP | APPEND_ATE) More... | |
| enum | atomicType : char { NON_ATOMIC = 0, ATOMIC } |
| Atomic operations (output) More... | |
| enum | floatFormat : unsigned { general = unsigned(0), fixed = unsigned(std::ios_base::fixed), scientific = unsigned(std::ios_base::scientific) } |
| Float formats (eg, time directory name formats) More... | |
Public Attributes inherited from Pstream | |
| const int | tag = UPstream::msgType() |
| const int const int | communicator |
Static Public Attributes inherited from UPstream | |
| static const Enum< commsTypes > | commsTypeNames |
| Enumerated names for the communication types. More... | |
| static int | nodeCommsControl_ |
| Use of host/node topology-aware routines. More... | |
| static int | nodeCommsMin_ |
| Minimum number of nodes before topology-aware routines are enabled. More... | |
| static int | topologyControl_ |
| Selection of topology-aware routines as a bitmask combination of the topoControls enumerations. More... | |
| static bool | floatTransfer |
| Should compact transfer be used in which floats replace doubles reducing the bandwidth requirement at the expense of some loss in accuracy. More... | |
| static int | nProcsSimpleSum |
| Number of processors to change from linear to tree communication. More... | |
| static int | nProcsNonblockingExchange |
| Number of processors to change to nonBlocking consensual exchange (NBX). Ignored for zero or negative values. More... | |
| static int | nPollProcInterfaces |
| Number of polling cycles in processor updates. More... | |
| static commsTypes | defaultCommsType |
| Default commsType. More... | |
| static int | maxCommsSize |
| Optional maximum message size (bytes) More... | |
| static int | tuning_NBX_ |
| Tuning parameters for non-blocking exchange (NBX) More... | |
| static const int | mpiBufferSize |
| MPI buffer-size (bytes) More... | |
| static label | worldComm |
| Communicator for all ranks. May differ from commGlobal() if local worlds are in use. More... | |
| static label | warnComm |
| Debugging: warn for use of any communicator differing from warnComm. More... | |
Static Public Attributes inherited from IOstream | |
| static unsigned int | precision_ |
| Default precision. More... | |
Static Public Attributes inherited from IOstreamOption | |
| static const Enum< floatFormat > | floatFormatNames |
| Names for float formats (general, fixed, scientific) More... | |
| static const Enum< streamFormat > | formatNames |
| Stream format names (ascii, binary) More... | |
| static const versionNumber | currentVersion |
| The current version number (2.0) More... | |
Protected Member Functions inherited from UIPstreamBase | |
| UIPstreamBase (const UPstream::commsTypes commsType, const int fromProcNo, DynamicList< char > &receiveBuf, label &receiveBufPosition, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, const bool clearAtEnd=false, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY) | |
| Construct given process index to read from using the given attached receive buffer, optional communication characteristics and IO format. More... | |
| UIPstreamBase (const int fromProcNo, PstreamBuffers &buffers) | |
| Construct given buffers. More... | |
| UIPstreamBase (const DynamicList< char > &receiveBuf, IOstreamOption::streamFormat fmt) | |
| Construct for an externally obtained buffer. More... | |
Protected Member Functions inherited from Istream | |
| bool | hasPutback () const noexcept |
| True if putback token is in use. More... | |
Protected Member Functions inherited from IOstream | |
| void | setOpened () noexcept |
| Set stream opened. More... | |
| void | setClosed () noexcept |
| Set stream closed. More... | |
| void | setState (std::ios_base::iostate state) noexcept |
| Set stream state. More... | |
| void | setGood () noexcept |
| Set stream state to be good. More... | |
Static Protected Member Functions inherited from UPstream | |
| static bool | mpi_broadcast (void *buf, std::streamsize count, const UPstream::dataTypes dataTypeId, const int communicator, int root=0) |
| Broadcast buffer contents to all ranks (default: from rank=0). The sizes must match on all processes. More... | |
| static void | mpi_reduce (void *values, int count, const UPstream::dataTypes dataTypeId, const UPstream::opCodes opCodeId, const int communicator, UPstream::Request *req=nullptr) |
In-place reduction of values with result on rank 0. More... | |
| static void | mpi_allreduce (void *values, int count, const UPstream::dataTypes dataTypeId, const UPstream::opCodes opCodeId, const int communicator, UPstream::Request *req=nullptr) |
In-place reduction of values with same result on all ranks. More... | |
| static void | mpi_scan_reduce (void *values, int count, const UPstream::dataTypes dataTypeId, const UPstream::opCodes opCodeId, const int communicator, const bool exclusive) |
In-place scan/exscan reduction of values. More... | |
| static bool | mpi_send (const UPstream::commsTypes commsType, const void *buf, std::streamsize count, const UPstream::dataTypes dataTypeId, const int toProcNo, const int tag, const int communicator, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal) |
| Send buffer contents of specified data type to given processor. More... | |
| static std::streamsize | mpi_receive (const UPstream::commsTypes commsType, void *buf, std::streamsize count, const UPstream::dataTypes dataTypeId, const int fromProcNo, const int tag, const int communicator, UPstream::Request *req=nullptr) |
| Receive buffer contents of specified data type from given processor. More... | |
| static void | mpi_gather (const void *sendData, void *recvData, int count, const UPstream::dataTypes dataTypeId, const int communicator, UPstream::Request *req=nullptr) |
| Receive identically-sized (contiguous) data from all ranks, placing the result on rank 0. More... | |
| static void | mpi_scatter (const void *sendData, void *recvData, int count, const UPstream::dataTypes dataTypeId, const int communicator, UPstream::Request *req=nullptr) |
| Send identically-sized (contiguous) data from rank 0 to all other ranks. More... | |
| static void | mpi_allgather (void *allData, int count, const UPstream::dataTypes dataTypeId, const int communicator, UPstream::Request *req=nullptr) |
| Gather/scatter identically-sized data. More... | |
| static void | mpi_gatherv (const void *sendData, int sendCount, void *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const UPstream::dataTypes dataTypeId, const int communicator) |
| Receive variable length data from all ranks, placing the result on rank 0. (caution: known to scale poorly) More... | |
| static void | mpi_scatterv (const void *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, void *recvData, int recvCount, const UPstream::dataTypes dataTypeId, const int communicator) |
| Send variable length data from rank 0 to all ranks. (caution: known to scale poorly) More... | |
Protected Attributes inherited from Pstream | |
| DynamicList< char > | transferBuf_ |
| Allocated transfer buffer (can be used for send or receive) More... | |
Protected Attributes inherited from UIPstreamBase | |
| int | fromProcNo_ |
| Source rank for the data. More... | |
| const int | tag_ |
| Message tag for communication. More... | |
| const int | comm_ |
| The communicator index. More... | |
| label | messageSize_ |
| The message size, read on bufferIPCrecv or set directly. More... | |
| label | storedRecvBufPos_ |
| Receive position in buffer data. If there is no external location for recvBufPos_. More... | |
| const bool | clearAtEnd_ |
| Clear the receive buffer on termination (in the destructor) More... | |
| DynamicList< char > & | recvBuf_ |
| Reference to the receive buffer data. More... | |
| label & | recvBufPos_ |
| Reference to the receive position in buffer data. More... | |
Protected Attributes inherited from IOstream | |
| std::ios_base::iostate | ioState_ |
| Mirror of internal stream io state. More... | |
| streamAccess | openClosed_ |
| The stream open/closed state. More... | |
| unsigned char | sizeofLabel_ |
| The sizeof (label), possibly read from the header. More... | |
| unsigned char | sizeofScalar_ |
| The sizeof (scalar), possibly read from the header. More... | |
| label | lineNumber_ |
| The file line. More... | |
Static Protected Attributes inherited from IOstream | |
| static fileName | staticName_ |
| Name for any generic stream - normally treat as readonly. More... | |
| IPstream | ( | const UPstream::commsTypes | commsType, |
| const int | fromProcNo, | ||
| const int | bufferSize = 0, |
||
| const int | tag = UPstream::msgType(), |
||
| const int | communicator = UPstream::worldComm, |
||
| IOstreamOption::streamFormat | fmt = IOstreamOption::BINARY |
||
| ) |
Construct given process index to read from.
| commsType | Using nonBlocking probably does not work! |
| fromProcNo | The source rank (negative == ANY_SOURCE) |
| bufferSize | optional buffer size |
Definition at line 99 of file IPstreams.C.
|
inlineexplicit |
Construct given process index to read from. Uses MPI_Probe and MPI_Recv.
| fromProcNo | The source rank (negative == ANY_SOURCE) |
Definition at line 79 of file IPstream.H.
| Foam::DynamicList< char > release | ( | ) |
Release contents of the input buffer and reset the stream.
Definition at line 125 of file IPstreams.C.
References UIPstreamBase::messageSize_, UIPstreamBase::recvBufPos_, UIPstreamBase::rewind(), UIPstreamBase::storedRecvBufPos_, and Pstream::transferBuf_.

|
inlinestatic |
Receive and deserialize a value. Uses operator>> for de-serialization.
Definition at line 115 of file IPstream.H.
References Pstream::tag.
Referenced by LUscalarMatrix::LUscalarMatrix(), argList::parse(), mapDistributeBase::schedule(), syncTools::syncEdgeMap(), and syncTools::syncPointMap().
