Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Amesos_CssMKL.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_CSSMKL_H
30 #define AMESOS_CSSMKL_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_Support.h"
45 #include "Amesos_Control.h"
46 #include "Epetra_LinearProblem.h"
47 #include "Epetra_Time.h"
48 #include "Epetra_Map.h"
49 #include "Epetra_Import.h"
50 #include "Epetra_Comm.h"
51 #include "Epetra_RowMatrix.h"
52 #include "Epetra_CrsMatrix.h"
54 #include "Teuchos_RCP.hpp"
55 
57 
65  private Amesos_Time,
66  private Amesos_NoCopiable,
67  private Amesos_Utils,
68  private Amesos_Control,
69  private Amesos_Status {
70 
71 public:
72 
74  Amesos_CssMKL(const Epetra_LinearProblem& LinearProblem );
76 
80 
82 
84  int SymbolicFactorization() ;
85 
87  int NumericFactorization() ;
88 
90  int Solve();
92 
94 
96  const Epetra_LinearProblem* GetProblem() const { return(Problem_); }
97 
99 
102  bool MatrixShapeOK() const;
103 
105 
110 
112  bool UseTranspose() const { return(UseTranspose_); }
113 
115  const Epetra_Comm& Comm() const { return(GetProblem()->GetOperator()->Comm()); }
116 
119 
122 
125 
127  int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
128 
130  void PrintTiming() const;
131 
133  void PrintStatus() const;
134 
136  void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
137 
139 
140 private:
141  int CheckError(const int error) const;
142 
143  inline const Epetra_Map& Map() const
144  {
145  return(Matrix_->RowMatrixRowMap());
146  }
147 
148  inline const Epetra_RowMatrix& Matrix() const
149  {
150  return(*Matrix_);
151  }
152 
153  int ConvertToCssMKL();
156 
157 
161 
166 
170 
171  // Data for CSSMKL
172  std::vector<double> aa_;
173  std::vector<int> ia_;
174  std::vector<int> ja_;
175  std::vector<int> perm_;
176 
177  void* pt_[64];
178 
179  int iparm_[64];
180  double dparm_[64];
181  int mtype_;
182  int maxfct_; // Maximal number of factors with idential nonzero pattern (always 1)
183  int mnum_;
184  int msglvl_;
185  int nrhs_; // Number of RHS
186 
188 
189  MPI_Fint CssComm_;
190 }; // class Amesos_CssMKL
191 #endif
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:73
Amesos_Control: Container for some control variables.
MPI_Fint CssComm_
void PrintTiming() const
Prints timing information.
Teuchos::RCP< Amesos_StandardIndex > StdIndex_
virtual const Epetra_Map & RowMatrixRowMap() const =0
int NumNumericFact() const
Returns the number of numeric factorizations performed by this object.
int msglvl_
Actual matrix for solution phase (always 1)
std::vector< double > aa_
std::vector< int > perm_
int PerformSymbolicFactorization()
Teuchos::ParameterList param_
int Solve()
Solves A X = B (or AT X = B)
const Epetra_LinearProblem * Problem_
Pointer to the linear system problem.
int NumSolve() const
Returns the number of solves performed by this object.
const Epetra_Map & Map() const
std::vector< int > ia_
const Epetra_LinearProblem * GetProblem() const
Get a pointer to the Problem.
Definition: Amesos_CssMKL.h:96
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
int nrhs_
Output level.
int MtxConvTime_
Quick access pointers to the internal timing data.
int NumNumericFact_
Number of numeric factorization phases.
Definition: Amesos_Status.h:75
const Epetra_RowMatrix & Matrix() const
Amesos_CssMKL(const Epetra_LinearProblem &LinearProblem)
Constructor.
std::vector< int > ja_
~Amesos_CssMKL()
Destructor.
int NumSolve_
Number of solves.
Definition: Amesos_Status.h:77
void * pt_[64]
bool UseTranspose() const
Returns the current UseTranspose setting.
void GetTiming(Teuchos::ParameterList &list) const
Load up the current timing information into the parameter list.
Definition: Amesos_Time.h:130
bool UseTranspose_
If true, the transpose of A is used.
bool MatrixShapeOK() const
Returns true if CSSMKL can handle this matrix shape.
double dparm_[64]
int SetUseTranspose(bool UseTranspose)
SetUseTranpose()
Amesos_Status: Container for some status variables.
Definition: Amesos_Status.h:26
const Epetra_RowMatrix * OriginalMatrix_
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:56
void PrintStatus() const
Prints information about the factorization and solution phases.
const Epetra_RowMatrix * Matrix_
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int PerformNumericFactorization()
int SetParameters(Teuchos::ParameterList &ParameterList)
Set parameters from the input parameters list, returns 0 if successful.
int NumSymbolicFact() const
Returns the number of symbolic factorizations performed by this object.
void GetTiming(Teuchos::ParameterList &TimingParameterList) const
Extracts timing information from the current solver and places it in the parameter list...
Amesos_CssMKL: Interface to the CSSMKL package.
Definition: Amesos_CssMKL.h:64
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
Amesos_NoCopiable: Simple class to prevent the usage of copy constructor and operator =...
int CheckError(const int error) const
Amesos_Utils: Collections of basic utilities.
Definition: Amesos_Utils.h:25