42 label nBytes =
f.byteSize();
46 commsType == Pstream::commsTypes::blocking
47 || commsType == Pstream::commsTypes::scheduled
60 else if (commsType == Pstream::commsTypes::nonBlocking)
62 resizeBuf(receiveBuf_, nBytes);
74 resizeBuf(sendBuf_, nBytes);
77 static_cast<void*
>(sendBuf_.data()),
f.cdata(), nBytes
93 <<
"Unsupported communications type " << int(commsType)
108 commsType == Pstream::commsTypes::blocking
109 || commsType == Pstream::commsTypes::scheduled
122 else if (commsType == Pstream::commsTypes::nonBlocking)
126 static_cast<void*
>(
f.data()), receiveBuf_.cdata(),
f.byteSize()
132 <<
"Unsupported communications type " << int(commsType)
146 receive(commsType, tfld.ref());
158 if (
sizeof(scalar) !=
sizeof(
float) && Pstream::floatTransfer &&
f.size())
160 static const label nCmpts =
sizeof(Type)/
sizeof(scalar);
161 label nm1 = (
f.size() - 1)*nCmpts;
162 label nlast =
sizeof(Type)/
sizeof(
float);
163 label nFloats = nm1 + nlast;
164 label nBytes = nFloats*
sizeof(float);
166 const scalar *sArray =
reinterpret_cast<const scalar*
>(
f.cdata());
167 const scalar *slast = &sArray[nm1];
168 resizeBuf(sendBuf_, nBytes);
169 float *fArray =
reinterpret_cast<float*
>(sendBuf_.data());
171 for (label i=0; i<nm1; i++)
173 fArray[i] = sArray[i] - slast[i%nCmpts];
176 reinterpret_cast<Type&
>(fArray[nm1]) =
f.last();
180 commsType == Pstream::commsTypes::blocking
181 || commsType == Pstream::commsTypes::scheduled
194 else if (commsType == Pstream::commsTypes::nonBlocking)
196 resizeBuf(receiveBuf_, nBytes);
221 <<
"Unsupported communications type " << int(commsType)
227 this->send(commsType,
f);
239 if (
sizeof(scalar) !=
sizeof(
float) && Pstream::floatTransfer &&
f.size())
241 static const label nCmpts =
sizeof(Type)/
sizeof(scalar);
242 label nm1 = (
f.size() - 1)*nCmpts;
243 label nlast =
sizeof(Type)/
sizeof(
float);
244 label nFloats = nm1 + nlast;
245 label nBytes = nFloats*
sizeof(float);
249 commsType == Pstream::commsTypes::blocking
250 || commsType == Pstream::commsTypes::scheduled
253 resizeBuf(receiveBuf_, nBytes);
265 else if (commsType != Pstream::commsTypes::nonBlocking)
268 <<
"Unsupported communications type " << int(commsType)
272 const float *fArray =
273 reinterpret_cast<const float*
>(receiveBuf_.cdata());
274 f.last() =
reinterpret_cast<const Type&
>(fArray[nm1]);
275 scalar *sArray =
reinterpret_cast<scalar*
>(
f.data());
276 const scalar *slast = &sArray[nm1];
278 for (label i=0; i<nm1; i++)
280 sArray[i] = fArray[i] + slast[i%nCmpts];
285 this->receive<Type>(commsType,
f);
298 compressedReceive(commsType, tfld.ref());