35 bool Foam::UOPstream::bufferIPCsend()
56 const std::streamsize bufSize,
58 const label communicator,
59 UPstream::Request* req,
67 if (bufSize > std::streamsize(INT_MAX))
69 Perr<<
"UOPstream::write() : to rank " << toProcNo
77 Perr<<
"UOPstream::write : starting write to:" << toProcNo
78 <<
" size:" << label(bufSize)
79 <<
" tag:" << tag <<
" comm:" << communicator
87 Perr<<
"UOPstream::write : starting write to:" << toProcNo
88 <<
" size:" << label(bufSize)
89 <<
" tag:" << tag <<
" comm:" << communicator
96 int returnCode = MPI_ERR_UNKNOWN;
102 returnCode = MPI_Bsend
104 const_cast<char*>(buf),
117 Perr<<
"UOPstream::write : finished buffered send to:" 119 <<
" size:" << label(bufSize) <<
" tag:" << tag
127 returnCode = MPI_Ssend
129 const_cast<char*>(buf),
139 returnCode = MPI_Send
141 const_cast<char*>(buf),
155 Perr<<
"UOPstream::write : finished send to:" 157 <<
" size:" << label(bufSize) <<
" tag:" << tag
167 returnCode = MPI_Issend
169 const_cast<char*>(buf),
180 returnCode = MPI_Isend
182 const_cast<char*>(buf),
194 Perr<<
"UOPstream::write : started non-blocking send to:" 196 <<
" size:" << label(bufSize) <<
" tag:" << tag
208 <<
"Unsupported communications type " << int(commsType)
212 return (returnCode == MPI_SUCCESS);
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
void size(const label n)
Older name for setAddressableSize.
sendModes
Different MPI-send modes (ignored for commsTypes::buffered)
DynamicList< MPI_Request > outstandingRequests_
Outstanding non-blocking operations.
static const Enum< commsTypes > commsTypeNames
Enumerated names for the communication types.
commsTypes
Communications types.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const int comm_
The communicator index.
DynamicList< MPI_Comm > MPICommunicators_
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reset_request(UPstream::Request *requestPtr, label *requestIdx=nullptr)
Reset UPstream::Request to null and/or the index of the outstanding request to -1.
void checkCommunicator(const label comm, const label toProcNo)
Fatal if comm is outside the allocated range.
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
const int toProcNo_
Destination rank for the data.
DynamicList< char > & sendBuf_
Reference to the send buffer data.
static void addScatterTime()
Add time increment to scatter time.
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
errorManip< error > abort(error &err)
commsTypes commsType() const noexcept
Get the communications type of the stream.
static void beginTiming()
Update timer prior to measurement.
int debug
Static debugging option.
static void addRequestTime()
Add time increment to request time.
void push_request(MPI_Request request, UPstream::Request *requestPtr=nullptr, label *requestIdx=nullptr)
Transcribe MPI_Request to UPstream::Request (does not affect the stack of outstanding requests) or el...
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal)
Write buffer contents to given processor.
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
static void printStack(Ostream &os, int size=-1)
Helper function to print a stack, with optional upper limit.
const T * cdata() const noexcept
Return pointer to the underlying array serving as data storage.
const int tag_
Message tag for communication.
"buffered" : (MPI_Bsend, MPI_Recv)