39 const commsTypes commsType,
41 DynamicList<char>& externalBuf,
42 label& externalBufPosition,
45 const bool clearAtEnd,
51 Istream(format, version),
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
93 MPI_Get_count(&status, MPI_BYTE, &messageSize_);
96 wantedSize = messageSize_;
100 Pout<<
"UIPstream::UIPstream : probed size:" << wantedSize
109 externalBuf_.
begin(),
116 externalBuf_.
setSize(messageSize_);
129 Istream(buffers.format_, buffers.version_),
130 fromProcNo_(fromProcNo),
131 externalBuf_(buffers.recvBuf_[fromProcNo]),
132 externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
134 comm_(buffers.comm_),
141 && !buffers.finishedSendsCalled_
145 <<
"PstreamBuffers::finishedSends() never called." <<
endl 146 <<
"Please call PstreamBuffers::finishedSends() after doing" 147 <<
" all your sends (using UOPstream) and before doing any" 157 messageSize_ = buffers.recvBuf_[fromProcNo].size();
161 Pout<<
"UIPstream::UIPstream PstreamBuffers :" 162 <<
" fromProcNo:" << fromProcNo
163 <<
" tag:" << tag_ <<
" comm:" << comm_
164 <<
" receive buffer size:" << messageSize_
176 Pout<<
"UIPstream::UIPstream PstreamBuffers :" 177 <<
" read from:" << fromProcNo
178 <<
" tag:" << tag_ <<
" comm:" << comm_
179 <<
" wanted size:" << wantedSize
194 MPI_Get_count(&status, MPI_BYTE, &messageSize_);
197 wantedSize = messageSize_;
201 Pout<<
"UIPstream::UIPstream PstreamBuffers : probed size:" 210 externalBuf_.
begin(),
217 externalBuf_.
setSize(messageSize_);
232 const int fromProcNo,
234 const std::streamsize bufSize,
236 const label communicator
241 Pout<<
"UIPstream::read : starting read from:" << fromProcNo
242 <<
" tag:" << tag <<
" comm:" << communicator
243 <<
" wanted size:" <<
label(bufSize)
249 Pout<<
"UIPstream::read : starting read from:" << fromProcNo
250 <<
" tag:" << tag <<
" comm:" << communicator
251 <<
" wanted size:" <<
label(bufSize)
277 <<
"MPI_Recv cannot receive incoming message" 287 MPI_Get_count(&status, MPI_BYTE, &messageSize);
291 Pout<<
"UIPstream::read : finished read from:" << fromProcNo
292 <<
" tag:" << tag <<
" read size:" <<
label(bufSize)
297 if (messageSize > bufSize)
300 <<
"buffer (" <<
label(bufSize)
301 <<
") not large enough for incoming message (" 302 << messageSize <<
')' 327 <<
"MPI_Recv cannot start non-blocking receive" 335 Pout<<
"UIPstream::read : started read from:" << fromProcNo
336 <<
" tag:" << tag <<
" read size:" <<
label(bufSize)
350 <<
"Unsupported communications type " 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,.
static void printStack(Ostream &)
Helper function to print a stack.
commsTypes commsType() const
Get the communications type of the stream.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
commsTypes
Types of communications.
void setGood()
Set stream to be good.
commsTypes commsType_
Communications type of this stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
DynamicList< MPI_Request > outstandingRequests_
Istream(streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
Set stream status.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
void setSize(const label)
Alter the addressed list size.
void setCapacity(const label)
Alter the size of the underlying storage.
iterator begin()
Return an iterator to begin traversing the UList.
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
errorManip< error > abort(error &err)
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 const NamedEnum< commsTypes, 3 > commsTypeNames
void setEof()
Set stream to have reached eof.
void setOpened()
Set stream opened.
UPstream(const commsTypes commsType)
Construct given optional buffer size.
prefixOSstream Pout(cout, "Pout")
DynamicList< MPI_Comm > MPICommunicators_
label capacity() const
Size of the underlying storage.