39 if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
45 reinterpret_cast<const char*>(f.
begin()),
49 else if (commsType == Pstream::nonBlocking)
51 resizeBuf(receiveBuf_, f.
size()*
sizeof(Type));
75 <<
"Unsupported communications type " << commsType
88 if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
94 reinterpret_cast<char*>(f.
begin()),
98 else if (commsType == Pstream::nonBlocking)
105 <<
"Unsupported communications type " << commsType
119 receive(commsType,
tf());
131 if (
sizeof(scalar) !=
sizeof(
float) && Pstream::floatTransfer && f.
size())
133 static const label nCmpts =
sizeof(Type)/
sizeof(scalar);
134 label nm1 = (f.
size() - 1)*nCmpts;
135 label nlast =
sizeof(Type)/
sizeof(
float);
136 label nFloats = nm1 + nlast;
137 label nBytes = nFloats*
sizeof(float);
139 const scalar *sArray =
reinterpret_cast<const scalar*
>(f.
begin());
140 const scalar *slast = &sArray[nm1];
141 resizeBuf(sendBuf_, nBytes);
142 float *fArray =
reinterpret_cast<float*
>(sendBuf_.begin());
144 for (
register label i=0; i<nm1; i++)
146 fArray[i] = sArray[i] - slast[i%nCmpts];
149 reinterpret_cast<Type&
>(fArray[nm1]) = f[f.
size() - 1];
151 if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
161 else if (commsType == Pstream::nonBlocking)
163 resizeBuf(receiveBuf_, nBytes);
184 <<
"Unsupported communications type " << commsType
190 this->send(commsType, f);
201 if (
sizeof(scalar) !=
sizeof(
float) && Pstream::floatTransfer && f.
size())
203 static const label nCmpts =
sizeof(Type)/
sizeof(scalar);
204 label nm1 = (f.
size() - 1)*nCmpts;
205 label nlast =
sizeof(Type)/
sizeof(
float);
206 label nFloats = nm1 + nlast;
207 label nBytes = nFloats*
sizeof(float);
209 if (commsType == Pstream::blocking || commsType == Pstream::scheduled)
211 resizeBuf(receiveBuf_, nBytes);
221 else if (commsType != Pstream::nonBlocking)
223 FatalErrorIn(
"processorLduInterface::compressedReceive")
224 <<
"Unsupported communications type " << commsType
228 const float *fArray =
229 reinterpret_cast<const float*
>(receiveBuf_.begin());
230 f[f.
size() - 1] =
reinterpret_cast<const Type&
>(fArray[nm1]);
231 scalar *sArray =
reinterpret_cast<scalar*
>(f.
begin());
232 const scalar *slast = &sArray[nm1];
234 for (
register label i=0; i<nm1; i++)
236 sArray[i] = fArray[i] + slast[i%nCmpts];
241 this->receive<Type>(commsType,
f);
253 compressedReceive(commsType,
tf());