------------------------------------------------------------------------------
| 1378 | |
| 1379 | //------------------------------------------------------------------------------ |
| 1380 | int vtkCommunicator::Scatter(vtkDataArray* sendBuffer, vtkDataArray* recvBuffer, int srcProcessId) |
| 1381 | { |
| 1382 | int type = recvBuffer->GetDataType(); |
| 1383 | const void* sb = nullptr; |
| 1384 | void* rb = recvBuffer->GetVoidPointer(0); |
| 1385 | int numComponents = recvBuffer->GetNumberOfComponents(); |
| 1386 | vtkIdType numTuples = recvBuffer->GetNumberOfTuples(); |
| 1387 | if (this->LocalProcessId == srcProcessId) |
| 1388 | { |
| 1389 | if (type != sendBuffer->GetDataType()) |
| 1390 | { |
| 1391 | vtkErrorMacro(<< "Data type mismatch."); |
| 1392 | return 0; |
| 1393 | } |
| 1394 | if (sendBuffer->GetNumberOfComponents() * sendBuffer->GetNumberOfTuples() < |
| 1395 | numComponents * numTuples) |
| 1396 | { |
| 1397 | vtkErrorMacro(<< "Send buffer not large enough for requested data."); |
| 1398 | return 0; |
| 1399 | } |
| 1400 | sb = sendBuffer->GetVoidPointer(0); |
| 1401 | } |
| 1402 | return this->ScatterVoidArray(sb, rb, numComponents * numTuples, type, srcProcessId); |
| 1403 | } |
| 1404 | |
| 1405 | //------------------------------------------------------------------------------ |
| 1406 | int vtkCommunicator::ScatterVVoidArray(const void* sendBuffer, void* recvBuffer, |