35bool Foam::UOPstream::bufferIPCsend()
56 std::streamsize count,
60 const int communicator,
74 if (count > std::streamsize(INT_MAX))
76 Perr<<
"[mpi_send] : to rank " << toProcNo
77 <<
" type:" << int(dataTypeId)
78 <<
" exceeds INT_MAX values"
87 Perr<<
"[mpi_send] : starting send to:" << toProcNo
88 <<
" type:" << int(dataTypeId)
89 <<
" count:" << label(count)
90 <<
" tag:" << tag <<
" comm:" << communicator
98 Perr<<
"[mpi_send] : starting send to:" << toProcNo
99 <<
" type:" << int(dataTypeId)
100 <<
" count:" << label(count)
101 <<
" tag:" << tag <<
" comm:" << communicator
108 int returnCode = MPI_ERR_UNKNOWN;
114 returnCode = MPI_Bsend
129 Perr<<
"[mpi_send] : finished buffered send to:"
131 <<
" count:" << label(count) <<
" tag:" << tag
139 returnCode = MPI_Ssend
151 returnCode = MPI_Send
167 Perr<<
"[mpi_send] : finished send to:"
169 <<
" type:" << int(dataTypeId)
170 <<
" count:" << label(count) <<
" tag:" << tag
180 returnCode = MPI_Issend
193 returnCode = MPI_Isend
207 Perr<<
"[mpi_send] : started non-blocking send to:"
209 <<
" type:" << int(dataTypeId)
210 <<
" count:" << label(count) <<
" tag:" << tag
222 <<
"Unsupported communications type " << int(commsType)
227 return (returnCode == MPI_SUCCESS);
DynamicList< char > & sendBuf_
Reference to the send buffer data.
const int toProcNo_
Destination rank for the data.
const int tag_
Message tag for communication.
const int comm_
The communicator index.
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const Type *buffer, std::streamsize count, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal)
Write buffer contents (contiguous types only) to given processor.
An opaque wrapper for MPI_Request with a vendor-independent representation without any <mpi....
commsTypes
Communications types.
@ scheduled
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
static const Enum< commsTypes > commsTypeNames
Enumerated names for the communication types.
sendModes
Different MPI-send modes (ignored for commsTypes::buffered).
@ sync
(MPI_Ssend, MPI_Issend)
commsTypes commsType() const noexcept
Get the communications type of the stream.
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.
dataTypes
Mapping of some fundamental and aggregate types to MPI data types.
static void printStack(Ostream &os, int size=-1)
Helper function to print a stack, with optional upper limit.
static void addScatterTime()
Add time increment to scatter time.
static void beginTiming()
Update timer prior to measurement.
static void addRequestTime()
Add time increment to request time.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Global functions and variables for working with parallel streams, but principally for MPI.
DynamicList< MPI_Request > outstandingRequests_
Outstanding non-blocking operations.
MPI_Datatype getDataType(UPstream::dataTypes id)
Lookup of dataTypes enumeration as an MPI_Datatype.
DynamicList< MPI_Comm > MPICommunicators_
void push_request(MPI_Request request, UPstream::Request *req=nullptr)
Transcribe MPI_Request to UPstream::Request (does not affect the stack of outstanding requests) or el...
void reset_request(UPstream::Request *req) noexcept
Reset UPstream::Request to MPI_REQUEST_NULL.
void checkCommunicator(int comm, int rank)
Fatal if communicator is outside the allocated range.
bool warnCommunicator(int comm) noexcept
True if warn communicator is active and not equal to given communicator.
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FOAM_UNLIKELY(cond)