Isorropia: Partitioning, Load Balancing and more
Isorropia_EpetraZoltanLib.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_EpetraZoltanLib_hpp_
41#define _Isorropia_EpetraZoltanLib_hpp_
42
44#include <Teuchos_RCP.hpp>
45#include <Teuchos_ParameterList.hpp>
46
49
50#include <QueryObject.hpp>
51#include <zoltan_cpp.h>
52
53#ifdef HAVE_EPETRA
54class Epetra_Map;
55class Epetra_BlockMap;
56class Epetra_Import;
57class Epetra_Vector;
58class Epetra_MultiVector;
59class Epetra_CrsGraph;
60class Epetra_CrsMatrix;
61class Epetra_RowMatrix;
62class Epetra_LinearProblem;
63
64namespace Isorropia {
65
66namespace Epetra {
67 class CostDescriber;
68
69
70class ZoltanLibClass : public Library {
71public:
72
73 ZoltanLibClass(Teuchos::RCP<const Epetra_CrsGraph> input_graph, int inputType=unspecified_input_);
74 ZoltanLibClass(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
75 Teuchos::RCP<const Epetra_MultiVector> input_coords, int inputType=unspecified_input_);
76 ZoltanLibClass(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
77 Teuchos::RCP<CostDescriber> costs, int inputType=unspecified_input_);
78 ZoltanLibClass(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 inputType=unspecified_input_);
81 ZoltanLibClass(Teuchos::RCP<const Epetra_RowMatrix> input_matrix, int inputType=unspecified_input_);
82 ZoltanLibClass(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
83 Teuchos::RCP<const Epetra_MultiVector> input_coords, int inputType=unspecified_input_);
84 ZoltanLibClass(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
85 Teuchos::RCP<CostDescriber> costs, int inputType=unspecified_input_);
86 ZoltanLibClass(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 inputType=unspecified_input_);
89 ZoltanLibClass(Teuchos::RCP<const Epetra_MultiVector> input_coords, int inputType=unspecified_input_);
90 ZoltanLibClass(Teuchos::RCP<const Epetra_MultiVector> input_coords,
91 Teuchos::RCP<const Epetra_MultiVector> weights, int inputType=unspecified_input_);
92 ZoltanLibClass(Teuchos::RCP<const Epetra_BlockMap> input_map, int inputType=unspecified_input_);
93
94
95
96
115 virtual int
116 repartition(Teuchos::ParameterList& paramlist,
117 std::vector<int>& newPartitions,
118 int& exportsSize,
119 std::vector<int>& imports);
120
128 virtual int
129 color(Teuchos::ParameterList& paramlist,
130 std::vector<int>& colorAssignment);
131
139 virtual int
140 order(Teuchos::ParameterList& paramlist,
141 std::vector<int>& orderAssignment);
142
143protected:
144 virtual int precompute();
145 virtual int postcompute();
148
149 void setParameterList(Teuchos::ParameterList& zoltanParamList);
150
151private:
152 Teuchos::ParameterList zoltanParamList_;
153 std::string partMethod_; // stores partitioning method used, perhaps should be in EpetraLibrary?
154 Zoltan *zz_;
155 Teuchos::RCP<ZoltanLib::QueryObject> queryObject_;
157
158};//class ZoltanLibClass
159
160}//namespace Epetra
161}//namespace Isorropia
162
163#endif //HAVE_EPETRA
164
165#endif
166
An implementation of the Partitioner interface that operates on Epetra matrices and linear systems.
Definition Isorropia_EpetraLibrary.hpp:70
static const int unspecified_input_
input_type_ == unspecified_input_ This value is the "unset" state for the input_type_ instance variab...
Definition Isorropia_EpetraLibrary.hpp:178
Definition Isorropia_EpetraZoltanLib.hpp:70
ZoltanLibClass(Teuchos::RCP< const Epetra_BlockMap > input_map, int inputType=unspecified_input_)
Zoltan * zz_
Definition Isorropia_EpetraZoltanLib.hpp:154
ZoltanLibClass(Teuchos::RCP< const Epetra_CrsGraph > input_graph, Teuchos::RCP< CostDescriber > costs, int inputType=unspecified_input_)
ZoltanLibClass(Teuchos::RCP< const Epetra_MultiVector > input_coords, Teuchos::RCP< const Epetra_MultiVector > weights, int inputType=unspecified_input_)
ZoltanLibClass(Teuchos::RCP< const Epetra_RowMatrix > input_matrix, Teuchos::RCP< const Epetra_MultiVector > input_coords, int inputType=unspecified_input_)
int num_obj_
Definition Isorropia_EpetraZoltanLib.hpp:156
ZoltanLibClass(Teuchos::RCP< const Epetra_CrsGraph > input_graph, Teuchos::RCP< const Epetra_MultiVector > input_coords, int inputType=unspecified_input_)
ZoltanLibClass(Teuchos::RCP< const Epetra_CrsGraph > input_graph, int inputType=unspecified_input_)
Teuchos::ParameterList zoltanParamList_
Definition Isorropia_EpetraZoltanLib.hpp:152
std::string partMethod_
Definition Isorropia_EpetraZoltanLib.hpp:153
virtual int order(Teuchos::ParameterList &paramlist, std::vector< int > &orderAssignment)
Method to order the object that the ZoltanLibClass was contructed with.
virtual int repartition(Teuchos::ParameterList &paramlist, std::vector< int > &newPartitions, int &exportsSize, std::vector< int > &imports)
Method to partition the object that the ZoltanLibClass was contructed with.
virtual int color(Teuchos::ParameterList &paramlist, std::vector< int > &colorAssignment)
Method to color the object that the ZoltanLibClass was contructed with.
ZoltanLibClass(Teuchos::RCP< const Epetra_MultiVector > input_coords, int inputType=unspecified_input_)
void setParameterList(Teuchos::ParameterList &zoltanParamList)
ZoltanLibClass(Teuchos::RCP< const Epetra_RowMatrix > input_matrix, Teuchos::RCP< CostDescriber > costs, int inputType=unspecified_input_)
ZoltanLibClass(Teuchos::RCP< const Epetra_CrsGraph > input_graph, Teuchos::RCP< CostDescriber > costs, Teuchos::RCP< const Epetra_MultiVector > input_coords, Teuchos::RCP< const Epetra_MultiVector > weights, int inputType=unspecified_input_)
ZoltanLibClass(Teuchos::RCP< const Epetra_RowMatrix > input_matrix, int inputType=unspecified_input_)
ZoltanLibClass(Teuchos::RCP< const Epetra_RowMatrix > input_matrix, Teuchos::RCP< CostDescriber > costs, Teuchos::RCP< const Epetra_MultiVector > input_coords, Teuchos::RCP< const Epetra_MultiVector > weights, int inputType=unspecified_input_)
Teuchos::RCP< ZoltanLib::QueryObject > queryObject_
Definition Isorropia_EpetraZoltanLib.hpp:155
Isorropia is the namespace that contains general definitions that apply to all partitioners and that ...
Definition Isorropia_Epetra.hpp:60