ParGeMSLR
Public Member Functions | Public Attributes | List of all members
pargemslr::GemslrClass< MatrixType, VectorType, DataType > Class Template Reference

The local real ilu preconditioner, only work for sequential CSR matrix. More...

#include <gemslr.hpp>

Public Member Functions

 GemslrClass ()
 The constructor of precondioner class. More...
 
virtual int Clear ()
 Free the current precondioner. More...
 
virtual ~GemslrClass ()
 The destructor of precondioner class. More...
 
 GemslrClass (const GemslrClass< MatrixType, VectorType, DataType > &precond)
 The copy constructor of GemslrClass. More...
 
 GemslrClass (GemslrClass< MatrixType, VectorType, DataType > &&precond)
 The move constructor of GemslrClass. More...
 
GemslrClass< MatrixType, VectorType, DataType > & operator= (const GemslrClass< MatrixType, VectorType, DataType > &precond)
 The operator = of GemslrClass. More...
 
GemslrClass< MatrixType, VectorType, DataType > & operator= (GemslrClass< MatrixType, VectorType, DataType > &&precond)
 The operator = of GemslrClass. More...
 
virtual int Setup (VectorType &x, VectorType &rhs)
 Setup the precondioner phase. Will be called by the solver if not called directly. More...
 
virtual int Solve (VectorType &x, VectorType &rhs)
 Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is used. More...
 
int SolveLevel (VectorType &x, VectorType &rhs, int level)
 Solve starting from a certain level. More...
 
int SolveB (VectorType &x, VectorType &rhs, int level)
 Solve with B on a certain level. More...
 
int SolveApplyLowRankLevel (VectorType &x, VectorType &rhs, int level)
 Apply the low-rank update on a certain level. More...
 
int GetNumRows (int level)
 Get the local number of rows on certain level for the low-rank part. More...
 
