------------------------------------------------------------------------------
| 1345 | |
| 1346 | //------------------------------------------------------------------------------ |
| 1347 | int vtkCommunicator::ScatterVoidArray( |
| 1348 | const void* sendBuffer, void* recvBuffer, vtkIdType length, int type, int srcProcessId) |
| 1349 | { |
| 1350 | if (this->LocalProcessId == srcProcessId) |
| 1351 | { |
| 1352 | int result = 1; |
| 1353 | const char* src = reinterpret_cast<const char*>(sendBuffer); |
| 1354 | int typeSize = 1; |
| 1355 | switch (type) |
| 1356 | { |
| 1357 | vtkTemplateMacro(typeSize = sizeof(VTK_TT)); |
| 1358 | } |
| 1359 | // Send to everywhere. |
| 1360 | for (int i = 0; i < this->NumberOfProcesses; i++) |
| 1361 | { |
| 1362 | if (this->LocalProcessId == i) |
| 1363 | { |
| 1364 | memmove(recvBuffer, src + this->LocalProcessId * length * typeSize, length * typeSize); |
| 1365 | } |
| 1366 | else |
| 1367 | { |
| 1368 | result &= this->SendVoidArray(src + i * length * typeSize, length, type, i, SCATTER_TAG); |
| 1369 | } |
| 1370 | } |
| 1371 | return result; |
| 1372 | } |
| 1373 | else |
| 1374 | { |
| 1375 | return this->ReceiveVoidArray(recvBuffer, length, type, srcProcessId, SCATTER_TAG); |
| 1376 | } |
| 1377 | } |
| 1378 | |
| 1379 | //------------------------------------------------------------------------------ |
| 1380 | int vtkCommunicator::Scatter(vtkDataArray* sendBuffer, vtkDataArray* recvBuffer, int srcProcessId) |
no test coverage detected