Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Amesos_CssMKL.cpp
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 #include "Amesos_CssMKL.h"
30 #include "Epetra_Map.h"
31 #include "Epetra_MpiComm.h"
32 #include "Epetra_Import.h"
33 #include "Epetra_CrsMatrix.h"
34 #include "Epetra_Vector.h"
35 #include "Epetra_Util.h"
36 
37 #include "mkl_pardiso.h"
38 #include "mkl_cluster_sparse_solver.h"
39 #define IPARM(i) iparm_[i-1]
40 
41 using namespace Teuchos;
42 
43 //=============================================================================
45  UseTranspose_(false),
46  Problem_(&prob),
47  MtxConvTime_(-1),
48  MtxRedistTime_(-1),
49  VecRedistTime_(-1),
50  SymFactTime_(-1),
51  NumFactTime_(-1),
52  SolveTime_(-1),
53  mtype_(11),
54  maxfct_(1),
55  mnum_(1),
56  msglvl_(0),
57  nrhs_(1)
58 {
59  for( int i = 0; i < 64; ++i ){
60  pt_[i] = nullptr;
61  iparm_[i] = 0;
62  }
63  iparm_[0] = 1; /* No solver default */
64  // Reset some of the default parameters
65  iparm_[1] = 10; /* 2: Fill-in reordering from METIS, 3: thread dissection, 10: MPI version of the nested dissection and symbolic factorization*/
66  /* Numbers of processors, value of OMP_NUM_THREADS */
67  iparm_[7] = 0; /* Max numbers of iterative refinement steps */
68  iparm_[9] = 13; /* Perturb the pivot elements with 1E-13 */
69  iparm_[10] = 0; /* Disable nonsymmetric permutation and scaling MPS */
70  iparm_[11] = 0; /* Normal solve (0), or a transpose solve (1) */
71  iparm_[12] = 0; /* Do not use (non-)symmetric matchings */
72  iparm_[17] = -1; /* Output: Number of nonzeros in the factor LU */
73  iparm_[20] = -1; /* Pivoting for symmetric indefinite matrices */
74  iparm_[26] = 1; /* Check input matrix is sorted */
75  iparm_[27] = 0; /* double-precision */
76  iparm_[34] = 1; /* Use zero-based indexing */
77 
78  /* -------------------------------------------------------------------- */
79  /* .. Initialize the internal solver memory pointer. This is only */
80  /* necessary for the FIRST call of the CSS solver. */
81  /* -------------------------------------------------------------------- */
82  for (int i = 0; i < 64; i++) {
83  pt_[i] = 0;
84  }
85 }
86 
87 //=============================================================================
89 {
90  /*
91  * Free any memory allocated by the CssMKL library functions
92  */
93  int error = 0;
95  {
96  int phase = -1; // release all internal solver memory
97  int n = Matrix_->NumGlobalRows();
98  void *bdummy, *xdummy;
99  const MPI_Fint CssComm = CssComm_;
100  cluster_sparse_solver( pt_, const_cast<int*>(&maxfct_),
101  const_cast<int*>(&mnum_), &mtype_, &phase, &n,
102  &aa_[0], &ia_[0], &ja_[0],
103  &perm_[0], &nrhs_, iparm_,
104  const_cast<int*>(&msglvl_), &bdummy, &xdummy, &CssComm, &error );
107  }
108 
109  AMESOS_CHK_ERRV(CheckError(error));
110  // print out some information if required by the user
111  if ((verbose_ && PrintTiming_) || verbose_ == 2) PrintTiming();
112  if ((verbose_ && PrintStatus_) || verbose_ == 2) PrintStatus();
113 }
114 
115 //=============================================================================
117 {
118  ResetTimer();
119 
120  // =========================================================== //
121  // Load Matrix from Problem //
122  // =========================================================== //
124  if ( Reindex_ ) {
125 #ifdef HAVE_AMESOS_EPETRAEXT
126  auto CrsMatrix = dynamic_cast<Epetra_CrsMatrix *>(Problem_->GetOperator());
127  if(!CrsMatrix) {
128  std::cerr << "Amesos_CssMKL requires CsrMatrix to reindex matrices." << std::endl;
129  AMESOS_CHK_ERR(-8);
130  }
131  const Epetra_Map& OriginalMap = CrsMatrix->RowMap();
132  StdIndex_ = rcp( new Amesos_StandardIndex( OriginalMap ) );
133  Matrix_ = StdIndex_->StandardizeIndex( CrsMatrix );
134  if(!Matrix_) {
135  std::cerr << "Amesos_CssMKL reindexing failed" << std::endl;
136  AMESOS_CHK_ERR(-8);
137  }
138 #else
139  std::cerr << "Amesos_CssMKL requires EpetraExt to reindex matrices." << std::endl;
140  AMESOS_CHK_ERR(-8);
141 #endif
142  } else {
143  Matrix_ = dynamic_cast<Epetra_RowMatrix*>(Problem_->GetOperator());
144  }
145 
146  // =========================================================== //
147  // Read Matrix into Crs (with Linear/Uniform index) //
148  // =========================================================== //
149  int ierr;
150  int MaxNumEntries_ = Matrix_->MaxNumEntries();
151  int NumMyElements = Matrix_->NumMyRows();
152  int nnz_loc = Matrix_->NumMyNonzeros();
153  ia_.resize( NumMyElements+1 );
154  ja_.resize( EPETRA_MAX( NumMyElements, nnz_loc) );
155  aa_.resize( EPETRA_MAX( NumMyElements, nnz_loc) );
156 
157  std::vector<int> ColIndicesV_(MaxNumEntries_);
158  std::vector<double> RowValuesV_(MaxNumEntries_);
159 
160  int *Global_Columns_ = Matrix_->RowMatrixColMap().MyGlobalElements();
161 
162  // for sorting column indexes
163  typedef std::pair<int, double> Data;
164  std::vector<Data> sort_array(MaxNumEntries_);
165 
166  // NOTE : Assumes input is distributed in contiguous 1D Block
167  int NzThisRow;
168  int Ai_index = 0;
169  for (int MyRow = 0; MyRow < NumMyElements ; MyRow++)
170  {
171  ierr = Matrix_->ExtractMyRowCopy(MyRow, MaxNumEntries_, NzThisRow,
172  &RowValuesV_[0], &ColIndicesV_[0]);
173  AMESOS_CHK_ERR(ierr);
174 
175  double *RowValues = &RowValuesV_[0];
176  int *ColIndices = &ColIndicesV_[0];
177 
178  // sort column indexes (default std::sort by first elements of pair)
179  for ( int j = 0; j < NzThisRow; j++ ) {
180  sort_array[j].first = Global_Columns_[ColIndices[j]];
181  sort_array[j].second = RowValues[j];
182  }
183  std::sort(&sort_array[0], &sort_array[NzThisRow]);
184 
185  ia_[MyRow] = Ai_index ;
186  for ( int j = 0; j < NzThisRow; j++ ) {
187  ja_[Ai_index] = sort_array[j].first; //Global_Columns_[ColIndices[j]];
188  aa_[Ai_index] = sort_array[j].second; //RowValues[j];
189  Ai_index++;
190  }
191  }
192  ia_[ NumMyElements ] = Ai_index;
193  assert( NumMyElements == MyRow );
194 
195  MtxConvTime_ = AddTime("Total matrix conversion time", MtxConvTime_);
196 
197  return 0;
198 }
199 
200 //=============================================================================
202 {
203  // retrive general parameters
204 
205  SetStatusParameters( ParameterList );
206 
207  SetControlParameters( ParameterList );
208 
209  // We fill iparm_ using named parameters
210  if (ParameterList.isSublist("CssMKL"))
211  {
212  param_ = ParameterList.sublist("CssMKL");
213  }
214 
215  msglvl_ = param_.get<int>("Message level", 0);
216  iparm_[0] = param_.get<int>("No default parameters", 1);
217  iparm_[1] = param_.get<int>("Use METIS reordering" , 10);
218  iparm_[7] = param_.get<int>("Max num of iterative refinement steps", 0);
219  iparm_[9] = param_.get<int>("Perturbation for pivot elements 10^-k", 13);
220  iparm_[10] = param_.get<int>("Use (non-)symmetric scaling vectors", 0);
221  iparm_[11] = param_.get<int>("Solve transposed", 0);
222  iparm_[12] = param_.get<int>("Use (non-)symmetric matchings", 0);
223  iparm_[17] = param_.get<int>("Number of non-zeros in LU; -1 to compute", -1);
224  iparm_[20] = param_.get<int>("Pivot for symmetric indefinite matrix", -1);
225 
226  return 0;
227 }
228 
229 //=============================================================================
231 {
232  ResetTimer();
233 
234  int error = 0;
235  {
236  // Get communicator
237  const Epetra_MpiComm& EMpiComm = dynamic_cast<const Epetra_MpiComm&>(Comm());
238  const MPI_Comm CssEComm = EMpiComm.Comm();
239  CssComm_ = MPI_Comm_c2f(CssEComm);
240 
241  // Set matrix 1D block distribution
242  auto rangeMap = Matrix_->RowMatrixRowMap();
243  int n = Matrix_->NumGlobalRows();
244  int first_row = rangeMap.MinMyGID();
245  int last_row = rangeMap.MaxMyGID();
246  iparm_[39] = 2; /* Matrix input format. */
247  iparm_[40] = first_row; /* > Beginning of input domain. */
248  iparm_[41] = last_row; /* > End of input domain. */
249 
250  // Allocate perm
251  perm_.resize(n);
252 
253  // Perform Symbolic Analysis
254  int phase = 11; // Analysis
255  void *bdummy, *xdummy;
256  const MPI_Fint CssComm = CssComm_;
257 
258  cluster_sparse_solver( pt_, const_cast<int*>(&maxfct_),
259  const_cast<int*>(&mnum_), &mtype_, &phase, &n,
260  &aa_[0], &ia_[0], &ja_[0],
261  &perm_[0], &nrhs_, iparm_,
262  const_cast<int*>(&msglvl_), &bdummy, &xdummy, &CssComm, &error );
263  }
264  SymFactTime_ = AddTime("Total symbolic factorization time", SymFactTime_);
265 
266  AMESOS_CHK_ERR(CheckError(error));
267  return error;
268 }
269 
270 //=============================================================================
272 {
273  ResetTimer();
274 
275  int error = 0;
276  {
277  //int phase = 12; // Analysis, numerical factorization
278  int phase = 22; // Analysis, numerical factorization
279  int n = Matrix_->NumGlobalRows();
280  void *bdummy, *xdummy;
281  const MPI_Fint CssComm = CssComm_;
282  cluster_sparse_solver( pt_, const_cast<int*>(&maxfct_),
283  const_cast<int*>(&mnum_), &mtype_, &phase, &n,
284  &aa_[0], &ia_[0], &ja_[0],
285  &perm_[0], &nrhs_, iparm_,
286  const_cast<int*>(&msglvl_), &bdummy, &xdummy, &CssComm, &error );
287  }
288  NumFactTime_ = AddTime("Total numeric factorization time", NumFactTime_);
289 
290  // Any failure should be sent to all other processors.
291  AMESOS_CHK_ERR(CheckError(error));
292  return error;
293 }
294 
295 //=============================================================================
297 {
298  bool OK = true;
299 
300  if (GetProblem()->GetOperator()->OperatorRangeMap().NumGlobalPoints() !=
301  GetProblem()->GetOperator()->OperatorDomainMap().NumGlobalPoints() )
302  {
303  OK = false;
304  }
305  return OK;
306 }
307 
308 //=============================================================================
310 {
313 
314  CreateTimer(Comm());
315 
317 
318  // =========================================================== //
319  // Convert the matrix into CSR format, //
320  // =========================================================== //
321  ConvertToCssMKL();
322 
323  // =========================================================== //
324  // Perform Symbolic //
325  // =========================================================== //
327 
329 
330  return(0);
331 }
332 
333 //=============================================================================
335 {
337 
338  if (IsSymbolicFactorizationOK_ == false)
340 
341  ++NumNumericFact_;
342 
343  // =========================================================== //
344  // (Re)Convert the matrix into CSR format, //
345  // =========================================================== //
346  // FIXME: this must be checked, now all the matrix is shipped twice here
347  ConvertToCssMKL();
348 
349  // =========================================================== //
350  // Perform Numeric //
351  // =========================================================== //
353 
355 
356  return(0);
357 }
358 
359 //=============================================================================
361 {
362  if (IsNumericFactorizationOK_ == false)
364 
367 
368  if ((X == 0) || (B == 0))
369  AMESOS_CHK_ERR(-1);
370 
371  int NumVectors = X->NumVectors();
372  if (NumVectors != B->NumVectors())
373  AMESOS_CHK_ERR(-1);
374 
375  ResetTimer();
376  VecRedistTime_ = AddTime("Total vector redistribution time", VecRedistTime_);
377 
378  ResetTimer();
379  int error = 0;
380  {
381  double* XValues;
382  double* BValues;
383  int LDA;
384 
385  // FIXME: check LDA
386  AMESOS_CHK_ERR(X->ExtractView(&XValues,&LDA));
387  AMESOS_CHK_ERR(B->ExtractView(&BValues,&LDA));
388 
389  int idum = 0;
390  int n = Matrix().NumGlobalRows();
391  int phase = 33;
392 
393  const MPI_Fint CssComm = CssComm_;
394 
395  nrhs_ = NumVectors;
396  cluster_sparse_solver( pt_, const_cast<int*>(&maxfct_),
397  const_cast<int*>(&mnum_), &mtype_, &phase, &n,
398  &aa_[0], &ia_[0], &ja_[0],
399  &perm_[0], &nrhs_, iparm_,
400  const_cast<int*>(&msglvl_),
401  BValues,
402  XValues,
403  &CssComm, &error );
404  }
405  SolveTime_ = AddTime("Total solve time", SolveTime_);
406 
407  // Any failure should be sent to all other processors.
408  Comm().Broadcast( &error, 1, 0 );
409  if ( error ) {
410  if (Comm().MyPID() == 0) {
411  AMESOS_CHK_ERR(CheckError(error));
412  } else
413  return error;
414  }
415 
416  // Copy X back to the original vector
417  ResetTimer();
418  VecRedistTime_ = AddTime("Total vector redistribution time", VecRedistTime_);
419 
421  ComputeTrueResidual(Matrix(), *X, *B, UseTranspose(), "Amesos_CssMKL");
422 
424  ComputeVectorNorms(*X, *B, "Amesos_CssMKL");
425 
426  ++NumSolve_;
427 
428  return(0) ;
429 }
430 
431 // ======================================================================
433 {
434  if (Problem_->GetOperator() == 0 || Comm().MyPID() != 0)
435  return;
436 
437  std::string p = "Amesos_CssMKL : ";
438  PrintLine();
439 
440  int n = Matrix().NumGlobalRows();
441  int nnz = Matrix().NumGlobalNonzeros();
442 
443  std::cout << p << "Matrix has " << n << " rows"
444  << " and " << nnz << " nonzeros" << std::endl;
445  std::cout << p << "Nonzero elements per row = "
446  << 1.0 * nnz / n << std::endl;
447  std::cout << p << "Percentage of nonzero elements = "
448  << 100.0 * nnz /(pow(n,2.0)) << std::endl;
449  std::cout << p << "Use transpose = " << UseTranspose_ << std::endl;
450  std::cout << p << "Number of performed iterative ref. steps = " << IPARM(9) << std::endl;
451  std::cout << p << "Peak memory symbolic factorization = " << IPARM(15) << std::endl;
452  std::cout << p << "Permanent memory symbolic factorization = " << IPARM(16) << std::endl;
453  std::cout << p << "Memory numerical fact. and solution = " << IPARM(17) << std::endl;
454  std::cout << p << "Number of nonzeros in factors = " << IPARM(18) << std::endl;
455  std::cout << p << "MFlops of factorization = " << IPARM(19) << std::endl;
456  std::cout << p << "CG/CGS diagnostic = " << IPARM(20) << std::endl;
457  std::cout << p << "Inertia: Number of positive eigenvalues = " << IPARM(22) << std::endl;
458  std::cout << p << "Inertia: Number of negative eigenvalues = " << IPARM(23) << std::endl;
459 
460  PrintLine();
461 
462  return;
463 }
464 
465 // ======================================================================
467 {
468  if (Problem_->GetOperator() == 0 || Comm().MyPID() != 0)
469  return;
470 
471  double ConTime = GetTime(MtxConvTime_);
472  double MatTime = GetTime(MtxRedistTime_);
473  double VecTime = GetTime(VecRedistTime_);
474  double SymTime = GetTime(SymFactTime_);
475  double NumTime = GetTime(NumFactTime_);
476  double SolTime = GetTime(SolveTime_);
477 
478  if (NumSymbolicFact_)
479  SymTime /= NumSymbolicFact_;
480 
481  if (NumNumericFact_)
482  NumTime /= NumNumericFact_;
483 
484  if (NumSolve_)
485  SolTime /= NumSolve_;
486 
487  std::string p = "Amesos_CssMKL : ";
488  PrintLine();
489 
490  std::cout << p << "Time to convert matrix to CssMKL format = "
491  << ConTime << " (s)" << std::endl;
492  std::cout << p << "Time to redistribute matrix = "
493  << MatTime << " (s)" << std::endl;
494  std::cout << p << "Time to redistribute vectors = "
495  << VecTime << " (s)" << std::endl;
496  std::cout << p << "Number of symbolic factorizations = "
497  << NumSymbolicFact_ << std::endl;
498  std::cout << p << "Time for sym fact = "
499  << SymTime << " (s), avg = " << SymTime << " (s)" << std::endl;
500  std::cout << p << "Number of numeric factorizations = "
501  << NumNumericFact_ << std::endl;
502  std::cout << p << "Time for num fact = "
503  << NumTime << " (s), avg = " << NumTime << " (s)" << std::endl;
504  std::cout << p << "Number of solve phases = "
505  << NumSolve_ << std::endl;
506  std::cout << p << "Time for solve = "
507  << SolTime << " (s), avg = " << SolTime << " (s)" << std::endl;
508 
509  PrintLine();
510 
511  return;
512 }
513 
514 // ======================================================================
515 int Amesos_CssMKL::CheckError(const int error) const
516 {
517  if (!error)
518  return 0;
519 
520  std::cerr << "Amesos: CSS returned error code " << error << std::endl;
521  std::cerr << "Amesos: Related message from manual is:" << std::endl;
522 
523  switch(error)
524  {
525  case -1:
526  std::cerr << "Input inconsistent" << std::endl;
527  break;
528  case -2:
529  std::cerr << "Not enough memory" << std::endl;
530  break;
531  case -3:
532  std::cerr << "Reordering problems" << std::endl;
533  break;
534  case -4:
535  std::cerr << "Zero pivot, numerical fact. or iterative refinement problem. " << std::endl;
536  break;
537  case -5:
538  std::cerr << "Unclassified (internal) error" << std::endl;
539  break;
540  case -6:
541  std::cerr << "Preordering failed (matrix types 11, 13 only)" << std::endl;
542  break;
543  case -7:
544  std::cerr << "Diagonal matrix problem." << std::endl;
545  break;
546  }
547 
548  AMESOS_RETURN(error);
549 }
int NumSymbolicFact_
Number of symbolic factorization phases.
Definition: Amesos_Status.h:73
MPI_Fint CssComm_
void PrintTiming() const
Prints timing information.
Teuchos::RCP< Amesos_StandardIndex > StdIndex_
virtual const Epetra_Map & RowMatrixRowMap() const =0
void PrintLine() const
Prints line on std::cout.
Definition: Amesos_Utils.h:77
Epetra_MultiVector * GetLHS() const
int msglvl_
Actual matrix for solution phase (always 1)
Epetra_MultiVector * GetRHS() const
std::vector< double > aa_
bool IsSymbolicFactorizationOK_
If true, SymbolicFactorization() has been successfully called.
Definition: Amesos_Status.h:54
int MyGlobalElements(int *MyGlobalElementList) const
T & get(ParameterList &l, const std::string &name)
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.
std::vector< int > ia_
RCP< ParameterList > sublist(const RCP< ParameterList > &paramList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
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.
void CreateTimer(const Epetra_Comm &Comm, int size=1)
Initializes the Time object.
Definition: Amesos_Time.h:70
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
virtual int NumGlobalNonzeros() const =0
virtual int MyPID() const =0
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
virtual int MaxNumEntries() const =0
void SetStatusParameters(const Teuchos::ParameterList &ParameterList)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
bool ComputeVectorNorms_
If true, prints the norms of X and B in Solve().
Definition: Amesos_Status.h:62
void SetControlParameters(const Teuchos::ParameterList &ParameterList)
#define AMESOS_CHK_ERR(a)
bool isSublist(const std::string &name) const
void * pt_[64]
bool UseTranspose() const
Returns the current UseTranspose setting.
bool UseTranspose_
If true, the transpose of A is used.
bool MatrixShapeOK() const
Returns true if CSSMKL can handle this matrix shape.
bool PrintTiming_
If true, prints timing information in the destructor.
Definition: Amesos_Status.h:58
virtual int NumMyRows() const =0
MPI_Comm Comm() const
const Epetra_RowMatrix * OriginalMatrix_
bool PrintStatus_
If true, print additional information in the destructor.
Definition: Amesos_Status.h:60
std::string error
#define AMESOS_RETURN(amesos_err)
int AddTime(const std::string what, int dataID, const int timerID=0)
Adds to field what the time elapsed since last call to ResetTimer().
Definition: Amesos_Time.h:86
virtual int Broadcast(double *MyVals, int Count, int Root) const =0
bool Reindex_
If true, the Amesos class should reindex the matrix to standard indexing (i.e.
void PrintStatus() const
Prints information about the factorization and solution phases.
const Epetra_RowMatrix * Matrix_
void ComputeTrueResidual(const Epetra_RowMatrix &Matrix, const Epetra_MultiVector &X, const Epetra_MultiVector &B, const bool UseTranspose, const std::string prefix) const
Computes the true residual, B - Matrix * X, and prints the results.
Definition: Amesos_Utils.h:35
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.
void ResetTimer(const int timerID=0)
Resets the internally stored time object.
Definition: Amesos_Time.h:80
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const =0
Epetra_Operator * GetOperator() const
virtual const Epetra_Map & RowMatrixColMap() const =0
int verbose_
Toggles the output level.
Definition: Amesos_Status.h:67
double GetTime(const std::string what) const
Gets the cumulative time using the string.
Definition: Amesos_Time.h:108
#define IPARM(i)
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
#define AMESOS_CHK_ERRV(amesos_err)
bool IsNumericFactorizationOK_
If true, NumericFactorization() has been successfully called.
Definition: Amesos_Status.h:56
int n
virtual int NumGlobalRows() const =0
virtual int NumMyNonzeros() const =0
int CheckError(const int error) const
#define EPETRA_MAX(x, y)
void ComputeVectorNorms(const Epetra_MultiVector &X, const Epetra_MultiVector &B, const std::string prefix) const
Computes the norms of X and B and print the results.
Definition: Amesos_Utils.h:58
bool ComputeTrueResidual_
If true, computes the true residual in Solve().
Definition: Amesos_Status.h:64