Go to the documentation of this file.
39 const commsTypes commsType,
41 DynamicList<char>& externalBuf,
42 label& externalBufPosition,
45 const bool clearAtEnd,
52 fromProcNo_(fromProcNo),
53 externalBuf_(externalBuf),
54 externalBufPosition_(externalBufPosition),
57 clearAtEnd_(clearAtEnd),
75 Pout<<
"UIPstream::UIPstream : read from:" << fromProcNo
76 <<
" tag:" << tag <<
" comm:" <<
comm_
77 <<
" wanted size:" << wantedSize
100 Pout<<
"UIPstream::UIPstream : probed size:" << wantedSize
128 UPstream(buffers.commsType_),
129 Istream(buffers.format_, buffers.version_),
130 fromProcNo_(fromProcNo),
131 externalBuf_(buffers.recvBuf_[fromProcNo]),
132 externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
134 comm_(buffers.comm_),
141 <<
"PstreamBuffers::finishedSends() never called." <<
endl
142 <<
"Please call PstreamBuffers::finishedSends() after doing"
143 <<
" all your sends (using UOPstream) and before doing any"
157 Pout<<
"UIPstream::UIPstream PstreamBuffers :"
158 <<
" fromProcNo:" << fromProcNo
172 Pout<<
"UIPstream::UIPstream PstreamBuffers :"
173 <<
" read from:" << fromProcNo
175 <<
" wanted size:" << wantedSize
197 Pout<<
"UIPstream::UIPstream PstreamBuffers : probed size:"
227 const commsTypes commsType,
228 const int fromProcNo,
230 const std::streamsize bufSize,
232 const label communicator
237 Pout<<
"UIPstream::read : starting read from:" << fromProcNo
238 <<
" tag:" << tag <<
" comm:" << communicator
239 <<
" wanted size:" <<
label(bufSize)
245 Pout<<
"UIPstream::read : starting read from:" << fromProcNo
246 <<
" tag:" << tag <<
" comm:" << communicator
247 <<
" wanted size:" <<
label(bufSize)
254 if (commsType == blocking || commsType == scheduled)
273 <<
"MPI_Recv cannot receive incomming message"
283 MPI_Get_count(&status, MPI_BYTE, &messageSize);
287 Pout<<
"UIPstream::read : finished read from:" << fromProcNo
288 <<
" tag:" << tag <<
" read size:" <<
label(bufSize)
293 if (messageSize > bufSize)
296 <<
"buffer (" <<
label(bufSize)
297 <<
") not large enough for incomming message ("
298 << messageSize <<
')'
304 else if (commsType == nonBlocking)
323 <<
"MPI_Recv cannot start non-blocking receive"
331 Pout<<
"UIPstream::read : started read from:" << fromProcNo
332 <<
" tag:" << tag <<
" read size:" <<
label(bufSize)
346 <<
"Unsupported communications type "
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
word format(conversionProperties.lookup("format"))
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
label capacity() const
Size of the underlying storage.
DynamicList< char > & externalBuf_
void setEof()
Set stream to have reached eof.
static const NamedEnum< commsTypes, 3 > commsTypeNames
Ostream & endl(Ostream &os)
Add newline and flush stream.
DynamicList< MPI_Comm > MPICommunicators_
void setOpened()
Set stream opened.
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Read into given buffer from given processor and return the.
static void printStack(Ostream &)
Helper function to print a stack.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void setCapacity(const label)
Alter the size of the underlying storage.
commsTypes commsType() const
Get the communications type of the stream.
errorManip< error > abort(error &err)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
prefixOSstream Pout(cout, "Pout")
void setGood()
Set stream to be good.
DynamicList< MPI_Request > outstandingRequests_
UIPstream(const commsTypes commsType, const int fromProcNo, DynamicList< char > &externalBuf, label &externalBufPosition, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool clearAtEnd=false, streamFormat format=BINARY, versionNumber version=currentVersion)
Construct given process index to read from and optional buffer size,.
void setSize(const label)
Alter the addressed list size.