VTK  9.5.20251105
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
23class vtkBitArray;
24
25class VTKFILTERSPARALLELMPI_EXPORT vtkHyperTreeGridRedistribute : public vtkPassInputTypeAlgorithm
26{
27public:
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
33
40
41protected:
44
49
54 int RequestData(vtkInformation* vtkNotUsed(request), vtkInformationVector** inputVector,
55 vtkInformationVector* outputVector) override;
56
57private:
59 void operator=(const vtkHyperTreeGridRedistribute&) = delete;
60
64 int ProcessTrees(vtkHyperTreeGrid*, vtkDataObject*);
65
69 int ProcessBlock(vtkDataObject*, vtkDataObject*);
70
75 int ProcessComposite(vtkDataObject*, vtkDataObject*);
76
77 /* Subroutines */
78 void ExchangeHTGMetadata();
79 void CollectLocalTreeIds();
80 void BuildTargetPartMap();
81 void ExchangeHyperTreeMetaData(vtkBitArray* descriptorSendBuffer,
82 std::vector<int>& descriptorSizesReceivedBuffer, std::vector<int>& treeSizesSendBuffer,
83 std::vector<int>& maskSizesSendBuffer, std::vector<int>& treeSizesReceivedBuffer,
84 std::vector<int>& maskSizesReceivedBuffer, std::vector<int>& descriptorsByteOffsets);
85 void BuildOutputTrees(vtkBitArray* descriptorSendBuffer,
86 std::vector<int>& descriptorSizesReceivedBuffer, std::vector<int>& descriptorsByteOffsets);
87 void ExchangeMask(
88 std::vector<int>& maskSizesSendBuffer, std::vector<int>& maskSizesReceivedBuffer);
89 void CollectCellArraySizes(std::vector<int>& treeSizesSendBuffer,
90 std::vector<int>& treeSizesReceivedBuffer, std::vector<int>& cellsSentPerPartOffset,
91 std::vector<int>& cellsReceivedPerPartOffset, std::vector<int>& nbCellDataSentPerPart,
92 std::vector<int>& nbCellDataReceivedPerPart);
93 void ExchangeCellArray(int arrayId, std::vector<int>& cellsSentPerPartOffset,
94 std::vector<int>& cellsReceivedPerPartOffset, std::vector<int>& nbCellDataSentPerPart,
95 std::vector<int>& nbCellDataReceivedPerPart);
96
97 vtkHyperTreeGrid* InputHTG;
98 vtkHyperTreeGrid* OutputHTG;
100 bool HasMask = false;
101 int NumPartitions = 0;
102 int CurrentPiece = 0;
103
104 std::vector<int> TreeTargetPartId; // Map Tree <-> Target Part Id
105 std::vector<int> TreeIdsReceivedBuffer;
106 std::vector<int> NbTreesReceivedPerPart;
107 std::vector<int> NbTreesSentPerPart;
108 std::vector<int> NbDescriptorsBytesPerPart;
109
110 std::vector<vtkIdType> LocalTreeIds;
111 std::vector<std::vector<vtkIdType>> TreesToSend; // Trees ids to send to each process
112
113 vtkMPICommunicator* MPIComm = nullptr;
115};
116
117VTK_ABI_NAMESPACE_END
118#endif /* vtkHyperTreeGridRedistribute */
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:31
general representation of visualization data
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
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.
Superclass for algorithms that produce output of the same type as input.
Hold a reference to a vtkObjectBase instance.
a weak reference to a vtkObject.