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

Method InitializeKdTree

Filters/ParallelMPI/vtkDistributedPointCloudFilter.cxx:99–125  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

97
98//------------------------------------------------------------------------------
99bool vtkDistributedPointCloudFilter::InitializeKdTree(std::vector<vtkMPIController*>& kdTreeRounds)
100{
101 this->Controller->Register(this);
102
103 kdTreeRounds.push_back(vtkMPIController::SafeDownCast(this->Controller));
104
105 int index = 0;
106 while (kdTreeRounds[index]->GetNumberOfProcesses() > 2)
107 {
108 vtkMPIController* ctrl = kdTreeRounds[index];
109 int roundRank = ctrl->GetLocalProcessId();
110 int split = ctrl->GetNumberOfProcesses() / 2;
111
112 int color = (roundRank < split) ? 0 : 1;
113 int key = roundRank - ((roundRank < split) ? 0 : split);
114
115 vtkMPIController* subCtrl = ctrl->PartitionController(color, key);
116 if (subCtrl == nullptr)
117 {
118 break;
119 }
120 kdTreeRounds.push_back(subCtrl);
121 ++index;
122 }
123
124 return true;
125}
126
127//------------------------------------------------------------------------------
128bool vtkDistributedPointCloudFilter::OptimizeBoundingBox(

Callers 1

RequestDataMethod · 0.95

Calls 5

GetNumberOfProcessesMethod · 0.80
RegisterMethod · 0.45
push_backMethod · 0.45
GetLocalProcessIdMethod · 0.45
PartitionControllerMethod · 0.45

Tested by

no test coverage detected