zoltan.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::decompositionMethods::zoltan
26 
27 Description
28  Zoltan redistribution in parallel
29 
30  Note: Zoltan methods do not support serial operation.
31 
32  Parameters
33  - lb_method : The load-balancing algorithm
34  - block : block partitioning
35  - random : random partitioning
36  - rcb : recursive coordinate bisection
37  - rib : ecursive inertial bisection
38  - hsfc : Hilbert space-filling curve partitioning
39  - reftree : refinement tree based partitioning
40  - graph : choose from collection of methods for graphs
41  - hypergraph : choose from a collection of methods for hypergraphs
42 
43  - lb_approach The desired load balancing approach. Only lb_method =
44  hypergraph or graph uses the lb_approach parameter. Valid values are
45 
46  - partition : Partition without reference to the current distribution,
47  recommended for static load balancing.
48 
49  - repartition : Partition starting from the current data distribution
50  to keep data migration low, recommended for dynamic load balancing.
51 
52  - refine : Quickly improve the current data distribution
53 
54  Default values
55  - debug_level 0
56  - imbalance_tol 1.05
57  - lb_method graph
58  - lb_approach repartition
59 
60 Usage
61  To select the Zoltan graph repartition method add the following entries to
62  decomposeParDict:
63 
64  distributor zoltan;
65  libs ("libzoltanRenumber.so");
66 
67  The Zoltan lb_method and lb_approach can be changed by adding the
68  corresponding entries to the optional zoltanCeoffs sub-dictionary, e.g.:
69 
70  zoltanCoeffs
71  {
72  lb_method hypergraph;
73  lb_approach partition;
74  }
75 
76 SourceFiles
77  zoltan.C
78 
79 \*---------------------------------------------------------------------------*/
80 
81 #ifndef zoltan_H
82 #define zoltan_H
83 
84 #include "decompositionMethod.H"
85 
86 namespace Foam
87 {
88 namespace decompositionMethods
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class zoltan Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class zoltan
96 :
97  public decompositionMethod
98 {
99  // Private Member Functions
100 
101  //- Low level decompose
103  (
104  const CompactListList<label>& adjacency,
105  const pointField& points,
106  const scalarField& cellWeights,
107  List<label>& finalDecomp
108  ) const;
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("zoltan");
115 
116 
117  // Constructors
118 
119  //- Construct given the decomposition dictionary and mesh
120  zoltan(const dictionary& decompositionDict);
121 
122  //- Disallow default bitwise copy construction
123  zoltan(const zoltan&) = delete;
124 
125 
126  //- Destructor
127  virtual ~zoltan()
128  {}
129 
130 
131  // Member Functions
132 
133  //- Inherit decompose from decompositionMethod
135 
136  //- Return for every coordinate the wanted processor number. Use the
137  // mesh connectivity (if needed). See note on weights in scotch.H
138  virtual labelList decompose
139  (
140  const polyMesh& mesh,
141  const pointField& points,
142  const scalarField& pointWeights
143  );
144 
145  //- Return for every coordinate the wanted processor number. Gets
146  // passed agglomeration map (from fine to coarse cells) and coarse cell
147  // location. Can be overridden by decomposers that provide this
148  // functionality natively. See note on weights in scotch.H
149  virtual labelList decompose
150  (
151  const polyMesh& mesh,
152  const labelList& agglom,
153  const pointField& regionPoints,
154  const scalarField& regionWeights
155  );
156 
157  //- Return for every coordinate the wanted processor number. Explicitly
158  // provided mesh connectivity.
159  // The connectivity is equal to mesh.cellCells() except for
160  // - in parallel the cell numbers are global cell numbers (starting
161  // from 0 at processor0 and then incrementing all through the
162  // processors)
163  // - the connections are across coupled patches
164  // See note on weights in scotch.H
165  virtual labelList decompose
166  (
167  const labelListList& globalCellCells,
168  const pointField& cellCentres,
169  const scalarField& cellWeights
170  );
171 
172 
173  // Member Operators
174 
175  //- Disallow default bitwise assignment
176  void operator=(const zoltan&) = delete;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace decompositionMethods
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Abstract base class for decomposition.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
Zoltan redistribution in parallel.
Definition: zoltan.H:97
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Inherit decompose from decompositionMethod.
void operator=(const zoltan &)=delete
Disallow default bitwise assignment.
virtual ~zoltan()
Destructor.
Definition: zoltan.H:126
zoltan(const dictionary &decompositionDict)
Construct given the decomposition dictionary and mesh.
Definition: zoltan.C:479
TypeName("zoltan")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
const pointField & points
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59