------------------------------------------------------------------------------
| 627 | } |
| 628 | //------------------------------------------------------------------------------ |
| 629 | void vtkHyperTreeGridRedistribute::BuildTargetPartMap() |
| 630 | { |
| 631 | /* |
| 632 | * The strategy to distribute HyperTrees used is currently very simple: |
| 633 | * all the partitions should contain the same number of trees. |
| 634 | * There may be better strategies to group trees spatially, and balance partitions |
| 635 | * using the number of cells in each tree |
| 636 | */ |
| 637 | |
| 638 | vtkIdType maxTrees = this->OutputHTG->GetMaxNumberOfTrees(); |
| 639 | |
| 640 | for (vtkIdType part = 0; part < this->NumPartitions; part++) |
| 641 | { |
| 642 | vtkIdType startId = std::ceil(static_cast<double>(part * maxTrees) / this->NumPartitions); |
| 643 | vtkIdType endId = |
| 644 | std::ceil(static_cast<double>((part + 1) * maxTrees) / this->NumPartitions - 1.0); |
| 645 | for (vtkIdType id = startId; id <= endId; id++) |
| 646 | { |
| 647 | this->TreeTargetPartId[id] = part; |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | // Compute which trees to send to which processes |
| 652 | this->TreesToSend.resize(this->NumPartitions); |
| 653 | for (vtkIdType& id : this->LocalTreeIds) |
| 654 | { |
| 655 | if (this->TreeTargetPartId[id] != this->Controller->GetLocalProcessId()) |
| 656 | { |
| 657 | this->TreesToSend[this->TreeTargetPartId[id]].emplace_back(id); |
| 658 | } |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | //------------------------------------------------------------------------------ |
| 663 | void vtkHyperTreeGridRedistribute::ExchangeHyperTreeMetaData(vtkBitArray* descriptorSendBuffer, |
no test coverage detected