zoltanDecomp.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 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::zoltanDecomp
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  zoltanDecomp.C
78 
79 \*---------------------------------------------------------------------------*/
80 
81 #ifndef zoltanDecomp_H
82 #define zoltanDecomp_H
83 
84 #include "decompositionMethod.H"
85 
86 namespace Foam
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class zoltanDecomp Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class zoltanDecomp
94 :
95  public decompositionMethod
96 {
97  // Private Member Functions
98 
99  //- Low level decompose
100  label decompose
101  (
102  const CompactListList<label>& adjacency,
103  const pointField& points,
104  const scalarField& cWeights,
105  List<label>& finalDecomp
106  ) const;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("zoltan");
113 
114 
115  // Constructors
116 
117  //- Construct given the decomposition dictionary and mesh
118  zoltanDecomp(const dictionary& decompositionDict);
119 
120  //- Disallow default bitwise copy construction
121  zoltanDecomp(const zoltanDecomp&) = delete;
122 
123 
124  //- Destructor
125  virtual ~zoltanDecomp()
126  {}
127 
128 
129  // Member Functions
130 
131  //- Inherit decompose from decompositionMethod
133 
134  //- Return for every coordinate the wanted processor number. Use the
135  // mesh connectivity (if needed). See note on weights in scotchDecomp.H
136  virtual labelList decompose
137  (
138  const polyMesh& mesh,
139  const pointField& points,
140  const scalarField& pointWeights
141  );
142 
143  //- Return for every coordinate the wanted processor number. Gets
144  // passed agglomeration map (from fine to coarse cells) and coarse cell
145  // location. Can be overridden by decomposers that provide this
146  // functionality natively. See note on weights in scotchDecomp.H
147  virtual labelList decompose
148  (
149  const polyMesh& mesh,
150  const labelList& agglom,
151  const pointField& regionPoints,
152  const scalarField& regionWeights
153  );
154 
155  //- Return for every coordinate the wanted processor number. Explicitly
156  // provided mesh connectivity.
157  // The connectivity is equal to mesh.cellCells() except for
158  // - in parallel the cell numbers are global cell numbers (starting
159  // from 0 at processor0 and then incrementing all through the
160  // processors)
161  // - the connections are across coupled patches
162  // See note on weights in scotchDecomp.H
163  virtual labelList decompose
164  (
165  const labelListList& globalCellCells,
166  const pointField& cc,
167  const scalarField& cWeights
168  );
169 
170 
171  // Member Operators
172 
173  //- Disallow default bitwise assignment
174  void operator=(const zoltanDecomp&) = delete;
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual ~zoltanDecomp()
Destructor.
Definition: zoltanDecomp.H:124
fvMesh & mesh
TypeName("zoltan")
Runtime type information.
zoltanDecomp(const dictionary &decompositionDict)
Construct given the decomposition dictionary and mesh.
Definition: zoltanDecomp.C:408
const pointField & points
Abstract base class for decomposition.
A packed storage unstructured matrix of objects of type <T> using an offset table for access...
Zoltan redistribution in parallel.
Definition: zoltanDecomp.H:92
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
void operator=(const zoltanDecomp &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.