int EBFCMatVec (int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
 The matvec function y = G*x = Ei*(UBi(LBi(Fi*(Ci\x)). Note that alpha and beta are untouched. More...
 
int SchurMatVec (int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
 The matvec function y = alpha*S*x+beta*y where S = Ci - Ei*(UBi(LBi(Fi*x). More...
 
int CMatVec (int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
 The matvec function y = alpha*Ci*x+beta*y. More...
 
int GetSize ()
 Get the size of the problem. More...
 
virtual long int GetNumNonzeros ()
 Get the total number of nonzeros the ILU. More...
 
long int GetNumNonzeros (long int &nnz_bsolver, long int &nnz_lr)
 Get the total number of nonzeros the ILU. More...
 
virtual int SetLocalGemslr (GemslrClass< MatrixType, VectorType, DataType > &gemslr)
 Setup with parameter array. This is the helper function to set the local gemslr for B solve. More...
 
virtual int SetWithParameterArray (double *params)
 Setup with parameter array. More...
 
int SetPartitionOption (int option)
 Set the global partition option. 0: ND; 1: RKway. More...
 
int SetBPartitionOption (int option)
 Set the B part partition option. 0: ND; 1: RKway. More...
 
int SetPermutationOption (int option)
 Set the global permutation option. 0: No; 1: RCM; 2: AMD. More...
 
int SetBPermutationOption (int option)
 Set the B part permutation option. 0: No; 1: RCM; 2: AMD. More...
 
int SetNumLevels (int option)
 Set the global target number of levels of GeMSLR. More...
 
int SetBNumLevels (int option)
 Set the B part target number of levels of GeMSLR. More...
 
int SetNumSubdomains (int option)
 Set the global target number of subdomains on each level of GeMSLR. More...
 
int SetBNumSubdomains (int option)
 Set the B part target number of subdomains on each level of GeMSLR. More...
 
int SetMinimalNumberSubdomains (int option)
 Set the global minimal number of subdomains on each level of GeMSLR. More...
 
int SetBMinimalNumberSubdomains (int option)
 Set the B part minimal number of subdomains on each level of GeMSLR. More...
 
int SetNumberSubdomainsReduceFactor (int option)
 Set the global reduce factor of subdomains on each level of GeMSLR. More...
 
int SetBNumberSubdomainsReduceFactor (int option)
 Set the B part reduce factor of subdomains on each level of GeMSLR. More...
 
int SetSeperatorOption (bool option)
 Set the global separator option of GeMSLR. More...
 
int SetBSeperatorOption (bool option)
 Set the B part separator option of GeMSLR. More...
 
int SetInnerIterationOption (bool option)
 Set the inner iteration option of GeMSLR. More...
 
template<typename T >
int SetInnerIterationThreshold (T option)
 Set the stop threshold of inner iteration of GeMSLR. More...
 
int SetInnerIterationMaxNumberIterations (int option)
 Set the max number of iterations of inner iteration of GeMSLR. More...
 
int SetSolveOption (int option)
 Set the solve option. 0: additive LU solve; 1: additive L solve; 2: multi-solve. More...
 
int SetLowRankOptionTopLevel (int option)
 Set the low-rank option on the top level. 0: Standard. 1: Thick-restart. More...
 
int SetLowRankOptionOtherLevels (int option)
 Set the low-rank option on other levels. 0: Standard. 1: Thick-restart. More...
 
int SetBLowRankOptionTopLevel (int option)
 Set the B part low-rank option on the top level. 0: Standard. 1: Thick-restart. More...
 
int SetBLowRankOptionOtherLevels (int option)
 Set the B part low-rank option on other levels. 0: Standard. 1: Thick-restart. More...
 
int SetLowRankRandomInitGuess (bool option)
 Set if we use random initial guess for Arnoldi. Otherwise we use 1 as initial guess. More...
 
int SetBLowRankRandomInitGuess (bool option)
 Set if we use random initial guess for Arnoldi in the B part. Otherwise we use 1 as initial guess. More...
 
template<typename T >
int SetLowRankFactorTopLevel (T option)
 Set the low-rank factor on the top level. The actuall computed number of low-rank terms is rank * factor >= rank. More...
 
template<typename T >
int SetLowRankFactorOtherLevels (T option)
 Set the low-rank factor on the other levels. The actuall computed number of low-rank terms is rank * factor >= rank. More...
 
template<typename T >
int SetBLowRankFactorTopLevel (T option)
 Set the B part low-rank factor on the top level. The actuall computed number of low-rank terms is rank * factor >= rank. More...
 
template<typename T >
int SetBLowRankFactorOtherLevels (T option)
 Set the B part low-rank factor on the other levels. The actuall computed number of low-rank terms is rank * factor >= rank. More...
 
template<typename T >
int SetLowRankRanksTopLevel (T option)
 Set the target number of low-rank terms on the top level. More...
 
template<typename T >
int SetLowRankRanksOtherLevels (T option)
 Set the target number of low-rank terms on the other levels. More...
 
template<typename T >
int SetBLowRankRanksTopLevel (T option)
 Set the B part target number of low-rank terms on the top level. More...
 
template<typename T >
int SetBLowRankRanksOtherLevels (T option)
 Set the B part target number of low-rank terms on the other levels. More...
 
template<typename T >
int SetLowRankArnoldiFactorTopLevel (T option)
 Set the Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_factor. More...
 
template<typename T >
int SetLowRankArnoldiFactorOtherLevels (T option)
 Set the Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_factor. More...
 
template<typename T >
int SetBLowRankArnoldiFactorTopLevel (T option)
 Set the B part Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_factor. More...
 
template<typename T >
int SetBLowRankArnoldiFactorOtherLevels (T option)
 Set the B part Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_factor. More...
 
int SetLowRankMaxNumberIterationsTopLevel (int option)
 Set max restarts of thick-restart Arnoldi on the top level. More...
 
int SetLowRankMaxNumberIterationsOtherLevels (int option)
 Set max restarts of thick-restart Arnoldi on other levels. More...
 
int SetBLowRankMaxNumberIterationsTopLevel (int option)
 Set B part max restarts of thick-restart Arnoldi on the top level. More...
 
int SetBLowRankMaxNumberIterationsOtherLevels (int option)
 Set B part max restarts of thick-restart Arnoldi on other levels. More...
 
template<typename T >
int SetLowRankThresholdTopLevel (T option)
 Set max restarts of thick-restart Arnoldi on the top level. More...
 
template<typename T >
int SetLowRankThresholdOtherLevels (T option)
 Set max restarts of thick-restart Arnoldi on other levels. More...
 
template<typename T >
int SetBLowRankThresholdTopLevel (T option)
 Set B part max restarts of thick-restart Arnoldi on the top level. More...
 
template<typename T >
int SetBLowRankThresholdOtherLevels (T option)
 Set B part max restarts of thick-restart Arnoldi on other levels. More...
 
template<typename T >
int SetIluDropTolB (T option)
 Set the threshold for ILUT of the B part. More...
 
template<typename T >
int SetIluDropTolC (T option)
 Set the threshold for ILUT of the last level. More...
 
template<typename T >
int SetIluDropTolS (T option)
 Set the threshold for ILUT of the S part. More...
 
template<typename T >
int SetIluDropTolEF (T option)
 Set the threshold for ILUT of the EF part. More...
 
template<typename T >
int SetBIluDropTolB (T option)
 Set the recursive GeMSLR B part threshold for ILUT of the global B part. More...
 
template<typename T >
int SetBIluDropTolC (T option)
 Set the recursive GeMSLR last level threshold for ILUT of the global B part. More...
 
int SetIluMaxRowNnzB (int option)
 Set the maxinum number of nonzeros for ILUT of the B part. More...
 
int SetIluMaxRowNnzC (int option)
 Set the maxinum number of nonzeros ILUT of the last level. More...
 
int SetIluMaxRowNnzS (int option)
 Set the maxinum number of nonzeros ILUT of the S part. More...
 
int SetIluFillLevelB (int option)
 Set the fill level for ILUK of the B part. More...
 
int SetIluFillLevelC (int option)
 Set the fill level for ILUK of the last level. More...
 
int SetBIluFillLevelB (int option)
 Set the fill level for ILUK of the B part. More...
 
int SetBIluFillLevelC (int option)
 Set the fill level for ILUK of the last level. More...
 
int SetBIluMaxRowNnzB (int option)
 Set the recursive GeMSLR B part maxinum number of nonzeros ILUT. More...
 
int SetBIluMaxRowNnzC (int option)
 Set the recursive GeMSLR last level maxinum number of nonzeros ILUT. More...
 
int SetPolyOrder (int option)
 Set poly order for Poly solve of the B part. More...
 
int SetBPolyOrder (int option)
 Set poly order for Poly solve of the B part of the recursive GeMSLR. More...
 
int SetPreconditionerOption1 (int option)
 Set top level preconditioner. More...
 
int SetPreconditionerOption1Levels (int option)
 Set top level preconditioner apply levels. More...
 
int SetPreconditionerOption2 (int option)
 Set mid level preconditioner. More...
 
int SetPreconditionerOptionB (int option)
 Set all top levels preconditioner. More...
 
int SetSmoothOptionB (int option)
 Set all top levels smoother. More...
 
int SetPreconditionerOptionC (int option)
 Set last level preconditioner. More...
 
int SetIluResidualIters (int residual_iters)
 Set the number of residual iterations of B solves in the setup phase. Set to <= 1 to turn off. More...
 
int SetIluComplexShift (bool complex_shift)
 Set if we turn on the complex shift or not (complex version only). More...
 
virtual int SetSolveLocation (const int &location)
 Set the data location that the preconditioner apply to. More...
 
int SetCUDAOption (bool cuda_lowrank_only)
 Set to true to only move the low-rank part to device (the triangular solve on GPU might be slow for small problems). More...
 
virtual int MoveData (const int &location)
 Move the preconditioner to another location. Only can be called after Setup. More...
 
int GetSolvePhase ()
 Get the solve phase. More...
 

Public Attributes

std::vector< GemslrLevelClass< MatrixType, VectorType, DataType > > _levs_v
 Vector holding the level struct for all levels starting from the second level. The size of this vector is equal to _nlev_used, and is the number of true levels. More...
 

Detailed Description

template<class MatrixType, class VectorType, typename DataType>
class pargemslr::GemslrClass< MatrixType, VectorType, DataType >

The local real ilu preconditioner, only work for sequential CSR matrix. Matrix type is the type of the matrix, VectorType is the type of the vector. DataType is the data type.

Constructor & Destructor Documentation

◆ GemslrClass() [1/3]

template<class MatrixType , class VectorType , typename DataType >
template pargemslr::precond_gemslr_csr_seq_complexd::GemslrClass ( )

The constructor of precondioner class.

◆ ~GemslrClass()

template<class MatrixType , class VectorType , typename DataType >
template pargemslr::precond_gemslr_csr_seq_complexd::~GemslrClass ( )
virtual

The destructor of precondioner class.

◆ GemslrClass() [2/3]

template<class MatrixType , class VectorType , typename DataType >
pargemslr::GemslrClass< MatrixType, VectorType, DataType >::GemslrClass ( const GemslrClass< MatrixType, VectorType, DataType > &  precond)

The copy constructor of GemslrClass.

◆ GemslrClass() [3/3]

template<class MatrixType , class VectorType , typename DataType >
pargemslr::GemslrClass< MatrixType, VectorType, DataType >::GemslrClass ( GemslrClass< MatrixType, VectorType, DataType > &&  precond)

The move constructor of GemslrClass.

Member Function Documentation

◆ Clear()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_gemslr_csr_seq_complexd::Clear ( )
virtual

Free the current precondioner.

Returns
Return error message.

◆ CMatVec()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::CMatVec ( int  level,
char  trans,
const DataType &  alpha,
VectorType &  x,
const DataType &  beta,
VectorType &  y 
)

The matvec function y = alpha*Ci*x+beta*y.

Note
TODO: change VectorType to the base class vector.
Parameters
[in]levelThe matvec level.
[in]transWhether or not transpose matrix A.
[in]alphaThe alpha value.
[in]xThe left vector.
[in]betaThe beta value.
[in,out]yThe product vector.
Returns
Return error message.

◆ EBFCMatVec()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::EBFCMatVec ( int  level,
char  trans,
const DataType &  alpha,
VectorType &  x,
const DataType &  beta,
VectorType &  y 
)

The matvec function y = G*x = Ei*(UBi(LBi(Fi*(Ci\x)). Note that alpha and beta are untouched.

Note
TODO: change VectorType to the base class vector.
Parameters
[in]levelThe matvec level.
[in]transWhether or not transpose matrix A.
[in]alphaThe alpha value.
[in]xThe left vector.
[in]betaThe beta value.
[in,out]yThe product vector.
Returns
Return error message.

◆ GetNumNonzeros() [1/2]

template<class MatrixType , class VectorType , typename DataType >
template long int pargemslr::precond_gemslr_csr_seq_complexd::GetNumNonzeros ( )
virtual

Get the total number of nonzeros the ILU.

Returns
Return the total number of nonzeros the ILU.

◆ GetNumNonzeros() [2/2]

template<class MatrixType , class VectorType , typename DataType >
template long int pargemslr::precond_gemslr_csr_seq_complexd::GetNumNonzeros ( long int &  nnz_bsolver,
long int &  nnz_lr 
)

Get the total number of nonzeros the ILU.

Returns
Return the total number of nonzeros the ILU.

◆ GetNumRows()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_gemslr_csr_seq_complexd::GetNumRows ( int  level)

Get the local number of rows on certain level for the low-rank part.

Returns
Return the length of the matrix.

◆ GetSize()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_gemslr_csr_seq_complexd::GetSize ( )

Get the size of the problem.

Returns
Return the problem size.

◆ GetSolvePhase()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::GetSolvePhase ( )
inline

Get the solve phase.

Returns
Return the solve phase.

◆ MoveData()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_gemslr_csr_seq_complexd::MoveData ( const int &  location)
virtual

Move the preconditioner to another location. Only can be called after Setup.

Parameters
[in]locationThe target solver location.
Returns
Return error message.

◆ operator=() [1/2]

template<class MatrixType , class VectorType , typename DataType >
GemslrClass< MatrixType, VectorType, DataType > & pargemslr::GemslrClass< MatrixType, VectorType, DataType >::operator= ( const GemslrClass< MatrixType, VectorType, DataType > &  precond)

The operator = of GemslrClass.

◆ operator=() [2/2]

template<class MatrixType , class VectorType , typename DataType >
GemslrClass< MatrixType, VectorType, DataType > & pargemslr::GemslrClass< MatrixType, VectorType, DataType >::operator= ( GemslrClass< MatrixType, VectorType, DataType > &&  precond)

The operator = of GemslrClass.

◆ SchurMatVec()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SchurMatVec ( int  level,
char  trans,
const DataType &  alpha,
VectorType &  x,
const DataType &  beta,
VectorType &  y 
)

The matvec function y = alpha*S*x+beta*y where S = Ci - Ei*(UBi(LBi(Fi*x).

Note
TODO: change VectorType to the base class vector.
Parameters
[in]levelThe matvec level.
[in]transWhether or not transpose matrix A.
[in]alphaThe alpha value.
[in]xThe left vector.
[in]betaThe beta value.
[in,out]yThe product vector.
Returns
Return error message.

◆ SetBIluDropTolB()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBIluDropTolB ( option)
inline

Set the recursive GeMSLR B part threshold for ILUT of the global B part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBIluDropTolC()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBIluDropTolC ( option)
inline

Set the recursive GeMSLR last level threshold for ILUT of the global B part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBIluFillLevelB()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBIluFillLevelB ( int  option)
inline

Set the fill level for ILUK of the B part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBIluFillLevelC()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBIluFillLevelC ( int  option)
inline

Set the fill level for ILUK of the last level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBIluMaxRowNnzB()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBIluMaxRowNnzB ( int  option)
inline

Set the recursive GeMSLR B part maxinum number of nonzeros ILUT.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBIluMaxRowNnzC()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBIluMaxRowNnzC ( int  option)
inline

Set the recursive GeMSLR last level maxinum number of nonzeros ILUT.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankArnoldiFactorOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankArnoldiFactorOtherLevels ( option)
inline

Set the B part Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_factor

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankArnoldiFactorTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankArnoldiFactorTopLevel ( option)
inline

Set the B part Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_factor

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankFactorOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankFactorOtherLevels ( option)
inline

Set the B part low-rank factor on the other levels. The actuall computed number of low-rank terms is rank * factor >= rank.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankFactorTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankFactorTopLevel ( option)
inline

Set the B part low-rank factor on the top level. The actuall computed number of low-rank terms is rank * factor >= rank.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankMaxNumberIterationsOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankMaxNumberIterationsOtherLevels ( int  option)
inline

Set B part max restarts of thick-restart Arnoldi on other levels.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankMaxNumberIterationsTopLevel()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankMaxNumberIterationsTopLevel ( int  option)
inline

Set B part max restarts of thick-restart Arnoldi on the top level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankOptionOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankOptionOtherLevels ( int  option)
inline

Set the B part low-rank option on other levels. 0: Standard. 1: Thick-restart.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankOptionTopLevel()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankOptionTopLevel ( int  option)
inline

Set the B part low-rank option on the top level. 0: Standard. 1: Thick-restart.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankRandomInitGuess()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankRandomInitGuess ( bool  option)
inline

Set if we use random initial guess for Arnoldi in the B part. Otherwise we use 1 as initial guess.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankRanksOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankRanksOtherLevels ( option)
inline

Set the B part target number of low-rank terms on the other levels.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankRanksTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankRanksTopLevel ( option)
inline

Set the B part target number of low-rank terms on the top level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankThresholdOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankThresholdOtherLevels ( option)
inline

Set B part max restarts of thick-restart Arnoldi on other levels.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBLowRankThresholdTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBLowRankThresholdTopLevel ( option)
inline

Set B part max restarts of thick-restart Arnoldi on the top level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBMinimalNumberSubdomains()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBMinimalNumberSubdomains ( int  option)
inline

Set the B part minimal number of subdomains on each level of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBNumberSubdomainsReduceFactor()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBNumberSubdomainsReduceFactor ( int  option)
inline

Set the B part reduce factor of subdomains on each level of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBNumLevels()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBNumLevels ( int  option)
inline

Set the B part target number of levels of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBNumSubdomains()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBNumSubdomains ( int  option)
inline

Set the B part target number of subdomains on each level of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBPartitionOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBPartitionOption ( int  option)
inline

Set the B part partition option. 0: ND; 1: RKway.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBPermutationOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBPermutationOption ( int  option)
inline

Set the B part permutation option. 0: No; 1: RCM; 2: AMD.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBPolyOrder()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBPolyOrder ( int  option)
inline

Set poly order for Poly solve of the B part of the recursive GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetBSeperatorOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetBSeperatorOption ( bool  option)
inline

Set the B part separator option of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetCUDAOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetCUDAOption ( bool  cuda_lowrank_only)

Set to true to only move the low-rank part to device (the triangular solve on GPU might be slow for small problems).

Parameters
[in]cuda_lowrank_onlySet to true to only move the low-rank part to device (the triangular solve on GPU might be slow for small problems).
Returns
Return error message.

◆ SetIluComplexShift()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluComplexShift ( bool  complex_shift)
inline

Set if we turn on the complex shift or not (complex version only).

Parameters
[in]complex_shiftThe new drop tol for ILUT.
Returns
Return error message.

◆ SetIluDropTolB()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluDropTolB ( option)
inline

Set the threshold for ILUT of the B part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluDropTolC()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluDropTolC ( option)
inline

Set the threshold for ILUT of the last level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluDropTolEF()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluDropTolEF ( option)
inline

Set the threshold for ILUT of the EF part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluDropTolS()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluDropTolS ( option)
inline

Set the threshold for ILUT of the S part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluFillLevelB()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluFillLevelB ( int  option)
inline

Set the fill level for ILUK of the B part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluFillLevelC()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluFillLevelC ( int  option)
inline

Set the fill level for ILUK of the last level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluMaxRowNnzB()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluMaxRowNnzB ( int  option)
inline

Set the maxinum number of nonzeros for ILUT of the B part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluMaxRowNnzC()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluMaxRowNnzC ( int  option)
inline

Set the maxinum number of nonzeros ILUT of the last level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluMaxRowNnzS()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluMaxRowNnzS ( int  option)
inline

Set the maxinum number of nonzeros ILUT of the S part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetIluResidualIters()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetIluResidualIters ( int  residual_iters)
inline

Set the number of residual iterations of B solves in the setup phase. Set to <= 1 to turn off.

Parameters
[in]residual_itersThe number of residual iterations of B solves.
Returns
Return error message.

◆ SetInnerIterationMaxNumberIterations()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetInnerIterationMaxNumberIterations ( int  option)
inline

Set the max number of iterations of inner iteration of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetInnerIterationOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetInnerIterationOption ( bool  option)
inline

Set the inner iteration option of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetInnerIterationThreshold()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetInnerIterationThreshold ( option)
inline

Set the stop threshold of inner iteration of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLocalGemslr()

template<class MatrixType , class VectorType , typename DataType >
virtual int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLocalGemslr ( GemslrClass< MatrixType, VectorType, DataType > &  gemslr)
inlinevirtual

Setup with parameter array. This is the helper function to set the local gemslr for B solve.

Parameters
[in]paramsThe parameter array.
Returns
Return error message.

◆ SetLowRankArnoldiFactorOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankArnoldiFactorOtherLevels ( option)
inline

Set the Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_factor

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankArnoldiFactorTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankArnoldiFactorTopLevel ( option)
inline

Set the Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_factor

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankFactorOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankFactorOtherLevels ( option)
inline

Set the low-rank factor on the other levels. The actuall computed number of low-rank terms is rank * factor >= rank.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankFactorTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankFactorTopLevel ( option)
inline

Set the low-rank factor on the top level. The actuall computed number of low-rank terms is rank * factor >= rank.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankMaxNumberIterationsOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankMaxNumberIterationsOtherLevels ( int  option)
inline

Set max restarts of thick-restart Arnoldi on other levels.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankMaxNumberIterationsTopLevel()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankMaxNumberIterationsTopLevel ( int  option)
inline

Set max restarts of thick-restart Arnoldi on the top level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankOptionOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankOptionOtherLevels ( int  option)
inline

Set the low-rank option on other levels. 0: Standard. 1: Thick-restart.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankOptionTopLevel()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankOptionTopLevel ( int  option)
inline

Set the low-rank option on the top level. 0: Standard. 1: Thick-restart.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankRandomInitGuess()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankRandomInitGuess ( bool  option)
inline

Set if we use random initial guess for Arnoldi. Otherwise we use 1 as initial guess.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankRanksOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankRanksOtherLevels ( option)
inline

Set the target number of low-rank terms on the other levels.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankRanksTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankRanksTopLevel ( option)
inline

Set the target number of low-rank terms on the top level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankThresholdOtherLevels()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankThresholdOtherLevels ( option)
inline

Set max restarts of thick-restart Arnoldi on other levels.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetLowRankThresholdTopLevel()

template<class MatrixType , class VectorType , typename DataType >
template<typename T >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetLowRankThresholdTopLevel ( option)
inline

Set max restarts of thick-restart Arnoldi on the top level.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetMinimalNumberSubdomains()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetMinimalNumberSubdomains ( int  option)
inline

Set the global minimal number of subdomains on each level of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetNumberSubdomainsReduceFactor()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetNumberSubdomainsReduceFactor ( int  option)
inline

Set the global reduce factor of subdomains on each level of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetNumLevels()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetNumLevels ( int  option)
inline

Set the global target number of levels of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetNumSubdomains()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetNumSubdomains ( int  option)
inline

Set the global target number of subdomains on each level of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPartitionOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPartitionOption ( int  option)
inline

Set the global partition option. 0: ND; 1: RKway.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPermutationOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPermutationOption ( int  option)
inline

Set the global permutation option. 0: No; 1: RCM; 2: AMD.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPolyOrder()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPolyOrder ( int  option)
inline

Set poly order for Poly solve of the B part.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPreconditionerOption1()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPreconditionerOption1 ( int  option)
inline

Set top level preconditioner.

Note
ILU, GeMSLR, Poly.
Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPreconditionerOption1Levels()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPreconditionerOption1Levels ( int  option)
inline

Set top level preconditioner apply levels.

Note
ILU, GeMSLR, Poly.
Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPreconditionerOption2()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPreconditionerOption2 ( int  option)
inline

Set mid level preconditioner.

Note
ILU, GeMSLR, Poly.
Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPreconditionerOptionB()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPreconditionerOptionB ( int  option)
inline

Set all top levels preconditioner.

Note
ILU, BJ-ILU. Not used in the sequential version.
Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetPreconditionerOptionC()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetPreconditionerOptionC ( int  option)
inline

Set last level preconditioner.

Note
ILU, BJ-ILU. Not used in the sequential version.
Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetSeperatorOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetSeperatorOption ( bool  option)
inline

Set the global separator option of GeMSLR.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetSmoothOptionB()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetSmoothOptionB ( int  option)
inline

Set all top levels smoother.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ SetSolveLocation()

template<class MatrixType , class VectorType , typename DataType >
template int pargemslr::precond_gemslr_csr_seq_complexd::SetSolveLocation ( const int &  location)
virtual

Set the data location that the preconditioner apply to.

Parameters
[in]locationThe target solver location.
Returns
Return error message.

◆ SetSolveOption()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetSolveOption ( int  option)
inline

Set the solve option. 0: additive LU solve; 1: additive L solve; 2: multi-solve.

Parameters
[in]optionThe new option.
Returns
Return error message.

◆ Setup()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::Setup ( VectorType &  x,
VectorType &  rhs 
)
virtual

Setup the precondioner phase. Will be called by the solver if not called directly.

Parameters
[in]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ SetWithParameterArray()

template<class MatrixType , class VectorType , typename DataType >
virtual int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SetWithParameterArray ( double *  params)
inlinevirtual

Setup with parameter array.

Parameters
[in]paramsThe parameter array.
Returns
Return error message.

◆ Solve()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::Solve ( VectorType &  x,
VectorType &  rhs 
)
virtual

Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is used.

Parameters
[in,out]xThe initial guess.
[in]rhsThe right-hand-side.
Returns
Return error message.

◆ SolveApplyLowRankLevel()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SolveApplyLowRankLevel ( VectorType &  x,
VectorType &  rhs,
int  level 
)

Apply the low-rank update on a certain level.

Parameters
[in,out]xThe initial guess.
[in]rhsThe right-hand-side.
[in]levelThe start level.
Returns
Return error message.

◆ SolveB()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SolveB ( VectorType &  x,
VectorType &  rhs,
int  level 
)

Solve with B on a certain level.

Parameters
[in,out]xThe initial guess.
[in]rhsThe right-hand-side.
[in]levelThe start level.
Returns
Return error message.

◆ SolveLevel()

template<class MatrixType , class VectorType , typename DataType >
int pargemslr::GemslrClass< MatrixType, VectorType, DataType >::SolveLevel ( VectorType &  x,
VectorType &  rhs,
int  level 
)

Solve starting from a certain level.

Parameters
[in,out]xThe initial guess.
[in]rhsThe right-hand-side.
[in]levelThe start level.
Returns
Return error message.

Member Data Documentation

◆ _levs_v

template<class MatrixType , class VectorType , typename DataType >
std::vector< GemslrLevelClass< MatrixType, VectorType, DataType> > pargemslr::GemslrClass< MatrixType, VectorType, DataType >::_levs_v

Vector holding the level struct for all levels starting from the second level. The size of this vector is equal to _nlev_used, and is the number of true levels.


The documentation for this class was generated from the following files: