------------------------------------------------------------------------------
| 1230 | |
| 1231 | //------------------------------------------------------------------------------ |
| 1232 | int vtkCommunicator::GatherVVoidArray(const void* sendBuffer, void* recvBuffer, |
| 1233 | vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets, int type, int destProcessId) |
| 1234 | { |
| 1235 | if (this->LocalProcessId == destProcessId) |
| 1236 | { |
| 1237 | int result = 1; |
| 1238 | char* dest = reinterpret_cast<char*>(recvBuffer); |
| 1239 | int typeSize = 1; |
| 1240 | switch (type) |
| 1241 | { |
| 1242 | vtkTemplateMacro(typeSize = sizeof(VTK_TT)); |
| 1243 | } |
| 1244 | // Copy local data first in case buffers are the same. |
| 1245 | memmove(dest + offsets[this->LocalProcessId] * typeSize, sendBuffer, sendLength * typeSize); |
| 1246 | // Receive everything else. |
| 1247 | for (int i = 0; i < this->NumberOfProcesses; i++) |
| 1248 | { |
| 1249 | if (this->LocalProcessId != i) |
| 1250 | { |
| 1251 | result &= this->ReceiveVoidArray( |
| 1252 | dest + offsets[i] * typeSize, recvLengths[i], type, i, GATHERV_TAG); |
| 1253 | } |
| 1254 | } |
| 1255 | return result; |
| 1256 | } |
| 1257 | else |
| 1258 | { |
| 1259 | return this->SendVoidArray(sendBuffer, sendLength, type, destProcessId, GATHERV_TAG); |
| 1260 | } |
| 1261 | } |
| 1262 | |
| 1263 | //------------------------------------------------------------------------------ |
| 1264 | int vtkCommunicator::GatherV(vtkDataArray* sendBuffer, vtkDataArray* recvBuffer, int destProcessId) |
no test coverage detected