Amesos Package Browser (Single Doxygen Collection)
Development
|
Amesos_Mumps: An object-oriented wrapper for the double precision version of MUMPS. More...
#include <Amesos_Mumps.h>
Public Member Functions | |
bool | MatrixShapeOK () const |
Returns true if the solver can handle this matrix shape. More... | |
const Epetra_Comm & | Comm () const |
Returns a pointer to the Epetra_Comm communicator associated with this matrix. More... | |
const Epetra_LinearProblem * | GetProblem () const |
Gets a pointer to the Epetra_LinearProblem. More... | |
Public Member Functions inherited from Amesos_BaseSolver | |
virtual | ~Amesos_BaseSolver () |
Destructor. More... | |
virtual void | setParameterList (Teuchos::RCP< Teuchos::ParameterList > const ¶mList) |
Redefined from Teuchos::ParameterListAcceptor (Does Not Work) More... | |
virtual Teuchos::RCP < Teuchos::ParameterList > | getNonconstParameterList () |
This is an empty stub. More... | |
virtual Teuchos::RCP < Teuchos::ParameterList > | unsetParameterList () |
This is an empty stub. More... | |
Public Member Functions inherited from Teuchos::ParameterListAcceptor | |
virtual RCP< const ParameterList > | getParameterList () const |
virtual RCP< const ParameterList > | getValidParameters () const |
Protected Member Functions | |
Epetra_RowMatrix & | Matrix () |
Returns a reference to the linear system matrix. More... | |
const Epetra_RowMatrix & | Matrix () const |
Epetra_Map & | RedistrMap () |
Returns a reference to the map for redistributed matrix. More... | |
Epetra_Import & | RedistrImporter () |
Returns a reference for the redistributed importer. More... | |
Epetra_RowMatrix & | RedistrMatrix (const bool ImportMatrix=false) |
Returns a reference to the redistributed matrix, imports it is ImportMatrix is true. More... | |
Epetra_Map & | SerialMap () |
Returns a reference to the map with all elements on process 0. More... | |
Epetra_Import & | SerialImporter () |
Returns a reference to the importer for SerialMap(). More... | |
int | ConvertToTriplet (const bool OnlyValues) |
Converts to MUMPS format (COO format). More... | |
int | CheckError () |
Checks for MUMPS error, prints them if any. See MUMPS' manual. More... | |
void | CheckParameters () |
Check input parameters. More... | |
void | SetICNTLandCNTL () |
Protected Attributes | |
bool | IsConvertToTripletOK_ |
true if matrix has already been converted to COO format More... | |
bool | IsComputeSchurComplementOK_ |
true if the Schur complement has been computed (need to free memory) More... | |
bool | NoDestroy_ |
std::vector< int > | Row |
row indices of nonzero elements More... | |
std::vector< int > | Col |
column indices of nonzero elements More... | |
std::vector< double > | Val |
values of nonzero elements More... | |
int | MaxProcs_ |
Maximum number of processors in the MUMPS' communicator. More... | |
bool | UseTranspose_ |
If true , solve the problem with AT. More... | |
int | MtxConvTime_ |
Quick access pointers to the internal timers. More... | |
int | MtxRedistTime_ |
int | VecRedistTime_ |
int | SymFactTime_ |
int | NumFactTime_ |
int | SolveTime_ |
double * | RowSca_ |
Row and column scaling. More... | |
double * | ColSca_ |
int * | PermIn_ |
PermIn for MUMPS. More... | |
int | NumSchurComplementRows_ |
Number of rows in the Schur complement (if required) More... | |
int * | SchurComplementRows_ |
Rows for the Schur complement (if required) More... | |
RCP< Epetra_CrsMatrix > | CrsSchurComplement_ |
Pointer to the Schur complement, as CrsMatrix. More... | |
RCP< Epetra_SerialDenseMatrix > | DenseSchurComplement_ |
Pointer to the Schur complement,as DenseMatrix. More... | |
const Epetra_LinearProblem * | Problem_ |
Pointer to the linear problem to be solved. More... | |
RCP< Epetra_Map > | RedistrMap_ |
Redistributed matrix. More... | |
RCP< Epetra_Import > | RedistrImporter_ |
Redistributed importer (from Matrix().RowMatrixRowMap() to RedistrMatrix().RowMatrixRowMap()). More... | |
RCP< Epetra_CrsMatrix > | RedistrMatrix_ |
Redistributed matrix (only if MaxProcs_ > 1). More... | |
RCP< Epetra_Map > | SerialMap_ |
Map with all elements on process 0 (for solution and rhs). More... | |
RCP< Epetra_Import > | SerialImporter_ |
Importer from Matrix.OperatorDomainMap() to SerialMap_. More... | |
DMUMPS_STRUC_C | MDS |
std::map< int, int > | ICNTL |
std::map< int, double > | CNTL |
Amesos_Mumps (const Epetra_LinearProblem &LinearProblem) | |
Amesos_Mumps Constructor. More... | |
~Amesos_Mumps (void) | |
Amesos_Mumps Destructor. More... | |
int | SymbolicFactorization () |
Performs SymbolicFactorization on the matrix A. More... | |
int | NumericFactorization () |
Performs NumericFactorization on the matrix A. More... | |
int | Solve () |
Solves A X = B (or AT x = B) More... | |
void | Destroy () |
Destroys all data associated with this object. More... | |
int | SetUseTranspose (bool UseTranspose_in) |
If set true, X will be set to the solution of AT X = B (not A X = B) More... | |
bool | UseTranspose () const |
Returns the current UseTranspose setting. More... | |
int | SetParameters (Teuchos::ParameterList &ParameterList) |
Updates internal variables. More... | |
int | NumSymbolicFact () const |
Returns the number of symbolic factorizations performed by this object. More... | |
int | NumNumericFact () const |
Returns the number of numeric factorizations performed by this object. More... | |
int | NumSolve () const |
Returns the number of solves performed by this object. More... | |
void | PrintTiming () const |
Prints timing information. More... | |
void | PrintStatus () const |
Prints information about the factorization and solution phases. More... | |
void | GetTiming (Teuchos::ParameterList &TimingParameterList) const |
Extracts timing information from the current solver and places it in the parameter list. More... | |
int | SetPrecscaling (double *ColSca, double *RowSca) |
Set prescaling. More... | |
int | SetRowScaling (double *RowSca) |
Set row scaling. More... | |
int | SetColScaling (double *ColSca) |
Set column scaling. More... | |
int | SetOrdering (int *PermIn) |
Sets ordering. More... | |
double * | GetRINFO () |
Gets the pointer to the RINFO array (defined on all processes). More... | |
int * | GetINFO () |
Gets the pointer to the INFO array (defined on all processes). More... | |
double * | GetRINFOG () |
Gets the pointer to the RINFOG array (defined on host only). More... | |
int * | GetINFOG () |
Get the pointer to the INFOG array (defined on host only). More... | |
void | SetICNTL (int pos, int value) |
Set ICNTL[pos] to value. pos is expressed in FORTRAN style (starting from 1). More... | |
void | SetCNTL (int pos, double value) |
Set CNTL[pos] to value. pos is expressed in FORTRAN style (starting from 1). More... | |
Additional Inherited Members | |
Private Member Functions inherited from Amesos_Time | |
Amesos_Time () | |
Default constructor to create size timers. More... | |
virtual | ~Amesos_Time () |
Default destructor. More... | |
void | CreateTimer (const Epetra_Comm &Comm, int size=1) |
Initializes the Time object. More... | |
void | ResetTimer (const int timerID=0) |
Resets the internally stored time object. More... | |
int | AddTime (const std::string what, int dataID, const int timerID=0) |
Adds to field what the time elapsed since last call to ResetTimer(). More... | |
double | GetTime (const std::string what) const |
Gets the cumulative time using the string. More... | |
double | GetTime (const int dataID) const |
Gets the cumulative time using the dataID. More... | |
void | GetTiming (Teuchos::ParameterList &list) const |
Load up the current timing information into the parameter list. More... | |
Private Member Functions inherited from Amesos_NoCopiable | |
Amesos_NoCopiable () | |
Default constructor. More... | |
~Amesos_NoCopiable () | |
Default destructor. More... | |
Private Member Functions inherited from Amesos_Utils | |
Amesos_Utils () | |
Default constructor. More... | |
~Amesos_Utils () | |
Default destructor. More... | |
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. More... | |
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. More... | |
void | PrintLine () const |
Prints line on std::cout. More... | |
void | SetMaxProcesses (int &MaxProcesses, const Epetra_RowMatrix &A) |
Private Member Functions inherited from Amesos_Control | |
Amesos_Control () | |
Default constructor. More... | |
~Amesos_Control () | |
Default destructor. More... | |
void | SetControlParameters (const Teuchos::ParameterList &ParameterList) |
Private Member Functions inherited from Amesos_Status | |
Amesos_Status () | |
Default constructor. More... | |
~Amesos_Status () | |
Default destructor. More... | |
void | SetStatusParameters (const Teuchos::ParameterList &ParameterList) |
Private Attributes inherited from Amesos_Control | |
double | AddToDiag_ |
Add this value to the diagonal. More... | |
bool | refactorize_ |
double | rcond_threshold_ |
If error is greater than this value, perform symbolic and numeric factorization with full partial pivoting. More... | |
int | ScaleMethod_ |
bool | AddZeroToDiag_ |
Adds zero to diagonal of redistributed matrix (some solvers choke on a matrix with a partly empty diag) More... | |
int | MatrixProperty_ |
Set the matrix property. More... | |
int | MaxProcesses_ |
bool | Reindex_ |
If true, the Amesos class should reindex the matrix to standard indexing (i.e. More... | |
Private Attributes inherited from Amesos_Status | |
bool | IsSymbolicFactorizationOK_ |
If true , SymbolicFactorization() has been successfully called. More... | |
bool | IsNumericFactorizationOK_ |
If true , NumericFactorization() has been successfully called. More... | |
bool | PrintTiming_ |
If true , prints timing information in the destructor. More... | |
bool | PrintStatus_ |
If true , print additional information in the destructor. More... | |
bool | ComputeVectorNorms_ |
If true , prints the norms of X and B in Solve(). More... | |
bool | ComputeTrueResidual_ |
If true , computes the true residual in Solve(). More... | |
int | verbose_ |
Toggles the output level. More... | |
int | debug_ |
Sets the level of debug_ output. More... | |
int | NumSymbolicFact_ |
Number of symbolic factorization phases. More... | |
int | NumNumericFact_ |
Number of numeric factorization phases. More... | |
int | NumSolve_ |
Number of solves. More... | |
double | Threshold_ |
int | MyPID_ |
int | NumProcs_ |
Amesos_Mumps: An object-oriented wrapper for the double precision version of MUMPS.
Amesos_Mumps is an interface to the the double precision version of the sparse parallel direct solver MUMPS. Given an Epetra_RowMatrix A, and two Epetra_MultiVectors X and B, the solution with Amesos_Mumps reads as follows:
A number of parameters is available to tune the performances of MUMPS. We refer to the Amesos Reference Guide for a detailed overview of these parameters. Here, we just recall that it is possible to solve the linear system on a subset of the processes contained in the Comm object of the Epetra_LinearProblem.
Amesos_Mumps accepts any Epetra_RowMatrix derived class. However, special functions are available for Epetra_CrsMatrix and Epetra_VbrMatrix objects.
As Amesos is based on Epetra, and Epetra is only double-precision, we still require an Epetra_LinearProblem composed by a double-precision matrix, and two double-precision vectors. The solution vector is casted to double
after solution. Single precision may be of interest if Amesos is used with ML, to solve the coarse problem (for which single-precision can be enough in term of numerical error, and usually save memory and CPU time).
Amesos_Mumps is based on Amesos_EpetraBaseSolver, that is derived from Amesos_BaseSolver. The main redistribution utilities, as well as a getrow function, is obtained by EpetraBaseSolver.
Definition at line 112 of file Amesos_Mumps.h.
Amesos_Mumps::Amesos_Mumps | ( | const Epetra_LinearProblem & | LinearProblem | ) |
Amesos_Mumps Constructor.
Creates an Amesos_Mumps instance, using an Epetra_LinearProblem,
Definition at line 51 of file Amesos_Mumps.cpp.
Amesos_Mumps::~Amesos_Mumps | ( | void | ) |
Amesos_Mumps Destructor.
Deletes an Amesos_Mumps object.
Definition at line 165 of file Amesos_Mumps.cpp.
|
virtual |
Performs SymbolicFactorization on the matrix A.
In addition to performing symbolic factorization on the matrix A, the call to SymbolicFactorization() implies that no change will be made to the non-zero structure of the underlying matrix without a subsequent call to SymbolicFactorization().
<br >Preconditions:
<br >Postconditions:
Implements Amesos_BaseSolver.
Definition at line 415 of file Amesos_Mumps.cpp.
|
virtual |
Performs NumericFactorization on the matrix A.
In addition to performing numeric factorization on the matrix A, the call to NumericFactorization() implies that no change will be made to the underlying matrix without a subsequent call to NumericFactorization().
<br >Preconditions:
<br >Postconditions:
Implements Amesos_BaseSolver.
Definition at line 574 of file Amesos_Mumps.cpp.
|
virtual |
<br >Preconditions:
<br >Postconditions:
Implements Amesos_BaseSolver.
Definition at line 620 of file Amesos_Mumps.cpp.
void Amesos_Mumps::Destroy | ( | ) |
Destroys all data associated with this object.
Definition at line 134 of file Amesos_Mumps.cpp.
|
inlinevirtual |
If set true, X will be set to the solution of AT X = B (not A X = B)
If the implementation of this interface does not support transpose use, this method should return a value of -1.
<br >Preconditions:
<br >Postconditions:
Implements Amesos_BaseSolver.
Definition at line 145 of file Amesos_Mumps.h.
|
inlinevirtual |
Returns the current UseTranspose setting.
Implements Amesos_BaseSolver.
Definition at line 153 of file Amesos_Mumps.h.
|
virtual |
Updates internal variables.
<br \>Preconditions:<ul> <li>None.</li> </ul> <br \>Postconditions:<ul> <li>Internal variables controlling the factorization and solve will be updated and take effect on all subseuent calls to NumericFactorization() and Solve().</li> <li>All parameters whose value are to differ from the default values must
be included in ParameterList. Parameters not specified in ParameterList revert to their default values.
Implements Amesos_BaseSolver.
Definition at line 299 of file Amesos_Mumps.cpp.
|
inlinevirtual |
Returns the number of symbolic factorizations performed by this object.
Implements Amesos_BaseSolver.
Definition at line 162 of file Amesos_Mumps.h.
|
inlinevirtual |
Returns the number of numeric factorizations performed by this object.
Implements Amesos_BaseSolver.
Definition at line 165 of file Amesos_Mumps.h.
|
inlinevirtual |
Returns the number of solves performed by this object.
Implements Amesos_BaseSolver.
Definition at line 168 of file Amesos_Mumps.h.
|
virtual |
Prints timing information.
In the destruction phase, prints out detailed information about the various phases: symbolic and numeric factorization, solution, gather/scatter for vectors and matrices.
Implements Amesos_BaseSolver.
Definition at line 843 of file Amesos_Mumps.cpp.
|
virtual |
Prints information about the factorization and solution phases.
In the destruction phase, prints out some information furnished by MUMPS, like the amount of required memory, the MFLOPS.
Implements Amesos_BaseSolver.
Definition at line 767 of file Amesos_Mumps.cpp.
|
inlinevirtual |
Extracts timing information from the current solver and places it in the parameter list.
Reimplemented from Amesos_BaseSolver.
Definition at line 188 of file Amesos_Mumps.h.
|
inline |
Set prescaling.
Use double precision vectors of size N (global dimension of the matrix) as scaling for columns and rows. ColSca
and RowSca
must be defined on the host only, and allocated by the user, if the user sets ICNTL(8) = -1.
Both input vectors are float
with –enable-amesos-smumps, double
otherwise.
Definition at line 233 of file Amesos_Mumps.h.
|
inline |
Set row scaling.
Use double precision vectors of size N (global dimension of the matrix) for row scaling.
RowSca | (In) -float pointer with –enable-amesos-smumps, double pointer otherwise. |
Definition at line 246 of file Amesos_Mumps.h.
|
inline |
Set column scaling.
Use double precision vectors of size N (global dimension of the matrix) for column scaling.
ColSca | (In) - float pointer with –enable-amesos-smumps, double pointer otherwise. |
Definition at line 258 of file Amesos_Mumps.h.
|
inline |
Sets ordering.
Use integer vectors of size N (global dimension of the matrix) as given ordering. PermIn
must be defined on the host only, and allocated by the user, if the user sets ICNTL(7) = 1.
Definition at line 269 of file Amesos_Mumps.h.
double * Amesos_Mumps::GetRINFO | ( | ) |
Gets the pointer to the RINFO array (defined on all processes).
Gets the pointer to the internally stored RINFO array, of type float
if option –enable-amesos-smumps
is enabled, double
otherwise.
Definition at line 975 of file Amesos_Mumps.cpp.
int * Amesos_Mumps::GetINFO | ( | ) |
Gets the pointer to the INFO array (defined on all processes).
Gets the pointer to the internally stored INFO array, of type int
.
Definition at line 981 of file Amesos_Mumps.cpp.
double * Amesos_Mumps::GetRINFOG | ( | ) |
Gets the pointer to the RINFOG array (defined on host only).
Gets the pointer to the internally stored RINFOG array (defined on the host process only), of type float
if option –enable-amesos-smumps
is enabled, double
otherwise.
Definition at line 987 of file Amesos_Mumps.cpp.
int * Amesos_Mumps::GetINFOG | ( | ) |
Get the pointer to the INFOG array (defined on host only).
Gets the pointer to the internally stored INFOG (defined on the host process only) array, of type int
.
Definition at line 993 of file Amesos_Mumps.cpp.
void Amesos_Mumps::SetICNTL | ( | int | pos, |
int | value | ||
) |
Set ICNTL[pos] to value. pos is expressed in FORTRAN style (starting from 1).
Definition at line 241 of file Amesos_Mumps.cpp.
void Amesos_Mumps::SetCNTL | ( | int | pos, |
double | value | ||
) |
Set CNTL[pos] to value. pos is expressed in FORTRAN style (starting from 1).
Definition at line 248 of file Amesos_Mumps.cpp.
|
inlinevirtual |
Returns true if the solver can handle this matrix shape.
Returns true if the matrix shape is one that the underlying sparse direct solver can handle. Classes that work only on square matrices should return false for rectangular matrices. Classes that work only on symmetric matrices whould return false for non-symmetric matrices.
Implements Amesos_BaseSolver.
Definition at line 308 of file Amesos_Mumps.h.
|
inlinevirtual |
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
Implements Amesos_BaseSolver.
Definition at line 319 of file Amesos_Mumps.h.
|
inlinevirtual |
Gets a pointer to the Epetra_LinearProblem.
Implements Amesos_BaseSolver.
Definition at line 322 of file Amesos_Mumps.h.
|
protected |
Returns a reference to the linear system matrix.
Definition at line 885 of file Amesos_Mumps.cpp.
|
protected |
Definition at line 893 of file Amesos_Mumps.cpp.
|
protected |
Returns a reference to the map for redistributed matrix.
Definition at line 901 of file Amesos_Mumps.cpp.
|
protected |
Returns a reference for the redistributed importer.
Definition at line 919 of file Amesos_Mumps.cpp.
|
protected |
Returns a reference to the redistributed matrix, imports it is ImportMatrix
is true.
Definition at line 931 of file Amesos_Mumps.cpp.
|
protected |
Returns a reference to the map with all elements on process 0.
Definition at line 952 of file Amesos_Mumps.cpp.
|
protected |
Returns a reference to the importer for SerialMap().
Definition at line 965 of file Amesos_Mumps.cpp.
|
protected |
Converts to MUMPS format (COO format).
Definition at line 171 of file Amesos_Mumps.cpp.
|
protected |
Checks for MUMPS error, prints them if any. See MUMPS' manual.
Definition at line 814 of file Amesos_Mumps.cpp.
|
protected |
Check input parameters.
Definition at line 372 of file Amesos_Mumps.cpp.
|
protected |
Definition at line 254 of file Amesos_Mumps.cpp.
|
protected |
true
if matrix has already been converted to COO format
Definition at line 358 of file Amesos_Mumps.h.
|
protected |
true
if the Schur complement has been computed (need to free memory)
Definition at line 360 of file Amesos_Mumps.h.
|
protected |
Definition at line 363 of file Amesos_Mumps.h.
|
protected |
row indices of nonzero elements
Definition at line 366 of file Amesos_Mumps.h.
|
protected |
column indices of nonzero elements
Definition at line 368 of file Amesos_Mumps.h.
|
protected |
values of nonzero elements
Definition at line 370 of file Amesos_Mumps.h.
|
protected |
Maximum number of processors in the MUMPS' communicator.
Definition at line 373 of file Amesos_Mumps.h.
|
protected |
If true
, solve the problem with AT.
Definition at line 376 of file Amesos_Mumps.h.
|
protected |
Quick access pointers to the internal timers.
Definition at line 379 of file Amesos_Mumps.h.
|
protected |
Definition at line 379 of file Amesos_Mumps.h.
|
protected |
Definition at line 379 of file Amesos_Mumps.h.
|
protected |
Definition at line 380 of file Amesos_Mumps.h.
|
protected |
Definition at line 380 of file Amesos_Mumps.h.
|
protected |
Definition at line 380 of file Amesos_Mumps.h.
|
protected |
Row and column scaling.
Definition at line 383 of file Amesos_Mumps.h.
|
protected |
Definition at line 383 of file Amesos_Mumps.h.
|
protected |
PermIn for MUMPS.
Definition at line 386 of file Amesos_Mumps.h.
|
protected |
Number of rows in the Schur complement (if required)
Definition at line 389 of file Amesos_Mumps.h.
|
protected |
Rows for the Schur complement (if required)
Definition at line 391 of file Amesos_Mumps.h.
|
protected |
Pointer to the Schur complement, as CrsMatrix.
Definition at line 394 of file Amesos_Mumps.h.
|
protected |
Pointer to the Schur complement,as DenseMatrix.
Definition at line 396 of file Amesos_Mumps.h.
|
protected |
Pointer to the linear problem to be solved.
Definition at line 404 of file Amesos_Mumps.h.
|
protected |
Redistributed matrix.
Definition at line 407 of file Amesos_Mumps.h.
|
protected |
Redistributed importer (from Matrix().RowMatrixRowMap() to RedistrMatrix().RowMatrixRowMap()).
Definition at line 409 of file Amesos_Mumps.h.
|
protected |
Redistributed matrix (only if MaxProcs_ > 1).
Definition at line 411 of file Amesos_Mumps.h.
|
protected |
Map with all elements on process 0 (for solution and rhs).
Definition at line 413 of file Amesos_Mumps.h.
|
protected |
Importer from Matrix.OperatorDomainMap() to SerialMap_.
Definition at line 415 of file Amesos_Mumps.h.
|
protected |
Definition at line 417 of file Amesos_Mumps.h.
|
protected |
Definition at line 419 of file Amesos_Mumps.h.
|
protected |
Definition at line 420 of file Amesos_Mumps.h.