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

Method ScatterVoidArray

Parallel/Core/vtkCommunicator.cxx:1347–1377  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1345
1346//------------------------------------------------------------------------------
1347int 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//------------------------------------------------------------------------------
1380int vtkCommunicator::Scatter(vtkDataArray* sendBuffer, vtkDataArray* recvBuffer, int srcProcessId)

Callers 2

ScatterMethod · 0.95
ScatterFunction · 0.45

Calls 2

SendVoidArrayMethod · 0.45
ReceiveVoidArrayMethod · 0.45

Tested by

no test coverage detected