43 const commsTypes commsType,
45 DynamicList<char>& receiveBuf,
46 label& receiveBufPosition,
49 const bool clearAtEnd,
50 IOstreamOption::streamFormat fmt
54 Istream(fmt, IOstreamOption::currentVersion),
55 fromProcNo_(fromProcNo),
57 recvBufPos_(receiveBufPosition),
60 clearAtEnd_(clearAtEnd),
74 Pout<<
"UIPstream::UIPstream :"
75 <<
" read from:" << fromProcNo
76 <<
" tag:" << tag_ <<
" comm:" << comm_
77 <<
" wanted size:" << recvBuf_.
capacity()
95 MPI_Get_count(&status, MPI_BYTE, &messageSize_);
100 recvBuf_.
resize(messageSize_);
104 Pout<<
"UIPstream::UIPstream : probed size:"
120 recvBuf_.
resize(messageSize_);
132 UPstream(buffers.commsType_),
133 Istream(buffers.format_, IOstreamOption::currentVersion),
134 fromProcNo_(fromProcNo),
135 recvBuf_(buffers.recvBuf_[fromProcNo]),
136 recvBufPos_(buffers.recvBufPos_[fromProcNo]),
138 comm_(buffers.comm_),
145 && !buffers.finishedSendsCalled_
149 <<
"PstreamBuffers::finishedSends() never called." <<
endl
150 <<
"Please call PstreamBuffers::finishedSends() after doing"
151 <<
" all your sends (using UOPstream) and before doing any"
161 messageSize_ = recvBuf_.size();
165 Pout<<
"UIPstream::UIPstream PstreamBuffers :"
166 <<
" fromProcNo:" << fromProcNo
167 <<
" tag:" << tag_ <<
" comm:" << comm_
168 <<
" receive buffer size:" << messageSize_
176 Pout<<
"UIPstream::UIPstream PstreamBuffers :"
177 <<
" read from:" << fromProcNo
178 <<
" tag:" << tag_ <<
" comm:" << comm_
179 <<
" wanted size:" << recvBuf_.
capacity()
197 MPI_Get_count(&status, MPI_BYTE, &messageSize_);
202 recvBuf_.
resize(messageSize_);
206 Pout<<
"UIPstream::UIPstream PstreamBuffers : probed size:"
222 recvBuf_.
resize(messageSize_);
236 const commsTypes commsType,
237 const int fromProcNo,
239 const std::streamsize bufSize,
241 const label communicator
246 Pout<<
"UIPstream::read : starting read from:" << fromProcNo
247 <<
" tag:" << tag <<
" comm:" << communicator
248 <<
" wanted size:" << label(bufSize)
254 Pout<<
"UIPstream::read : starting read from:" << fromProcNo
255 <<
" tag:" << tag <<
" comm:" << communicator
256 <<
" wanted size:" << label(bufSize)
267 commsType == commsTypes::blocking
268 || commsType == commsTypes::scheduled
288 <<
"MPI_Recv cannot receive incoming message"
299 MPI_Get_count(&status, MPI_BYTE, &messageSize);
303 Pout<<
"UIPstream::read : finished read from:" << fromProcNo
304 <<
" tag:" << tag <<
" read size:" << label(bufSize)
309 if (messageSize > bufSize)
312 <<
"buffer (" << label(bufSize)
313 <<
") not large enough for incoming message ("
314 << messageSize <<
')'
320 else if (commsType == commsTypes::nonBlocking)
339 <<
"MPI_Recv cannot start non-blocking receive"
349 Pout<<
"UIPstream::read : started read from:" << fromProcNo
350 <<
" tag:" << tag <<
" read size:" << label(bufSize)
363 <<
"Unsupported communications type " << int(commsType)