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

Method BuildLocator

Filters/Parallel/vtkPKdTree.cxx:397–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395// BuildLocator must be called by all processes in the parallel application
396
397void vtkPKdTree::BuildLocator()
398{
399 SCOPETIMER("BuildLocator");
400
401 int fail = 0;
402 int rebuildLocator = 0;
403
404 if ((this->Top == nullptr) || (this->BuildTime < this->GetMTime()) || this->NewGeometry())
405 {
406 // We don't have a k-d tree, or parameters that affect the
407 // build of the tree have changed, or input geometry has changed.
408
409 rebuildLocator = 1;
410 }
411
412 if (this->NumProcesses == 1)
413 {
414 if (rebuildLocator)
415 {
416 this->SingleProcessBuildLocator();
417 }
418 return;
419 }
420 this->UpdateProgress(0);
421
422 TIMER("Determine if we need to rebuild");
423
424 this->SubGroup = vtkSubGroup::New();
425 this->SubGroup->Initialize(
426 0, this->NumProcesses - 1, this->MyId, 0x00001000, this->Controller->GetCommunicator());
427
428 int vote;
429 this->SubGroup->ReduceSum(&rebuildLocator, &vote, 1, 0);
430 this->SubGroup->Broadcast(&vote, 1, 0);
431
432 rebuildLocator = (vote > 0);
433
434 TIMERDONE("Determine if we need to rebuild");
435
436 if (rebuildLocator)
437 {
438 TIMER("Build k-d tree");
439 this->InvokeEvent(vtkCommand::StartEvent);
440
441 this->FreeSearchStructure();
442 this->ReleaseTables();
443
444 this->AllCheckParameters(); // global operation to ensure same parameters
445
446 double volBounds[6];
447 if (!this->VolumeBounds(volBounds)) // global operation to get bounds
448 {
449 goto doneError;
450 }
451 this->UpdateProgress(0.1);
452
453 if (this->UserDefinedCuts)
454 {

Callers 15

RequestDataMethod · 0.45
SingleProcessExecuteMethod · 0.45
GetPointsInsideBoundsMethod · 0.45
GenerateMergeMapMethod · 0.45
RequestDataMethod · 0.45
UpdateLocatorsMethod · 0.45
TestUnstructuredGridFunction · 0.45
TestPolyDataFunction · 0.45
ProbeMethod · 0.45
RequestDataMethod · 0.45
AppendMethod · 0.45

Calls 15

ReleaseTablesMethod · 0.95
AllCheckParametersMethod · 0.95
VolumeBoundsMethod · 0.95
InvokeEventMethod · 0.80
SetCalculatorMethod · 0.80
UpdateBuildTimeMethod · 0.80
NewFunction · 0.50

Tested by 3

TestUnstructuredGridFunction · 0.36
TestPolyDataFunction · 0.36
TestPoissonDiskSamplerFunction · 0.36