Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Amesos_TestSolver.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_ConfigDefs.h"
31 #include "Teuchos_TimeMonitor.hpp"
32 #include <string>
33 // #include "Trilinos_Util_ReadTriples2Epetra.h"
34 #include "Trilinos_Util.h"
35 // #include "Trilinos_Util_ReadMatrixMarket2Epetra.h"
36 #include "Epetra_LocalMap.h"
37 #include "Epetra_Map.h"
38 #include "Epetra_Vector.h"
39 #include "Epetra_Export.h"
40 #include "Epetra_CrsMatrix.h"
41 #include "Epetra_LinearProblem.h"
42 #include "Amesos_Time.h"
43 
44 #ifdef TEST_SPOOLES
45 #include "SpoolesOO.h"
46 #endif
47 #ifdef HAVE_AMESOS_SUPERLU
48 #include "Amesos_Superlu.h"
49 #endif
50 #ifdef HAVE_AMESOS_SUPERLUDIST
51 #include "Amesos_Superludist.h"
52 #endif
53 #ifdef HAVE_AMESOS_SLUD
54 #include "SuperludistOO.h"
55 #endif
56 #ifdef HAVE_AMESOS_SLUS
57 #include "Epetra_SLU.h"
58 #endif
59 #ifdef HAVE_AMESOS_SLUD2
60 #include "Superludist2_OO.h"
61 #endif
62 #ifdef TEST_AZTEC
63 #include "AztecOO.h"
64 #endif
65 #ifdef HAVE_AMESOS_DSCPACK
66 #include "Amesos_Dscpack.h"
67 #endif
68 #ifdef HAVE_AMESOS_LAPACK
69 #include "Amesos_Lapack.h"
70 #endif
71 #ifdef HAVE_AMESOS_UMFPACK
72 #include "Amesos_Umfpack.h"
73 #endif
74 #ifdef HAVE_AMESOS_KLU
75 #include "Amesos_Klu.h"
76 #endif
77 #ifdef HAVE_AMESOS_SCALAPACK
78 #include "Amesos_Scalapack.h"
79 #endif
80 #ifdef HAVE_AMESOS_TAUCS
81 #include "Amesos_Taucs.h"
82 #endif
83 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
84 #include "Amesos_Pardiso.h"
85 #endif
86 #ifdef HAVE_AMESOS_CSS_MKL
87 #include "Amesos_CssMKL.h"
88 #endif
89 #ifdef HAVE_AMESOS_PARAKLETE
90 #include "Amesos_Paraklete.h"
91 #endif
92 #if defined(HAVE_AMESOS_MUMPS) && defined(HAVE_MPI)
93 #include "Amesos_Mumps.h"
94 #endif
95 
96 #include "Amesos_TestSolver.h"
97 #include "CrsMatrixTranspose.h"
98 #include "SparseDirectTimingVars.h"
99 
100 //
101 // Amesos_TestSolver.cpp reads in a matrix in Harwell-Boeing format,
102 // calls one of the sparse direct solvers and computes the error
103 // and residual.
104 //
105 // It reads the matrix in on a single processor and can pass that
106 // matrix to the solver or it can convert that matrix to a
107 // distributed matrix and pass the distributed matrix to the solver.
108 //
109 // Amesos_TestSolver can test either A x = b or A^T x = b.
110 // This can be a bit confusing because sparse direct solvers
111 // use compressed column storage - the transpose of Trilinos'
112 // sparse row storage.
113 //
114 // Matrices:
115 // readA - Serial. As read from the file.
116 // transposeA - Serial. The transpose of readA.
117 // serialA - if (transpose) then transposeA else readA
118 // distributedA - readA distributed to all processes
119 // passA - if ( distributed ) then distributedA else serialA
120 //
121 //
122 
123 int Amesos_TestSolver( Epetra_Comm &Comm, char *matrix_file,
124  SparseSolverType SparseSolver,
125  bool transpose,
126  int special, AMESOS_MatrixType matrix_type ) {
127 
128 
129  Epetra_Map * readMap;
130  Epetra_Vector * readx;
131  Epetra_Vector * readb;
132  Epetra_Vector * readxexact;
133  Epetra_CrsMatrix *serialA;
134 
135  std::string FileName = matrix_file ;
136  int FN_Size = FileName.size() ;
137  std::string LastFiveBytes = FileName.substr( EPETRA_MAX(0,FN_Size-5), FN_Size );
138  std::string LastFourBytes = FileName.substr( EPETRA_MAX(0,FN_Size-4), FN_Size );
139  bool NonContiguousMap = false;
140  {
141  Teuchos::RCP< Teuchos::Time > ioTimer = Teuchos::TimeMonitor::getNewCounter ("TestSolver::Matrix Read");
142  Teuchos::TimeMonitor LocalTimer (*ioTimer);
143  if ( LastFiveBytes == ".triU" ) {
144  // Call routine to read in unsymmetric Triplet matrix
145  NonContiguousMap = true;
146  EPETRA_CHK_ERR( Trilinos_Util_ReadTriples2Epetra( matrix_file, false, Comm, readMap, serialA, readx,
147  readb, readxexact, NonContiguousMap ) );
148  } else {
149  if ( LastFiveBytes == ".triS" ) {
150  NonContiguousMap = true;
151  // Call routine to read in symmetric Triplet matrix
152  EPETRA_CHK_ERR( Trilinos_Util_ReadTriples2Epetra( matrix_file, true, Comm, readMap, serialA, readx,
153  readb, readxexact, NonContiguousMap ) );
154  } else {
155  if ( LastFourBytes == ".mtx" ) {
156  EPETRA_CHK_ERR( Trilinos_Util_ReadMatrixMarket2Epetra( matrix_file, Comm, readMap,
157  serialA, readx, readb, readxexact) );
158  } else {
159  // Call routine to read in HB problem
160  Trilinos_Util_ReadHb2Epetra( matrix_file, Comm, readMap, serialA, readx,
161  readb, readxexact);
162  }
163  }
164  }
165  }
166 
167  Epetra_CrsMatrix transposeA(Copy, *readMap, 0);
168 
169  if ( transpose ) {
170  assert( CrsMatrixTranspose( serialA, &transposeA ) == 0 );
171  serialA = &transposeA;
172  }
173 
174  Epetra_RowMatrix * passA = 0;
175  Epetra_Vector * passx = 0;
176  Epetra_Vector * passb = 0;
177  Epetra_Vector * passxexact = 0;
178  Epetra_Vector * passresid = 0;
179  Epetra_Vector * passtmp = 0;
180 
181  // Create uniform distributed map
182  Epetra_Map map(readMap->NumGlobalElements(), 0, Comm);
183  Epetra_Map* map_;
184 
185  if( NonContiguousMap ) {
186  //
187  // map gives us NumMyElements and MyFirstElement;
188  //
189  int NumGlobalElements = readMap->NumGlobalElements();
190  int NumMyElements = map.NumMyElements();
191  int MyFirstElement = map.MinMyGID();
192  std::vector<int> MapMap_( NumGlobalElements );
193  readMap->MyGlobalElements( &MapMap_[0] ) ;
194  Comm.Broadcast( &MapMap_[0], NumGlobalElements, 0 ) ;
195  map_ = new Epetra_Map( NumGlobalElements, NumMyElements, &MapMap_[MyFirstElement], 0, Comm);
196  } else {
197  map_ = new Epetra_Map( map ) ;
198  }
199 
200 
201  Epetra_CrsMatrix A(Copy, *map_, 0);
202 
203 
204  const Epetra_Map &OriginalMap = serialA->RowMatrixRowMap() ;
205  assert( OriginalMap.SameAs(*readMap) );
206  Epetra_Export exporter(OriginalMap, *map_);
207  Epetra_Export exporter2(OriginalMap, *map_);
208  Epetra_Export MatrixExporter(OriginalMap, *map_);
209  Epetra_CrsMatrix AwithDiag(Copy, *map_, 0);
210 
211  Epetra_Vector x(*map_);
212  Epetra_Vector b(*map_);
213  Epetra_Vector xexact(*map_);
214  Epetra_Vector resid(*map_);
215  Epetra_Vector readresid(*readMap);
216  Epetra_Vector tmp(*map_);
217  Epetra_Vector readtmp(*readMap);
218 
219  // Epetra_Vector xcomp(*map_); // X as computed by the solver
220  bool distribute_matrix = ( matrix_type == AMESOS_Distributed ) ;
221  if ( distribute_matrix ) {
222  Teuchos::RCP< Teuchos::Time > distTimer = Teuchos::TimeMonitor::getNewCounter ("TestSolver::Matrix Distribute");
223  Teuchos::TimeMonitor LocalTimer (*distTimer);
224  // Create Exporter to distribute read-in matrix and vectors
225  //
226  // Initialize x, b and xexact to the values read in from the file
227  //
228  x.Export(*readx, exporter, Add);
229  b.Export(*readb, exporter, Add);
230  xexact.Export(*readxexact, exporter, Add);
231  Comm.Barrier();
232 
233  A.Export(*serialA, exporter, Add);
234  //assert(A.FillComplete()==0);
235  if(A.FillComplete()!=0) {
236  exit(0);
237  }
238  delete serialA;
239 
240  Comm.Barrier();
241 
242  passA = &A;
243 
244  passx = &x;
245  passb = &b;
246  passxexact = &xexact;
247  passresid = &resid;
248  passtmp = &tmp;
249  } else {
250  passA = serialA;
251  passx = readx;
252  passb = readb;
253  passxexact = readxexact;
254  passresid = &readresid;
255  passtmp = &readtmp;
256  }
257 
258  Epetra_MultiVector CopyB( *passb ) ;
259 
260 
261  double Anorm = passA->NormInf() ;
263 
264  Epetra_LinearProblem Problem( (Epetra_RowMatrix *) passA,
265  (Epetra_MultiVector *) passx,
266  (Epetra_MultiVector *) passb );
267 
268 
269  for ( int i = 0; i < 1+special ; i++ ) {
270  Epetra_Time TotalTime( Comm ) ;
271 
272  if ( false ) {
273  // TEST_UMFPACK is never set by configure
274 #ifdef HAVE_AMESOS_SUPERLUDIST
275  } else if ( SparseSolver == SUPERLUDIST ) {
276  Teuchos::ParameterList ParamList ;
277  ParamList.set( "MaxProcs", -3 );
278  Amesos_Superludist A_Superludist( Problem );
279 
280  //ParamList.set( "Redistribute", true );
281  //ParamList.set( "AddZeroToDiag", true );
282  Teuchos::ParameterList& SuperludistParams = ParamList.sublist("Superludist") ;
283  ParamList.set( "MaxProcs", -3 );
284 
285  EPETRA_CHK_ERR( A_Superludist.SetParameters( ParamList ) );
286  EPETRA_CHK_ERR( A_Superludist.SetUseTranspose( transpose ) );
287  EPETRA_CHK_ERR( A_Superludist.SymbolicFactorization( ) );
288  EPETRA_CHK_ERR( A_Superludist.NumericFactorization( ) );
289  EPETRA_CHK_ERR( A_Superludist.Solve( ) );
290 #endif
291 #ifdef HAVE_AMESOS_DSCPACK
292  } else if ( SparseSolver == DSCPACK ) {
293 
294  Teuchos::ParameterList ParamList ;
295  ParamList.set( "MaxProcs", -3 );
296 
297  Amesos_Dscpack A_dscpack( Problem ) ;
298  EPETRA_CHK_ERR( A_dscpack.SetParameters( ParamList ) );
299  EPETRA_CHK_ERR( A_dscpack.SymbolicFactorization( ) );
300  EPETRA_CHK_ERR( A_dscpack.NumericFactorization( ) );
301  EPETRA_CHK_ERR( A_dscpack.Solve( ) );
302 #endif
303 #ifdef HAVE_AMESOS_SCALAPACK
304  } else if ( SparseSolver == SCALAPACK ) {
305 
306  Teuchos::ParameterList ParamList ;
307  Amesos_Scalapack A_scalapack( Problem ) ;
308  ParamList.set( "MaxProcs", -3 );
309  EPETRA_CHK_ERR( A_scalapack.SetParameters( ParamList ) );
310  EPETRA_CHK_ERR( A_scalapack.SetUseTranspose( transpose ) );
311  EPETRA_CHK_ERR( A_scalapack.SymbolicFactorization( ) );
312  EPETRA_CHK_ERR( A_scalapack.NumericFactorization( ) );
313  EPETRA_CHK_ERR( A_scalapack.Solve( ) );
314 
315 #endif
316 #ifdef HAVE_AMESOS_TAUCS
317  } else if ( SparseSolver == TAUCS ) {
318 
319  Teuchos::ParameterList ParamList ;
320  Amesos_Taucs A_taucs( Problem ) ;
321  ParamList.set( "MaxProcs", -3 );
322  EPETRA_CHK_ERR( A_taucs.SetParameters( ParamList ) );
323  EPETRA_CHK_ERR( A_taucs.SetUseTranspose( transpose ) );
324  EPETRA_CHK_ERR( A_taucs.SymbolicFactorization( ) );
325  EPETRA_CHK_ERR( A_taucs.NumericFactorization( ) );
326  EPETRA_CHK_ERR( A_taucs.Solve( ) );
327 
328 #endif
329 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
330  } else if ( SparseSolver == PARDISO ) {
331 
332  Teuchos::ParameterList ParamList ;
333  Amesos_Pardiso A_pardiso( Problem ) ;
334  ParamList.set( "MaxProcs", -3 );
335  EPETRA_CHK_ERR( A_pardiso.SetParameters( ParamList ) );
336  EPETRA_CHK_ERR( A_pardiso.SetUseTranspose( transpose ) );
337  EPETRA_CHK_ERR( A_pardiso.SymbolicFactorization( ) );
338  EPETRA_CHK_ERR( A_pardiso.NumericFactorization( ) );
339  EPETRA_CHK_ERR( A_pardiso.Solve( ) );
340 
341 #endif
342 #ifdef HAVE_AMESOS_CSS_MKL
343  } else if ( SparseSolver == CSS ) {
344 
345  Teuchos::ParameterList ParamList;
346  Amesos_CssMKL A_css( Problem );
347  ParamList.set( "MaxProcs", -3 );
348  EPETRA_CHK_ERR( A_css.SetParameters( ParamList ) );
349  EPETRA_CHK_ERR( A_css.SetUseTranspose( transpose ) );
350  {
351  Teuchos::RCP< Teuchos::Time > symbolTimer = Teuchos::TimeMonitor::getNewCounter ("TestSolver::Symbolic(CSS)");
352  Teuchos::TimeMonitor LocalTimer (*symbolTimer);
354  }
355  {
356  Teuchos::RCP< Teuchos::Time > numericTimer = Teuchos::TimeMonitor::getNewCounter("TestSolver::Numeric (CSS)");
357  Teuchos::TimeMonitor LocalTimer (*numericTimer);
359  }
360  {
361  Teuchos::RCP< Teuchos::Time > solveTimer = Teuchos::TimeMonitor::getNewCounter ("TestSolver::Solve (CSS)");
362  Teuchos::TimeMonitor LocalTimer (*solveTimer);
363  EPETRA_CHK_ERR( A_css.Solve( ) );
364  }
365  bool printTime = true;
366  if (printTime) {
367  A_css.PrintTiming();
368  TimeMonitor::summarize();
369  }
370 #endif
371 #ifdef HAVE_AMESOS_PARAKLETE
372  } else if ( SparseSolver == PARAKLETE ) {
373 
374  Teuchos::ParameterList ParamList ;
375  Amesos_Paraklete A_paraklete( Problem ) ;
376  ParamList.set( "MaxProcs", -3 );
377  EPETRA_CHK_ERR( A_paraklete.SetParameters( ParamList ) );
378  EPETRA_CHK_ERR( A_paraklete.SetUseTranspose( transpose ) );
379  EPETRA_CHK_ERR( A_paraklete.SymbolicFactorization( ) );
380  EPETRA_CHK_ERR( A_paraklete.NumericFactorization( ) );
381  EPETRA_CHK_ERR( A_paraklete.Solve( ) );
382 
383 #endif
384 #if defined(HAVE_AMESOS_MUMPS) && defined(HAVE_MPI)
385  } else if ( SparseSolver == MUMPS ) {
386 
387  Teuchos::ParameterList ParamList ;
388  Amesos_Mumps A_mumps( Problem ) ;
389  ParamList.set( "MaxProcs", -3 );
390  EPETRA_CHK_ERR( A_mumps.SetParameters( ParamList ) );
391  EPETRA_CHK_ERR( A_mumps.SetUseTranspose( transpose ) );
392  EPETRA_CHK_ERR( A_mumps.SymbolicFactorization( ) );
393  EPETRA_CHK_ERR( A_mumps.NumericFactorization( ) );
394  EPETRA_CHK_ERR( A_mumps.Solve( ) );
395 
396 #endif
397 #ifdef HAVE_AMESOS_SUPERLU
398  } else if ( SparseSolver == SUPERLU ) {
399 
400  Teuchos::ParameterList ParamList ;
401  Amesos_Superlu A_superlu( Problem ) ;
402  ParamList.set( "MaxProcs", -3 );
403  EPETRA_CHK_ERR( A_superlu.SetParameters( ParamList ) );
404  EPETRA_CHK_ERR( A_superlu.SetUseTranspose( transpose ) );
405  EPETRA_CHK_ERR( A_superlu.SymbolicFactorization( ) );
406  EPETRA_CHK_ERR( A_superlu.NumericFactorization( ) );
407  EPETRA_CHK_ERR( A_superlu.Solve( ) );
408 
409 #endif
410 #ifdef HAVE_AMESOS_LAPACK
411  } else if ( SparseSolver == LAPACK ) {
412 
413  Teuchos::ParameterList ParamList ;
414  Amesos_Lapack A_lapack( Problem ) ;
415  ParamList.set( "MaxProcs", -3 );
416  EPETRA_CHK_ERR( A_lapack.SetParameters( ParamList ) );
417  EPETRA_CHK_ERR( A_lapack.SetUseTranspose( transpose ) );
418  EPETRA_CHK_ERR( A_lapack.SymbolicFactorization( ) );
419  EPETRA_CHK_ERR( A_lapack.NumericFactorization( ) );
420  EPETRA_CHK_ERR( A_lapack.Solve( ) );
421 #endif
422 #ifdef HAVE_AMESOS_UMFPACK
423  } else if ( SparseSolver == UMFPACK ) {
424 
425  Teuchos::ParameterList ParamList ;
426  Amesos_Umfpack A_umfpack( Problem ) ;
427  ParamList.set( "MaxProcs", -3 );
428  EPETRA_CHK_ERR( A_umfpack.SetParameters( ParamList ) );
429  EPETRA_CHK_ERR( A_umfpack.SetUseTranspose( transpose ) );
430  EPETRA_CHK_ERR( A_umfpack.SymbolicFactorization( ) );
431  EPETRA_CHK_ERR( A_umfpack.NumericFactorization( ) );
432  EPETRA_CHK_ERR( A_umfpack.Solve( ) );
433 #endif
434 #ifdef HAVE_AMESOS_KLU
435  } else if ( SparseSolver == KLU ) {
436 
437 
438  using namespace Teuchos;
439 
440  Amesos_Time AT;
441  int setupTimePtr = -1, symTimePtr = -1, numTimePtr = -1, refacTimePtr = -1, solveTimePtr = -1;
442  AT.CreateTimer(Comm, 2);
443  AT.ResetTimer(0);
444 
445  Teuchos::ParameterList ParamList ;
446  // ParamList.set("OutputLevel",2);
447  Amesos_Klu A_klu( Problem );
448  ParamList.set( "MaxProcs", -3 );
449  ParamList.set( "TrustMe", false );
450  // ParamList.set( "Refactorize", true );
451  EPETRA_CHK_ERR( A_klu.SetParameters( ParamList ) ) ;
452  EPETRA_CHK_ERR( A_klu.SetUseTranspose( transpose ) );
453  setupTimePtr = AT.AddTime("Setup", setupTimePtr, 0);
455  symTimePtr = AT.AddTime("Symbolic", symTimePtr, 0);
457  numTimePtr = AT.AddTime("Numeric", numTimePtr, 0);
459  refacTimePtr = AT.AddTime("Refactor", refacTimePtr, 0);
460  // for ( int i=0; i<100000 ; i++ )
461  EPETRA_CHK_ERR( A_klu.Solve( ) );
462  solveTimePtr = AT.AddTime("Solve", solveTimePtr, 0);
463 
464  double SetupTime = AT.GetTime(setupTimePtr);
465  double SymbolicTime = AT.GetTime(symTimePtr);
466  double NumericTime = AT.GetTime(numTimePtr);
467  double RefactorTime = AT.GetTime(refacTimePtr);
468  double SolveTime = AT.GetTime(solveTimePtr);
469 
470  std::cout << __FILE__ << "::" << __LINE__ << " SetupTime = " << SetupTime << std::endl ;
471  std::cout << __FILE__ << "::" << __LINE__ << " SymbolicTime = " << SymbolicTime - SetupTime << std::endl ;
472  std::cout << __FILE__ << "::" << __LINE__ << " NumericTime = " << NumericTime - SymbolicTime<< std::endl ;
473  std::cout << __FILE__ << "::" << __LINE__ << " RefactorTime = " << RefactorTime - NumericTime << std::endl ;
474  std::cout << __FILE__ << "::" << __LINE__ << " SolveTime = " << SolveTime - RefactorTime << std::endl ;
475 
476 #endif
477  } else {
478  SparseDirectTimingVars::log_file << "Solver not implemented yet" << std::endl ;
479  std::cerr << "\n\n#################### Requested solver not available on this platform ##################### ATS\n" << std::endl ;
480  std::cout << " SparseSolver = " << SparseSolver << std::endl ;
481  std::cerr << " SparseSolver = " << SparseSolver << std::endl ;
482  }
483 
485  } // end for (int i=0; i<special; i++ )
486 
487  //
488  // Compute the error = norm(xcomp - xexact )
489  //
490  double error;
491  passresid->Update(1.0, *passx, -1.0, *passxexact, 0.0);
492 
493  passresid->Norm2(&error);
495 
496  // passxexact->Norm2(&error ) ;
497  // passx->Norm2(&error ) ;
498 
499  //
500  // Compute the residual = norm(Ax - b)
501  //
502  double residual ;
503 
504  passA->Multiply( transpose, *passx, *passtmp);
505  passresid->Update(1.0, *passtmp, -1.0, *passb, 0.0);
506  // passresid->Update(1.0, *passtmp, -1.0, CopyB, 0.0);
507  passresid->Norm2(&residual);
508 
510 
511  double bnorm;
512  passb->Norm2( &bnorm ) ;
514 
515  double xnorm;
516  passx->Norm2( &xnorm ) ;
518 
519  delete readx;
520  delete readb;
521  if ( !distribute_matrix ) {
522  delete serialA;
523  }
524  delete readxexact;
525  delete readMap;
526  delete map_;
527 
528  Comm.Barrier();
529 
530  return 0;
531 }
int SetUseTranspose(bool UseTranspose)
SetUseTranpose(true) is more efficient in Amesos_Scalapack.
int NumGlobalElements() const
Amesos_Klu: A serial, unblocked code ideal for getting started and for very sparse matrices...
Definition: Amesos_Klu.h:117
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
void PrintTiming() const
Prints timing information.
int SetUseTranspose(bool UseTranspose_in)
If set true, X will be set to the solution of AT X = B (not A X = B)
int Solve()
Solves A X = B (or AT x = B)
int Solve()
Solves A X = B (or AT x = B)
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
Amesos_Paraklete: A serial, unblocked code ideal for getting started and for very sparse matrices...
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
bool SameAs(const Epetra_BlockMap &Map) const
Amesos_Superludist: An object-oriented wrapper for Superludist.
int Solve()
Solves A X = B (or AT x = B)
Amesos_Mumps: An object-oriented wrapper for the double precision version of MUMPS.
Definition: Amesos_Mumps.h:118
int Solve()
Solves A X = B (or AT x = B)
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int MyGlobalElements(int *MyGlobalElementList) const
int Solve()
Solves A X = B (or AT x = B)
Definition: Amesos_Klu.cpp:729
void Set_Total_Time(double Total_Time_in)
double ElapsedTime(void) const
static RCP< Time > getNewCounter(const std::string &name)
Amesos_Dscpack: An object-oriented wrapper for Dscpack.
void Set_Anorm(double anorm_in)
int Solve()
Solves A X = B (or AT X = B)
int SetUseTranspose(bool UseTranspose)
SetUseTranpose()
const Epetra_Map & RowMatrixRowMap() const
RCP< ParameterList > sublist(const RCP< ParameterList > &paramList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
int CrsMatrixTranspose(Epetra_CrsMatrix *In, Epetra_CrsMatrix *Out)
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
SparseSolverType
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
void CreateTimer(const Epetra_Comm &Comm, int size=1)
Initializes the Time object.
Definition: Amesos_Time.h:70
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
virtual void Barrier() const =0
Amesos_Pardiso: Interface to the PARDISO package.
Amesos_Superlu: Amesos interface to Xioye Li&#39;s SuperLU 3.0 serial code.
int Solve()
Solves A X = B (or AT X = B)
int FillComplete(bool OptimizeDataStorage=true)
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
void Set_Error(double error_in)
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int SetUseTranspose(bool UseTranspose_in)
SetUseTranpose()
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int SetUseTranspose(bool UseTranspose_in)
If set true, X will be set to the solution of AT X = B (not A X = B)
Definition: Amesos_Mumps.h:151
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int Amesos_TestSolver(Epetra_Comm &Comm, char *matrix_file, SparseSolverType SparseSolver, bool transpose, int special, AMESOS_MatrixType matrix_type)
int SetUseTranspose(bool UseTranspose_in)
If set true, X will be set to the solution of AT X = B (not A X = B)
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int SetParameters(Teuchos::ParameterList &ParameterList)
Set parameters from the input parameters list, returns 0 if successful.
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
AMESOS_MatrixType
virtual double NormInf() const =0
int SetUseTranspose(bool UseTranspose)
SetUseTranpose()
int NumericFactorization()
Performs NumericFactorization on the matrix A.
Definition: Amesos_Klu.cpp:681
int NumericFactorization()
Performs NumericFactorization on the matrix A.
#define EPETRA_CHK_ERR(xxx)
int NumericFactorization()
Performs NumericFactorization on the matrix A.
std::string error
void Set_Xnorm(double xnorm_in)
Amesos_Time: Container for timing information.
Definition: Amesos_Time.h:56
int SetUseTranspose(bool useTheTranspose)
If set true, X will be set to the solution of AT X = B (not A X = B)
int Solve()
Solves A X = B (or AT x = B)
virtual int Broadcast(double *MyVals, int Count, int Root) const =0
int SetUseTranspose(bool UseTranspose_in)
SetUseTranpose(true) is more efficient in Amesos_Klu.
Definition: Amesos_Klu.h:166
int SetUseTranspose(bool UseTranspose)
Amesos_Taucs supports only symmetric matrices, hence transpose is irrelevant, but harmless...
Definition: Amesos_Taucs.h:118
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
Amesos_Lapack: an interface to LAPACK.
Definition: Amesos_Lapack.h:71
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
Definition: Amesos_Klu.cpp:617
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int SetParameters(Teuchos::ParameterList &ParameterList)
Deprecated - Sets parameters.
int SetUseTranspose(bool UseTranspose)
Amesos_Superludist does not support transpose at this time.
int Solve()
Solves A X = B (or AT x = B)
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
void Set_Residual(double residual_in)
int NumericFactorization()
Performs NumericFactorization on the matrix A.
int Solve()
Solves A X = B (or AT x = B)
int SetParameters(Teuchos::ParameterList &ParameterList)
Set parameters from the input parameters list, returns 0 if successful.
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
int NumericFactorization()
Performs NumericFactorization on the matrix A.
Amesos_CssMKL: Interface to the CSSMKL package.
Definition: Amesos_CssMKL.h:64
static std::ofstream log_file
int NumericFactorization()
Performs NumericFactorization on the matrix A.
static SparseSolverResult SS_Result
int SymbolicFactorization()
Performs SymbolicFactorization on the matrix A.
int Solve()
Solves A X = B (or AT X = B)
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
Class Amesos_Umfpack: An object-oriented wrapper for UMFPACK.
int Solve()
Solves A X = B (or AT x = B)
int SetParameters(Teuchos::ParameterList &ParameterList)
Updates internal variables.
Definition: Amesos_Klu.cpp:449
void Set_Bnorm(double bnorm_in)
Amesos_Scalapack: A serial and parallel dense solver. For now, we implement only the unsymmetric ScaL...
Amesos_Taucs: An interface to the TAUCS package.
Definition: Amesos_Taucs.h:79
#define EPETRA_MAX(x, y)
int NumericFactorization()
Performs NumericFactorization on the matrix A.