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

Method PackGhostData

Filters/ParallelGeometry/vtkPStructuredGridConnectivity.cxx:289–329  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

287
288//------------------------------------------------------------------------------
289void vtkPStructuredGridConnectivity::PackGhostData()
290{
291 assert("pre: SendBuffers is not properly allocated!" &&
292 this->SendBuffers.size() == this->NumberOfGrids);
293 assert(
294 "pre: RcvBuffers is not properly allocated!" && this->RcvBuffers.size() == this->NumberOfGrids);
295
296 for (unsigned int idx = 0; idx < this->GridIds.size(); ++idx)
297 {
298 int gridIdx = this->GridIds[idx];
299 assert("ERROR: grid index is out-of-bounds!" && (gridIdx >= 0) &&
300 (gridIdx < static_cast<int>(this->NumberOfGrids)));
301
302 int NumNeis = this->GetNumberOfNeighbors(gridIdx);
303 this->SendBuffers[gridIdx].resize(NumNeis, nullptr);
304 this->RcvBuffers[gridIdx].resize(NumNeis, nullptr);
305 this->RcvBufferSizes[gridIdx].resize(NumNeis, 0);
306 this->SendBufferSizes[gridIdx].resize(NumNeis, 0);
307
308 for (int nei = 0; nei < NumNeis; ++nei)
309 {
310 this->RcvBufferSizes[gridIdx][nei] = 0;
311
312 int neiGridIdx = this->Neighbors[gridIdx][nei].NeighborID;
313 assert("ERROR: neighbor grid index is out-of-bounds" && (neiGridIdx >= 0) &&
314 (neiGridIdx < static_cast<int>(this->NumberOfGrids)));
315
316 if (this->IsGridRemote(neiGridIdx))
317 {
318 this->TotalNumberOfSends++;
319 this->TotalNumberOfRcvs++;
320
321 this->SerializeGhostData(gridIdx, neiGridIdx, this->Neighbors[gridIdx][nei].SendExtent,
322 this->SendBuffers[gridIdx][nei], this->SendBufferSizes[gridIdx][nei]);
323 } // END if the neighboring grid is remote
324
325 } // END for all neighbors
326 } // END for all local grids
327
328 this->TotalNumberOfMsgs = this->TotalNumberOfRcvs + this->TotalNumberOfSends;
329}
330
331//------------------------------------------------------------------------------
332void vtkPStructuredGridConnectivity::SerializeBufferSizes(int*& sizesbuf, vtkIdType& N)

Callers 1

ExchangeGhostDataInitMethod · 0.95

Calls 6

IsGridRemoteMethod · 0.95
SerializeGhostDataMethod · 0.95
assertFunction · 0.50
sizeMethod · 0.45
GetNumberOfNeighborsMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected