Isorropia: Partitioning, Load Balancing and more
Isorropia_EpetraLibrary.hpp
Go to the documentation of this file.
1 //@HEADER
2 //************************************************************************
3 //
4 // Isorropia: Partitioning and Load Balancing Package
5 // Copyright (2006) Sandia Corporation
6 //
7 //Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 //license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 //************************************************************************
38 //@HEADER
39 
40 #ifndef _Isorropia_EpetraLibrary_hpp_
41 #define _Isorropia_EpetraLibrary_hpp_
42 
43 #include <Isorropia_ConfigDefs.hpp>
44 #include <Teuchos_RCP.hpp>
45 #include <Teuchos_ParameterList.hpp>
46 
48 
49 #ifdef HAVE_EPETRA
50 class Epetra_Map;
51 class Epetra_BlockMap;
52 class Epetra_Import;
53 class Epetra_Vector;
54 class Epetra_MultiVector;
55 class Epetra_CrsGraph;
56 class Epetra_CrsMatrix;
57 class Epetra_RowMatrix;
58 class Epetra_LinearProblem;
59 
60 namespace Isorropia {
61 
62 namespace Epetra {
63  class CostDescriber;
64 
70 class Library {
71 public:
72 
73  Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph, int itype = unspecified_input_);
74  Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph, Teuchos::RCP<const Epetra_MultiVector> input_coords,
75  int itype = unspecified_input_);
76  Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
77  Teuchos::RCP<CostDescriber> costs, int itype = unspecified_input_);
78  Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph, Teuchos::RCP<CostDescriber> costs,
79  Teuchos::RCP<const Epetra_MultiVector> input_coords, Teuchos::RCP<const Epetra_MultiVector> weights,
80  int itype = unspecified_input_);
81  Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix, int itype = unspecified_input_);
82  Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix, Teuchos::RCP<const Epetra_MultiVector> input_coords,
83  int itype = unspecified_input_);
84  Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
85  Teuchos::RCP<CostDescriber> costs, int itype = unspecified_input_);
86  Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix, Teuchos::RCP<CostDescriber> costs,
87  Teuchos::RCP<const Epetra_MultiVector> input_coords, Teuchos::RCP<const Epetra_MultiVector> weights,
88  int itype = unspecified_input_);
89  Library(Teuchos::RCP<const Epetra_MultiVector> input_coords, int itype = unspecified_input_);
90  Library(Teuchos::RCP<const Epetra_MultiVector> input_coords,
91  Teuchos::RCP<const Epetra_MultiVector> weights, int itype = unspecified_input_);
92  Library(Teuchos::RCP<const Epetra_BlockMap> input_map, int itype = unspecified_input_);
93 
94  virtual ~Library();
95 
96  virtual int
97  repartition(Teuchos::ParameterList& paramlist,
98  std::vector<int>& myNewElements,
99  int& exportsSize,
100  std::vector<int>& imports) = 0;
101 
102  virtual int
103  color(Teuchos::ParameterList& paramlist,
104  std::vector<int>& colorAssignment) = 0 ;
105 
106  virtual int
107  order(Teuchos::ParameterList& paramlist,
108  std::vector<int>& orderAssignment) = 0 ;
109 
115  static const int hgraph_input_ = 1;
116 
121  static const int hgraph2d_finegrain_input_ = 2;
122 
128  static const int graph_input_ = 3;
129 
136  static const int geometric_input_ = 4;
137 
143  static const int hgraph_graph_input_ = 5;
144 
150  static const int hgraph_geometric_input_ = 6;
151 
157  static const int graph_geometric_input_ = 7;
158 
164  static const int hgraph_graph_geometric_input_ = 8;
165 
166 
171  static const int simple_input_ = 9;
172 
173 
178  static const int unspecified_input_ = 10;
179 
181 
183  int *partGIDs;
184  float *partSizes;
185 
186 protected:
187 
188  Teuchos::RCP<const Epetra_BlockMap> input_map_;
189  Teuchos::RCP<const Epetra_CrsGraph> input_graph_;
190  Teuchos::RCP<const Epetra_RowMatrix> input_matrix_;
191  Teuchos::RCP<const Epetra_MultiVector> input_coords_;
192  Teuchos::RCP<Isorropia::Epetra::CostDescriber> costs_;
193  Teuchos::RCP<const Epetra_MultiVector> weights_;
194 
195  virtual int precompute();
196 
197  virtual int postcompute() = 0;
198 
199 };//class Library
200 
201 }//namespace Epetra
202 }//namespace Isorropia
203 
204 #endif //HAVE_EPETRA
205 
206 #endif
207 
208 
209 #if defined(Isorropia_SHOW_DEPRECATED_WARNINGS)
210 #ifdef __GNUC__
211 #warning "The Isorropia package is deprecated"
212 #endif
213 #endif
214 
float * partSizes
Definition: Isorropia_EpetraLibrary.hpp:184
static const int unspecified_input_
input_type_ == unspecified_input_ This value is the &quot;unset&quot; state for the input_type_ instance variab...
Definition: Isorropia_EpetraLibrary.hpp:178
static const int hgraph_graph_geometric_input_
input_type_ == hgraph_graph_geom_input_ This indicates that the Epetra_MultiVector represents a hyper...
Definition: Isorropia_EpetraLibrary.hpp:164
Teuchos::RCP< const Epetra_MultiVector > input_coords_
Definition: Isorropia_EpetraLibrary.hpp:191
Teuchos::RCP< const Epetra_CrsGraph > input_graph_
Definition: Isorropia_EpetraLibrary.hpp:189
int numPartSizes
Definition: Isorropia_EpetraLibrary.hpp:182
Teuchos::RCP< const Epetra_RowMatrix > input_matrix_
Definition: Isorropia_EpetraLibrary.hpp:190
An implementation of the Partitioner interface that operates on Epetra matrices and linear systems...
Definition: Isorropia_EpetraLibrary.hpp:70
static const int hgraph_input_
input_type_ == hgraph_input_ This indicates that the matrix or graph represents a hypergraph...
Definition: Isorropia_EpetraLibrary.hpp:115
virtual int repartition(Teuchos::ParameterList &paramlist, std::vector< int > &myNewElements, int &exportsSize, std::vector< int > &imports)=0
static const int hgraph_graph_input_
input_type_ == hgraph_graph_input_ This indicates that the Epetra_MultiVector represents a hypergraph...
Definition: Isorropia_EpetraLibrary.hpp:143
static const int simple_input_
input_type_ == simple_input_ This is used to indicate that a simple partitiong method (block...
Definition: Isorropia_EpetraLibrary.hpp:171
Teuchos::RCP< Isorropia::Epetra::CostDescriber > costs_
Definition: Isorropia_EpetraLibrary.hpp:192
static const int hgraph2d_finegrain_input_
input_type_ == hgraph2d_finegrain_input_ This indicates that the matrix or graph represents a hypergr...
Definition: Isorropia_EpetraLibrary.hpp:121
virtual int order(Teuchos::ParameterList &paramlist, std::vector< int > &orderAssignment)=0
int * partGIDs
Definition: Isorropia_EpetraLibrary.hpp:183
Library(Teuchos::RCP< const Epetra_CrsGraph > input_graph, int itype=unspecified_input_)
int input_type_
Definition: Isorropia_EpetraLibrary.hpp:180
static const int graph_input_
input_type_ == graph_input_ This indicates that the square symmetric matrix or graph represents a gra...
Definition: Isorropia_EpetraLibrary.hpp:128
static const int hgraph_geometric_input_
input_type_ == hgraph_geom_input_ This indicates that the Epetra_MultiVector represents a hypergraph ...
Definition: Isorropia_EpetraLibrary.hpp:150
Teuchos::RCP< const Epetra_BlockMap > input_map_
Definition: Isorropia_EpetraLibrary.hpp:188
virtual int color(Teuchos::ParameterList &paramlist, std::vector< int > &colorAssignment)=0
virtual int postcompute()=0
static const int graph_geometric_input_
input_type_ == graph_geom_input_ This indicates that the Epetra_MultiVector represents a hypergraph a...
Definition: Isorropia_EpetraLibrary.hpp:157
Teuchos::RCP< const Epetra_MultiVector > weights_
Definition: Isorropia_EpetraLibrary.hpp:193
static const int geometric_input_
input_type_ == geometric_input_ This indicates that the Epetra_MultiVector represents geometric coord...
Definition: Isorropia_EpetraLibrary.hpp:136