Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Amesos_Superludist.h
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Amesos: Direct Sparse Solver Package
5 // Copyright (2004) 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 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
25 //
26 // ***********************************************************************
27 // @HEADER
28 
29 #ifndef AMESOS_SUPERLUDIST_H
30 #define AMESOS_SUPERLUDIST_H
31 
32 #if defined(Amesos_SHOW_DEPRECATED_WARNINGS)
33 #ifdef __GNUC__
34 #warning "The Amesos package is deprecated"
35 #endif
36 #endif
37 
38 #include "Amesos_ConfigDefs.h"
39 #include "Amesos_BaseSolver.h"
40 #include "Amesos_NoCopiable.h"
41 #include "Amesos_Utils.h"
42 #include "Amesos_Time.h"
43 #include "Amesos_Status.h"
44 #include "Amesos_Control.h"
45 #include "Epetra_LinearProblem.h"
46 #include "Teuchos_RCP.hpp"
47 #ifdef EPETRA_MPI
48 #include "Epetra_MpiComm.h"
49 #else
50 #include "Epetra_Comm.h"
51 #endif
52 
53 
54 // Amesos_Superludist_Pimpl contains a pointer to structures defined in
55 // superlu_ddefs.h. This prevents Amesos_Superludist.h
56 // from having to include superludist.h.
57 //
58 // Doxygen does not handle forward class references well.
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60 class Amesos_Superlu_Pimpl ;
61 #endif
62 
63 
65 
71  private Amesos_Time,
72  private Amesos_NoCopiable,
73  private Amesos_Utils,
74  private Amesos_Control,
75  private Amesos_Status
76 {
77 
78 public:
79 
81 
89  Amesos_Superludist(const Epetra_LinearProblem& LinearProblem);
90 
92  ~Amesos_Superludist(void);
95 
97 
98  int SymbolicFactorization() ;
99 
100  int NumericFactorization() ;
101 
102  int Solve();
103 
104 
106 
107 
109 
111  int SetUseTranspose(bool UseTranspose) { return( UseTranspose?1:0 );};
112 
114 
115 
116  const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
117 
119 
122  bool MatrixShapeOK() const;
123 
125  bool UseTranspose() const {return(false);};
127 
129 
132 
135 
137  int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
138 
140  void PrintTiming() const;
141 
143  void PrintStatus() const;
144 
146  void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
147 
148 private:
149  inline const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
150 
151  inline const Epetra_Import& Importer() const
152  {
153  return(*(Importer_.get()));
154  }
155 
156  inline const Epetra_Map& UniformMap() const
157  {
158  return(*(UniformMap_.get()));
159  }
160 
161  inline const Epetra_RowMatrix& UniformMatrix() const
162  {
163  return(*(UniformMatrix_.get()));
164  }
165 
167  {
168  return(*(CrsUniformMatrix_.get()));
169  }
170 
171  //
172  // PrivateSuperluData_ contains pointers to data needed by klu whose
173  // data structures are defined by klu.h
174  //
176 
177  int RedistributeA();
178 
179  int ReFactor();
180  int Factor();
181 
183  Epetra_RowMatrix *RowMatrixA_ ; // Problem_->GetOperator()
184 
189 
194 
200 
203 
204  // Ap, Ai, Aval form the compressed row storage used by SuperLU_DIST
205  std::vector <int> Ap_;
206  std::vector <int> Ai_;
207  std::vector <double> Aval_;
210 
211  int nprow_;
212  int npcol_;
213 
215  std::string ColPerm_;
216  std::string RowPerm_;
217  int* perm_c_;
218  int* perm_r_;
219  std::string IterRefine_;
221  bool Equil_;
222 
225 
226 }; // End of class Amesos_Superludist
227 #endif /* AMESOS_SUPERLUDIST_H */
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:73
bool UseTranspose() const
Always returns false. Superludist doesn&#39;t support transpose solve.
Amesos_Control: Container for some control variables.
int Solve()
Solves A X = B (or AT x = B)
bool ReuseSymbolic_
Allows FactOption to be used on subsequent calls to pdgssvx from NumericFactorization.
bool MatrixShapeOK() const
Returns true if SUPERLUDIST can handle this matrix shape.
Amesos_Superludist: An object-oriented wrapper for Superludist.
bool FactorizationOK_
true if NumericFactorization() has been successfully called.
std::vector< int > Ap_
~Amesos_Superludist(void)
Amesos_Superludist Destructor.
bool Redistribute_
redistribute the input matrix prior to calling Superludist
const Epetra_Import & Importer() const
T * get() const
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int NumSolve() const
Returns the number of solves performed by this object.
const Epetra_RowMatrix & UniformMatrix() const
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
int NumNumericFact_
Number of numeric factorization phases.
Definition: Amesos_Status.h:75
int GridCreated_
true if the SuperLU_DIST&#39;s grid has been created (and has to be free&#39;d)
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
int NumSolve_
Number of solves.
Definition: Amesos_Status.h:77
Epetra_CrsMatrix & CrsUniformMatrix()
Epetra_RowMatrix * RowMatrixA_
std::vector< double > Aval_
int NumericFactorization()
Performs NumericFactorization on the matrix A.
const Epetra_LinearProblem * GetProblem() const
Returns the Epetra_LinearProblem.
RCP< Epetra_Map > UniformMap_
const Epetra_Map & UniformMap() const
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Definition: Amesos_Time.h:130
Amesos_Status: Container for some status variables.
Definition: Amesos_Status.h:26
int * Global_Columns_
Contains the global ID of local columns.
Teuchos::RCP< Amesos_Superlu_Pimpl > PrivateSuperluData_
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:56
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list...
int SetUseTranspose(bool UseTranspose)
Amesos_Superludist does not support transpose at this time.
RCP< Epetra_RowMatrix > UniformMatrix_
int NumGlobalRows_
Global dimension of the matrix.
Amesos_Superludist(const Epetra_LinearProblem &LinearProblem)
Amesos_Superludist Constructor.
Teuchos::RCP< Epetra_Import > Importer_
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
void PrintStatus() const
Print various information about the parameters used by Superludist.
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
const Epetra_LinearProblem * Problem_
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =...
RCP< Epetra_CrsMatrix > CrsUniformMatrix_
std::vector< int > Ai_
Amesos_Utils: Collections of basic utilities.
Definition: Amesos_Utils.h:25
void PrintTiming() const
Print various timig.