Amesos Package Browser (Single Doxygen Collection)  Development
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 #include "Amesos_ConfigDefs.h"
33 #include "Amesos_BaseSolver.h"
34 #include "Amesos_NoCopiable.h"
35 #include "Amesos_Utils.h"
36 #include "Amesos_Time.h"
37 #include "Amesos_Status.h"
38 #include "Amesos_Control.h"
39 #include "Epetra_LinearProblem.h"
40 #include "Teuchos_RCP.hpp"
41 #ifdef EPETRA_MPI
42 #include "Epetra_MpiComm.h"
43 #else
44 #include "Epetra_Comm.h"
45 #endif
46 
47 
48 // Amesos_Superludist_Pimpl contains a pointer to structures defined in
49 // superlu_ddefs.h. This prevents Amesos_Superludist.h
50 // from having to include superludist.h.
51 //
52 // Doxygen does not handle forward class references well.
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54 class Amesos_Superlu_Pimpl ;
55 #endif
56 
57 
59 
65  private Amesos_Time,
66  private Amesos_NoCopiable,
67  private Amesos_Utils,
68  private Amesos_Control,
69  private Amesos_Status
70 {
71 
72 public:
73 
75 
83  Amesos_Superludist(const Epetra_LinearProblem& LinearProblem);
84 
86  ~Amesos_Superludist(void);
89 
91 
92  int SymbolicFactorization() ;
93 
94  int NumericFactorization() ;
95 
96  int Solve();
97 
98 
100 
101 
103 
105  int SetUseTranspose(bool UseTranspose) { return( UseTranspose?1:0 );};
106 
108 
109 
110  const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
111 
113 
116  bool MatrixShapeOK() const;
117 
119  bool UseTranspose() const {return(false);};
121 
123 
126 
129 
131  int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
132 
134  void PrintTiming() const;
135 
137  void PrintStatus() const;
138 
140  void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
141 
142 private:
143  inline const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
144 
145  inline const Epetra_Import& Importer() const
146  {
147  return(*(Importer_.get()));
148  }
149 
150  inline const Epetra_Map& UniformMap() const
151  {
152  return(*(UniformMap_.get()));
153  }
154 
155  inline const Epetra_RowMatrix& UniformMatrix() const
156  {
157  return(*(UniformMatrix_.get()));
158  }
159 
161  {
162  return(*(CrsUniformMatrix_.get()));
163  }
164 
165  //
166  // PrivateSuperluData_ contains pointers to data needed by klu whose
167  // data structures are defined by klu.h
168  //
170 
171  int RedistributeA();
172 
173  int ReFactor();
174  int Factor();
175 
177  Epetra_RowMatrix *RowMatrixA_ ; // Problem_->GetOperator()
178 
183 
188 
194 
197 
198  // Ap, Ai, Aval form the compressed row storage used by SuperLU_DIST
199  std::vector <int> Ap_;
200  std::vector <int> Ai_;
201  std::vector <double> Aval_;
204 
205  int nprow_;
206  int npcol_;
207 
209  std::string ColPerm_;
210  std::string RowPerm_;
211  int* perm_c_;
212  int* perm_r_;
213  std::string IterRefine_;
215  bool Equil_;
216 
219 
220 }; // End of class Amesos_Superludist
221 #endif /* AMESOS_SUPERLUDIST_H */
Amesos_Superludist::NumFactTime_
int NumFactTime_
Definition: Amesos_Superludist.h:218
Amesos_Superludist::OverheadTime_
int OverheadTime_
Definition: Amesos_Superludist.h:218
Amesos_Superludist::SetUseTranspose
int SetUseTranspose(bool UseTranspose)
Amesos_Superludist does not support transpose at this time.
Definition: Amesos_Superludist.h:105
Teuchos_RCP.hpp
Amesos_Superludist::SymbolicFactorization
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
Definition: Amesos_Superludist.cpp:672
Amesos_Superludist::NumericFactorization
int NumericFactorization()
Performs NumericFactorization on the matrix A.
Definition: Amesos_Superludist.cpp:680
Amesos_Superludist::MtxRedistTime_
int MtxRedistTime_
Definition: Amesos_Superludist.h:217
Amesos_Superludist::NumSolve
int NumSolve() const
Returns the number of solves performed by this object.
Definition: Amesos_Superludist.h:131
Amesos_Superludist::Importer_
Teuchos::RCP< Epetra_Import > Importer_
Definition: Amesos_Superludist.h:182
Amesos_Superludist::FactorizationOK_
bool FactorizationOK_
true if NumericFactorization() has been successfully called.
Definition: Amesos_Superludist.h:193
Amesos_Superludist::Ap_
std::vector< int > Ap_
Definition: Amesos_Superludist.h:199
Amesos_Status::NumSolve_
int NumSolve_
Number of solves.
Definition: Amesos_Status.h:71
Amesos_Superludist::perm_c_
int * perm_c_
Definition: Amesos_Superludist.h:211
Amesos_Superludist::ReplaceTinyPivot_
bool ReplaceTinyPivot_
Definition: Amesos_Superludist.h:214
Amesos_Superludist::Problem_
const Epetra_LinearProblem * Problem_
Definition: Amesos_Superludist.h:176
Amesos_Superludist::IterRefine_
std::string IterRefine_
Definition: Amesos_Superludist.h:213
Amesos_Superludist::MatrixShapeOK
bool MatrixShapeOK() const
Returns true if SUPERLUDIST can handle this matrix shape.
Definition: Amesos_Superludist.cpp:662
Amesos_NoCopiable.h
Amesos_NoCopiable
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =.
Definition: Amesos_NoCopiable.h:44
Amesos_Superludist::ReFactor
int ReFactor()
Definition: Amesos_Superludist.cpp:574
Amesos_Superludist::NumGlobalRows_
int NumGlobalRows_
Global dimension of the matrix.
Definition: Amesos_Superludist.h:196
Amesos_Superludist::RedistributeA
int RedistributeA()
Definition: Amesos_Superludist.cpp:247
Amesos_Superludist::UseTranspose
bool UseTranspose() const
Always returns false. Superludist doesn't support transpose solve.
Definition: Amesos_Superludist.h:119
Amesos_BaseSolver
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
Definition: Amesos_BaseSolver.h:223
Amesos_Superludist::PrintTiming
void PrintTiming() const
Print various timig.
Definition: Amesos_Superludist.cpp:838
Amesos_Superludist::perm_r_
int * perm_r_
Definition: Amesos_Superludist.h:212
Amesos_Superludist::UniformMap
const Epetra_Map & UniformMap() const
Definition: Amesos_Superludist.h:150
Amesos_Superludist::NumSymbolicFact
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
Definition: Amesos_Superludist.h:125
Amesos_Superludist::PrintNonzeros_
bool PrintNonzeros_
Definition: Amesos_Superludist.h:208
Amesos_Superludist::PrintStatus
void PrintStatus() const
Print various information about the parameters used by Superludist.
Definition: Amesos_Superludist.cpp:803
Amesos_Superludist::GetProblem
const Epetra_LinearProblem * GetProblem() const
Returns the Epetra_LinearProblem.
Definition: Amesos_Superludist.h:110
Amesos_Status::NumSymbolicFact_
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:67
Amesos_Superludist::Factor
int Factor()
Definition: Amesos_Superludist.cpp:308
Amesos_Superludist::ReuseSymbolic_
bool ReuseSymbolic_
Allows FactOption to be used on subsequent calls to pdgssvx from NumericFactorization.
Definition: Amesos_Superludist.h:185
Amesos_Superludist::RowPerm_
std::string RowPerm_
Definition: Amesos_Superludist.h:210
Amesos_Superludist::Importer
const Epetra_Import & Importer() const
Definition: Amesos_Superludist.h:145
Amesos_Time.h
Epetra_Comm
Amesos_Superludist::Ai_
std::vector< int > Ai_
Definition: Amesos_Superludist.h:200
Epetra_LinearProblem.h
Teuchos::RCP< Amesos_Superlu_Pimpl >
Epetra_CrsMatrix
Epetra_MpiComm.h
Amesos_Superludist::nprow_
int nprow_
Definition: Amesos_Superludist.h:205
Amesos_Superludist::MtxConvTime_
int MtxConvTime_
Definition: Amesos_Superludist.h:217
Amesos_Superludist::Redistribute_
bool Redistribute_
redistribute the input matrix prior to calling Superludist
Definition: Amesos_Superludist.h:187
Amesos_Status::NumNumericFact_
int NumNumericFact_
Number of numeric factorization phases.
Definition: Amesos_Status.h:69
Amesos_Utils
Amesos_Utils: Collections of basic utilities.
Definition: Amesos_Utils.h:19
Epetra_RowMatrix
Amesos_Superludist
Amesos_Superludist: An object-oriented wrapper for Superludist.
Definition: Amesos_Superludist.h:64
Amesos_BaseSolver.h
Amesos_Superludist::SetParameters
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
Definition: Amesos_Superludist.cpp:179
Amesos_Superludist::Solve
int Solve()
Solves A X = B (or AT x = B)
Definition: Amesos_Superludist.cpp:715
Epetra_LinearProblem
Amesos_Superlu_Pimpl
Definition: Amesos_Superludist.cpp:43
Amesos_Superludist::CrsUniformMatrix
Epetra_CrsMatrix & CrsUniformMatrix()
Definition: Amesos_Superludist.h:160
Amesos_Superludist::GridCreated_
int GridCreated_
true if the SuperLU_DIST's grid has been created (and has to be free'd)
Definition: Amesos_Superludist.h:190
Amesos_Control
Amesos_Control: Container for some control variables.
Definition: Amesos_Control.h:16
Amesos_Superludist::UniformMatrix
const Epetra_RowMatrix & UniformMatrix() const
Definition: Amesos_Superludist.h:155
Amesos_Superludist::PrivateSuperluData_
Teuchos::RCP< Amesos_Superlu_Pimpl > PrivateSuperluData_
Definition: Amesos_Superludist.h:169
Amesos_Superludist::Aval_
std::vector< double > Aval_
Definition: Amesos_Superludist.h:201
Epetra_Comm.h
Amesos_Superludist::CrsUniformMatrix_
RCP< Epetra_CrsMatrix > CrsUniformMatrix_
Definition: Amesos_Superludist.h:180
Amesos_ConfigDefs.h
Amesos_Superludist::npcol_
int npcol_
Definition: Amesos_Superludist.h:206
Amesos_Utils.h
Amesos_Control.h
Amesos_Time::GetTiming
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Definition: Amesos_Time.h:124
Amesos_Superludist::Equil_
bool Equil_
Definition: Amesos_Superludist.h:215
Amesos_Superludist::SolveTime_
int SolveTime_
Definition: Amesos_Superludist.h:218
Amesos_Superludist::RowMatrixA_
Epetra_RowMatrix * RowMatrixA_
Definition: Amesos_Superludist.h:177
Amesos_Superludist::~Amesos_Superludist
~Amesos_Superludist(void)
Amesos_Superludist Destructor.
Definition: Amesos_Superludist.cpp:159
Teuchos::RCP::get
T * get() const
Amesos_Superludist::GetTiming
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list.
Definition: Amesos_Superludist.h:140
Amesos_Superludist::Amesos_Superludist
Amesos_Superludist(const Epetra_LinearProblem &LinearProblem)
Amesos_Superludist Constructor.
Definition: Amesos_Superludist.cpp:105
Amesos_Superludist::ColPerm_
std::string ColPerm_
Definition: Amesos_Superludist.h:209
Teuchos::ParameterList
Amesos_Superludist::NumNumericFact
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
Definition: Amesos_Superludist.h:128
Amesos_Time
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:50
Amesos_Superludist::UniformMatrix_
RCP< Epetra_RowMatrix > UniformMatrix_
Definition: Amesos_Superludist.h:181
Epetra_Map
Amesos_Superludist::Comm
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Definition: Amesos_Superludist.h:143
Amesos_Superludist::FactorizationDone_
int FactorizationDone_
Definition: Amesos_Superludist.h:191
Amesos_Superludist::VecRedistTime_
int VecRedistTime_
Definition: Amesos_Superludist.h:217
Amesos_Superludist::Global_Columns_
int * Global_Columns_
Contains the global ID of local columns.
Definition: Amesos_Superludist.h:203
Epetra_Import
Amesos_Superludist::UniformMap_
RCP< Epetra_Map > UniformMap_
Definition: Amesos_Superludist.h:179
Amesos_Status
Amesos_Status: Container for some status variables.
Definition: Amesos_Status.h:20
Amesos_Status.h