Isorropia: Partitioning, Load Balancing and more
Isorropia_Epetra.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_Epetra_hpp_
41#define _Isorropia_Epetra_hpp_
42
44#include <Teuchos_RCP.hpp>
45#include <Teuchos_ParameterList.hpp>
46
47#ifdef HAVE_EPETRA
48class Epetra_Comm;
49class Epetra_Map;
50class Epetra_BlockMap;
51class Epetra_Import;
52class Epetra_Vector;
53class Epetra_MultiVector;
54class Epetra_RowMatrix;
55class Epetra_CrsGraph;
56class Epetra_CrsMatrix;
57class Epetra_LinearProblem;
58#endif
59
60namespace Isorropia {
61
62namespace Epetra {
63
64 class Partitioner;
65 class CostDescriber;
66
67#ifdef HAVE_EPETRA
68
72Epetra_MultiVector *
73createBalancedCopy(const Epetra_MultiVector& input_vector);
74
78Epetra_MultiVector *
79createBalancedCopy(const Epetra_MultiVector& input_vector,
80 const Teuchos::ParameterList& paramlist);
81
85Epetra_CrsGraph *
86createBalancedCopy(const Epetra_CrsGraph& input_graph);
87
91Epetra_CrsGraph *
92createBalancedCopy(const Epetra_CrsGraph& input_graph,
93 const Teuchos::ParameterList& paramlist);
94
98Epetra_CrsMatrix *
99createBalancedCopy(const Epetra_CrsMatrix& input_matrix);
100
104Epetra_CrsMatrix *
105createBalancedCopy(const Epetra_CrsMatrix& input_matrix,
106 const Teuchos::ParameterList& paramlist);
107
112Epetra_LinearProblem *
113createBalancedCopy(const Epetra_LinearProblem & input_problem);
114
119Epetra_LinearProblem *
120createBalancedCopy(const Epetra_LinearProblem & input_problem,
121 const Teuchos::ParameterList& paramlist);
122
130// Teuchos::RCP<Epetra_Map>
131// create_target_map(const Epetra_Comm& comm, Partitioner& partitioner);
132
151__deprecated Teuchos::RCP<Epetra_CrsMatrix>
152 create_balanced_copy(const Epetra_CrsMatrix& input_matrix);
153
170__deprecated Teuchos::RCP<Epetra_CrsMatrix>
171 create_balanced_copy(const Epetra_CrsMatrix& input_matrix,
172 const Epetra_Vector &row_weights);
173
199__deprecated Teuchos::RCP<Epetra_CrsMatrix>
200 create_balanced_copy(const Epetra_CrsMatrix& input_matrix,
201 const Teuchos::ParameterList& paramlist);
202
203
204
235__deprecated Teuchos::RCP<Epetra_CrsMatrix>
236 create_balanced_copy(const Epetra_CrsMatrix& input_matrix,
237 CostDescriber &costs,
238 const Teuchos::ParameterList& paramlist);
239
258__deprecated Teuchos::RCP<Epetra_RowMatrix>
259 create_balanced_copy(const Epetra_RowMatrix& input_matrix);
260
277__deprecated Teuchos::RCP<Epetra_RowMatrix>
278 create_balanced_copy(const Epetra_RowMatrix& input_matrix,
279 const Epetra_Vector &row_weights);
280
307__deprecated Teuchos::RCP<Epetra_RowMatrix>
308 create_balanced_copy(const Epetra_RowMatrix& input_matrix,
309 const Teuchos::ParameterList& paramlist);
310
342__deprecated Teuchos::RCP<Epetra_RowMatrix>
343 create_balanced_copy(const Epetra_RowMatrix& input_matrix,
344 CostDescriber &costs,
345 const Teuchos::ParameterList& paramlist);
346
365__deprecated Teuchos::RCP<Epetra_CrsGraph>
366 create_balanced_copy(const Epetra_CrsGraph& input_graph);
367
385__deprecated Teuchos::RCP<Epetra_CrsGraph>
386 create_balanced_copy(const Epetra_CrsGraph& input_matrix,
387 const Epetra_Vector &row_weights);
388
414__deprecated Teuchos::RCP<Epetra_CrsGraph>
415 create_balanced_copy(const Epetra_CrsGraph& input_graph,
416 const Teuchos::ParameterList& paramlist);
417
448__deprecated Teuchos::RCP<Epetra_CrsGraph>
449 create_balanced_copy(const Epetra_CrsGraph& input_graph,
450 CostDescriber &costs,
451 const Teuchos::ParameterList& paramlist);
452
472__deprecated Teuchos::RCP<Epetra_LinearProblem>
473 create_balanced_copy(const Epetra_LinearProblem & input_problem);
474
491__deprecated Teuchos::RCP<Epetra_LinearProblem>
492 create_balanced_copy(const Epetra_LinearProblem& input_matrix,
493 const Epetra_Vector &row_weights);
494
521__deprecated Teuchos::RCP<Epetra_LinearProblem>
522 create_balanced_copy(const Epetra_LinearProblem& input_problem,
523 const Teuchos::ParameterList& paramlist);
524
555__deprecated Teuchos::RCP<Epetra_LinearProblem>
556 create_balanced_copy(const Epetra_LinearProblem& input_problem,
557 CostDescriber &costs,
558 const Teuchos::ParameterList& paramlist);
559
560__deprecated Teuchos::RCP<Epetra_MultiVector>
561create_balanced_copy(const Epetra_MultiVector &coords,
562 const Teuchos::ParameterList& paramlist);
563
564__deprecated Teuchos::RCP<Epetra_MultiVector>
565create_balanced_copy(const Epetra_MultiVector &coords,
566 const Epetra_MultiVector &weights,
567 const Teuchos::ParameterList& paramlist);
568
569
570__deprecated Teuchos::RCP<Epetra_MultiVector>
571create_balanced_copy(const Epetra_MultiVector &coords);
572
573__deprecated Teuchos::RCP<Epetra_MultiVector>
574create_balanced_copy(const Epetra_MultiVector &coords,
575 const Epetra_MultiVector &weights);
576
594Teuchos::RCP<Epetra_CrsMatrix>
595 redistribute_rows(const Epetra_CrsMatrix& input_matrix,
596 const Epetra_Map& target_rowmap,
597 Epetra_Import* importer=0);
598
616Teuchos::RCP<Epetra_CrsMatrix>
617 redistribute_rows(const Epetra_RowMatrix& input_matrix,
618 const Epetra_Map& target_rowmap,
619 Epetra_Import* importer=0);
620
633Teuchos::RCP<Epetra_CrsGraph>
634 redistribute_rows(const Epetra_CrsGraph& input_graph,
635 const Epetra_Map& target_rowmap,
636 Epetra_Import* importer=0);
637
650Teuchos::RCP<Epetra_MultiVector>
651 redistribute(const Epetra_MultiVector& input,
652 const Epetra_BlockMap& target_map,
653 Epetra_Import* importer=0);
654
667Teuchos::RCP<Epetra_Vector>
668 redistribute(const Epetra_Vector& input,
669 const Epetra_Map& target_map,
670 Epetra_Import* importer=0);
671
672#ifndef DOXYGEN_SHOULD_SKIP_THIS
673
678Epetra_MultiVector* create_row_weights_nnz(const Epetra_RowMatrix& input_matrix);
679
684Epetra_MultiVector* create_row_weights_nnz(const Epetra_CrsGraph& input_graph);
685
686Epetra_MultiVector* create_unit_weights(const Epetra_MultiVector& input_coords);
687
688
713int
714repartition(const Epetra_BlockMap& input_map,
715 const Epetra_MultiVector& weights,
716 std::vector<int>& myNewElements,
717 int& exportsSize,
718 std::vector<int>& imports);
719
728void gather_all_proc_global_offsets(const Epetra_BlockMap& blkmap,
729 std::vector<int>& all_proc_offsets);
730
731
740double compute_imbalance(int nprocs, std::vector<int> &offsets,
741 double *wgts, double target);
742
743#endif //DOXYGEN_SHOULD_SKIP_THIS
744#endif //HAVE_EPETRA
745
746}//namespace Epetra
747}//namespace Isorropia
748
749#endif
750
#define __deprecated
Definition: Isorropia_ConfigDefs.hpp:94
Definition: Isorropia_EpetraCostDescriber.hpp:128
An implementation of the Partitioner interface that operates on Epetra matrices and linear systems.
Definition: Isorropia_EpetraPartitioner.hpp:122
Teuchos::RCP< Epetra_CrsMatrix > redistribute_rows(const Epetra_CrsMatrix &input_matrix, const Epetra_Map &target_rowmap, Epetra_Import *importer=0)
redistribute_rows() is an internal Isorropia function, not part of the API.
Teuchos::RCP< Epetra_MultiVector > redistribute(const Epetra_MultiVector &input, const Epetra_BlockMap &target_map, Epetra_Import *importer=0)
Return a new Epetra_MultiVector object constructed with target_map, and with the contents of 'input' ...
__deprecated Teuchos::RCP< Epetra_CrsMatrix > create_balanced_copy(const Epetra_CrsMatrix &input_matrix)
create_target_map() is an internal function used by Isorropia.
Epetra_MultiVector * createBalancedCopy(const Epetra_MultiVector &input_vector)
createBalancedCopy() creates a copy with a more balanced map.
Isorropia is the namespace that contains general definitions that apply to all partitioners and that ...
Definition: Isorropia_Epetra.hpp:60