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

Method ProcessTrees

Filters/ParallelMPI/vtkHyperTreeGridRedistribute.cxx:384–459  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

382
383//------------------------------------------------------------------------------
384int vtkHyperTreeGridRedistribute::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObject* outputDO)
385{
386 this->OutputHTG = vtkHyperTreeGrid::SafeDownCast(outputDO);
387 if (!this->OutputHTG)
388 {
389 vtkErrorMacro("Incorrect type of output: " << outputDO->GetClassName());
390 return 0;
391 }
392
393 if (!this->ExchangeHTGMetadata())
394 {
395 return 0;
396 }
397
398 if (input->HasMask())
399 {
400 this->OutMask = vtk::TakeSmartPointer(vtkBitArray::New());
401 }
402
403 vtkDebugMacro("Collecting local tree indices");
404 this->CollectLocalTreeIds();
405 this->UpdateProgress(0.2);
406
407 // Compute tree id <=> target partition id map
408 vtkDebugMacro("Build target partition map");
409 this->TreeTargetPartId.resize(this->OutputHTG->GetMaxNumberOfTrees());
410 this->BuildTargetPartMap();
411 this->UpdateProgress(0.4);
412
413 vtkDebugMacro("Exchanging HTG meta-data");
414 vtkNew<vtkBitArray> descriptorSendBuffer;
415 std::vector<int> descriptorSizesReceivedBuffer;
416 std::vector<int> treeSizesSendBuffer;
417 std::vector<int> maskSizesSendBuffer;
418 std::vector<int> treeSizesReceivedBuffer;
419 std::vector<int> maskSizesReceivedBuffer;
420 std::vector<int> descriptorsByteOffsets;
421 this->ExchangeHyperTreeMetaData(descriptorSendBuffer, descriptorSizesReceivedBuffer,
422 treeSizesSendBuffer, maskSizesSendBuffer, treeSizesReceivedBuffer, maskSizesReceivedBuffer,
423 descriptorsByteOffsets);
424
425 vtkDebugMacro("Building output trees");
426 this->BuildOutputTrees(
427 descriptorSendBuffer, descriptorSizesReceivedBuffer, descriptorsByteOffsets);
428 this->OutputHTG->InitializeLocalIndexNode();
429 this->UpdateProgress(0.6);
430
431 if (this->HasMask)
432 {
433 vtkDebugMacro("Exchange mask information");
434 this->ExchangeMask(maskSizesSendBuffer, maskSizesReceivedBuffer);
435 }
436 this->UpdateProgress(0.8);
437
438 vtkDebugMacro("Exchange cell data");
439 std::vector<int> cellsSentPerPartOffset(this->NumPartitions, 0);
440 std::vector<int> cellsReceivedPerPartOffset(this->NumPartitions, 0);
441 std::vector<int> nbCellDataSentPerPart(this->NumPartitions, 0);

Callers 1

ProcessBlockMethod · 0.95

Calls 15

ExchangeHTGMetadataMethod · 0.95
CollectLocalTreeIdsMethod · 0.95
BuildTargetPartMapMethod · 0.95
BuildOutputTreesMethod · 0.95
ExchangeMaskMethod · 0.95
CollectCellArraySizesMethod · 0.95
ExchangeCellArrayMethod · 0.95
HasMaskMethod · 0.80
GetMaxNumberOfTreesMethod · 0.80
NewFunction · 0.50

Tested by

no test coverage detected