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

Method GatherVVoidArray

Parallel/Core/vtkCommunicator.cxx:1232–1261  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1230
1231//------------------------------------------------------------------------------
1232int 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//------------------------------------------------------------------------------
1264int vtkCommunicator::GatherV(vtkDataArray* sendBuffer, vtkDataArray* recvBuffer, int destProcessId)

Callers 3

GatherVMethod · 0.95
AllGatherVVoidArrayMethod · 0.95
GatherVFunction · 0.45

Calls 2

ReceiveVoidArrayMethod · 0.45
SendVoidArrayMethod · 0.45

Tested by

no test coverage detected