VTK  9.5.20250804
vtkHyperTreeGridRedistribute.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
11#ifndef vtkHyperTreeGridRedistribute_h
12#define vtkHyperTreeGridRedistribute_h
13
15
16#include "vtkFiltersParallelMPIModule.h" // For export macro
17#include "vtkSmartPointer.h" // For vtkSmartPointer
18#include "vtkWeakPointer.h" // for vtkWeakPointer
19
20VTK_ABI_NAMESPACE_BEGIN
23
24class VTKFILTERSPARALLELMPI_EXPORT vtkHyperTreeGridRedistribute : public vtkHyperTreeGridAlgorithm
25{
26public:
29 void PrintSelf(ostream& os, vtkIndent indent) override;
30
32
39
40protected:
43
48
53 int RequestData(vtkInformation* vtkNotUsed(request), vtkInformationVector** inputVector,
54 vtkInformationVector* outputVector) override;
55
60
61private:
63 void operator=(const vtkHyperTreeGridRedistribute&) = delete;
64
65 /* Subroutines */
66 void CollectLocalTreeIds();
67 void BuildTargetPartMap();
68 void ExchangeHTGMetaData(vtkBitArray* descriptorSendBuffer,
69 std::vector<int>& descriptorSizesReceivedBuffer, std::vector<int>& treeSizesSendBuffer,
70 std::vector<int>& maskSizesSendBuffer, std::vector<int>& treeSizesReceivedBuffer,
71 std::vector<int>& maskSizesReceivedBuffer, std::vector<int>& descriptorsByteOffsets);
72 void BuildOutputTrees(vtkBitArray* descriptorSendBuffer,
73 std::vector<int>& descriptorSizesReceivedBuffer, std::vector<int>& descriptorsByteOffsets);
74 void ExchangeMask(
75 std::vector<int>& maskSizesSendBuffer, std::vector<int>& maskSizesReceivedBuffer);
76 void CollectCellArraySizes(std::vector<int>& treeSizesSendBuffer,
77 std::vector<int>& treeSizesReceivedBuffer, std::vector<int>& cellsSentPerPartOffset,
78 std::vector<int>& cellsReceivedPerPartOffset, std::vector<int>& nbCellDataSentPerPart,
79 std::vector<int>& nbCellDataReceivedPerPart);
80 void ExchangeCellArray(int arrayId, std::vector<int>& cellsSentPerPartOffset,
81 std::vector<int>& cellsReceivedPerPartOffset, std::vector<int>& nbCellDataSentPerPart,
82 std::vector<int>& nbCellDataReceivedPerPart);
83
84 vtkHyperTreeGrid* InputHTG;
85 vtkHyperTreeGrid* OutputHTG;
87 int NumPartitions;
88
89 std::vector<int> TreeTargetPartId; // Map Tree <-> Target Part Id
90 std::vector<int> TreeIdsReceivedBuffer;
91 std::vector<int> NbTreesReceivedPerPart;
92 std::vector<int> NbTreesSentPerPart;
93 std::vector<int> NbDescriptorsBytesPerPart;
94
95 std::vector<vtkIdType> LocalTreeIds;
96 std::vector<std::vector<vtkIdType>> TreesToSend; // Trees ids to send to each process
97
98 vtkMPICommunicator* MPIComm = nullptr;
100};
101
102VTK_ABI_NAMESPACE_END
103#endif /* vtkHyperTreeGridRedistribute */
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:29
general representation of visualization data
Superclass for algorithms that produce a hyper tree grid as output.
Redistribute input HyperTreeGrid into requested number of partitions.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Override RequestData, to make sure every HTG piece can be processed, hence avoiding that one rank wai...
static vtkHyperTreeGridRedistribute * New()
virtual void SetController(vtkMultiProcessController *)
Get/Set the controller to use.
~vtkHyperTreeGridRedistribute() override
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) override
Main routine to redistribute trees and exchange cell data.
vtkMultiProcessController * GetController()
Get/Set the controller to use.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int, vtkInformation *) override
Input must be either HTG or vtkPartitionedDataSet composed of HTG partitions.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Class for creating user defined MPI communicators.
Multiprocessing communication superclass.
Hold a reference to a vtkObjectBase instance.
a weak reference to a vtkObject.