MCPcopy Create free account
hub / github.com/Kitware/VTK / ScatterVVoidArray

Method ScatterVVoidArray

Parallel/Core/vtkCommunicator.cxx:1406–1435  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1404
1405//------------------------------------------------------------------------------
1406int vtkCommunicator::ScatterVVoidArray(const void* sendBuffer, void* recvBuffer,
1407 vtkIdType* sendLengths, vtkIdType* offsets, vtkIdType recvLength, int type, int srcProcessId)
1408{
1409 if (this->LocalProcessId == srcProcessId)
1410 {
1411 int result = 1;
1412 const char* src = reinterpret_cast<const char*>(sendBuffer);
1413 int typeSize = 1;
1414 switch (type)
1415 {
1416 vtkTemplateMacro(typeSize = sizeof(VTK_TT));
1417 }
1418 // Send to everywhere except myself.
1419 for (int i = 0; i < this->NumberOfProcesses; i++)
1420 {
1421 if (this->LocalProcessId != i)
1422 {
1423 result &=
1424 this->SendVoidArray(src + offsets[i] * typeSize, sendLengths[i], type, i, SCATTERV_TAG);
1425 }
1426 }
1427 // Send to myself last in case send and receive buffers are the same.
1428 memmove(recvBuffer, src + offsets[this->LocalProcessId] * typeSize, recvLength * typeSize);
1429 return result;
1430 }
1431 else
1432 {
1433 return this->ReceiveVoidArray(recvBuffer, recvLength, type, srcProcessId, SCATTERV_TAG);
1434 }
1435}
1436
1437//------------------------------------------------------------------------------
1438int vtkCommunicator::AllGatherVoidArray(

Callers 2

ReadPointDataArrayMethod · 0.45
ScatterVFunction · 0.45

Calls 2

SendVoidArrayMethod · 0.45
ReceiveVoidArrayMethod · 0.45

Tested by

no test coverage detected