Go to the documentation of this file. 1 #ifndef PARGEMSLR_PARALLEL_GEMSLR_H
2 #define PARGEMSLR_PARALLEL_GEMSLR_H
10 #include "../utils/utils.hpp"
11 #include "../utils/structs.hpp"
12 #include "../vectors/int_vector.hpp"
13 #include "../vectors/sequential_vector.hpp"
14 #include "../vectors/parallel_vector.hpp"
15 #include "../matrices/csr_matrix.hpp"
16 #include "../solvers/solver.hpp"
33 template <
class MatrixType,
class VectorType,
typename DataType>
152 int MatVec(
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
164 this->_gemslr->GetMatrix()->GetMpiInfo(np, myid, comm);
165 return PARGEMSLR_SUCCESS;
175 return this->_gemslr->GetMatrix()->GetComm();
187 return this->_gemslr->GetMatrix()->GetDataLocation();
194 typedef ParallelGemslrEBFCMatrixClass<ParallelCsrMatrixClass<float>, ParallelVectorClass<float>,
float> precond_gemslrebfc_csr_par_float;
195 typedef ParallelGemslrEBFCMatrixClass<ParallelCsrMatrixClass<double>, ParallelVectorClass<double>,
double> precond_gemslrebfc_csr_par_double;
196 typedef ParallelGemslrEBFCMatrixClass<ParallelCsrMatrixClass<complexs>, ParallelVectorClass<complexs>, complexs> precond_gemslrebfc_csr_par_complexs;
197 typedef ParallelGemslrEBFCMatrixClass<ParallelCsrMatrixClass<complexd>, ParallelVectorClass<complexd>, complexd> precond_gemslrebfc_csr_par_complexd;
203 template <
class MatrixType,
class VectorType,
typename DataType>
307 int MatVec(
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
316 int Solve( VectorType &x, VectorType &rhs);
328 this->_gemslr->GetMatrix()->GetMpiInfo(np, myid, comm);
329 return PARGEMSLR_SUCCESS;
339 return this->_gemslr->GetMatrix()->GetComm();
344 typedef ParallelGemslrSchurMatrixClass<ParallelCsrMatrixClass<float>, ParallelVectorClass<float>,
float> precond_gemslr_schur_par_float;
345 typedef ParallelGemslrSchurMatrixClass<ParallelCsrMatrixClass<double>, ParallelVectorClass<double>,
double> precond_gemslr_schur_par_double;
346 typedef ParallelGemslrSchurMatrixClass<ParallelCsrMatrixClass<complexs>, ParallelVectorClass<complexs>, complexs> precond_gemslr_schur_par_complexs;
347 typedef ParallelGemslrSchurMatrixClass<ParallelCsrMatrixClass<complexd>, ParallelVectorClass<complexd>, complexd> precond_gemslr_schur_par_complexd;
353 template <
class MatrixType,
class VectorType,
typename DataType>
424 virtual int Setup( VectorType &x, VectorType &rhs)
428 return PARGEMSLR_SUCCESS;
433 PARGEMSLR_ERROR(
"Setup without matrix.");
434 return PARGEMSLR_ERROR_INVALED_PARAM;
439 return PARGEMSLR_SUCCESS;
450 virtual int Solve( VectorType &x, VectorType &rhs)
455 PARGEMSLR_ERROR(
"Solve without setup.");
456 return PARGEMSLR_ERROR_FUNCTION_CALL_ERR;
461 return PARGEMSLR_SUCCESS;
486 virtual int MoveData(
const int &location){
return PARGEMSLR_SUCCESS;};
498 this->
_print_option = params[PARGEMSLR_IO_GENERAL_PRINT_LEVEL];
499 return PARGEMSLR_SUCCESS;
504 typedef ParallelGemslrSchurMatrixClass<precond_gemslr_schur_par_float, ParallelVectorClass<float>,
float> precond_gemslr_schursolve_par_float;
505 typedef ParallelGemslrSchurMatrixClass<precond_gemslr_schur_par_double, ParallelVectorClass<double>,
double> precond_gemslr_schursolve_par_double;
506 typedef ParallelGemslrSchurMatrixClass<precond_gemslr_schur_par_complexs, ParallelVectorClass<complexs>, complexs> precond_gemslr_schursolve_par_complexs;
507 typedef ParallelGemslrSchurMatrixClass<precond_gemslr_schur_par_complexd, ParallelVectorClass<complexd>, complexd> precond_gemslr_schursolve_par_complexd;
514 template <
class MatrixType,
class VectorType,
typename DataType>
666 #ifdef PARGEMSLR_DEBUG
812 template <
class MatrixType,
class VectorType,
typename DataType>
840 VectorType, DataType> _inner_iters_precond;
847 VectorType, DataType> _inner_iters_solver;
872 std::vector<IntVectorClass<int> > _dom_ptr_v2;
898 template <
typename RealDataType>
906 template <
typename RealDataType>
925 template <
typename T1,
typename T2>
926 static T1 ComputeDistance(T2 val);
934 template <
typename T1,
typename T2>
935 static T1 ComputeDistanceSC(T2 val);
968 std::vector< ParallelGemslrLevelClass< MatrixType, VectorType, DataType> >
_levs_v;
1032 virtual int Setup( VectorType &x, VectorType &rhs);
1170 virtual int Solve( VectorType &x, VectorType &rhs);
1181 int SolveLevelGemslr( VectorType &x_out, VectorType &rhs_in,
int level,
bool doperm);
1214 int SolveLevelEsmslr( VectorType &x_out, VectorType &rhs_in,
int level,
bool doperm);
1247 int SolveLevelPslr( VectorType &x_out, VectorType &rhs_in,
int level,
bool doperm);
1258 int SolveB( VectorType &x, VectorType &rhs,
int option,
int level);
1288 int EBFCMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1302 int RAPEBFCMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1314 int SCMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1327 int ACMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1339 int PCLRMatVec(
int level,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1353 int SchurMatVec(
int level,
int option,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1367 int RAPMatVec(
int level,
int option,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1381 int CMatVec(
int level,
int option,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1395 int BMatVec(
int level,
int option,
char trans,
const DataType &alpha, VectorType &x,
const DataType &beta, VectorType &y);
1416 long int GetNumNonzeros(
long int &nnz_bsolver,
long int &nnz_lr);
1437 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslr_SetLocalGemslr."));
1442 gemslr.SetPrintOption(0);
1450 gemslr.SetMinimalNumberSubdomains(this->_gemslr_setups.
_kmin_B_setup);
1451 gemslr.SetNumberSubdomainsReduceFactor(this->_gemslr_setups.
_kfactor_B_setup);
1455 gemslr.SetInnerIterationOption(
false);
1456 gemslr.SetSolveOption(kGemslrLUSolve);
1460 gemslr.SetLowRankOptionTopLevel(this->_gemslr_setups.
_level_setups._lr_option1_B_setup);
1461 gemslr.SetLowRankOptionOtherLevels(this->_gemslr_setups.
_level_setups._lr_option2_B_setup);
1462 gemslr.SetLowRankRandomInitGuess(this->_gemslr_setups.
_level_setups._lr_rand_init_B_setup);
1463 gemslr.SetLowRankFactorTopLevel(this->_gemslr_setups.
_level_setups._lr_rank_factor1_B_setup);
1464 gemslr.SetLowRankFactorOtherLevels(this->_gemslr_setups.
_level_setups._lr_rank_factor2_B_setup);
1465 gemslr.SetLowRankRanksTopLevel(this->_gemslr_setups.
_level_setups._lr_rank1_B_setup);
1466 gemslr.SetLowRankRanksOtherLevels(this->_gemslr_setups.
_level_setups._lr_rank2_B_setup);
1467 gemslr.SetLowRankArnoldiFactorTopLevel(this->_gemslr_setups.
_level_setups._lr_arnoldi_factor1_B_setup);
1468 gemslr.SetLowRankArnoldiFactorOtherLevels(this->_gemslr_setups.
_level_setups._lr_arnoldi_factor2_B_setup);
1469 gemslr.SetLowRankMaxNumberIterationsTopLevel(this->_gemslr_setups.
_level_setups._lr_maxits1_B_setup);
1470 gemslr.SetLowRankMaxNumberIterationsOtherLevels(this->_gemslr_setups.
_level_setups._lr_maxits2_B_setup);
1471 gemslr.SetLowRankThresholdTopLevel(this->_gemslr_setups.
_level_setups._lr_tol_eig1_B_setup);
1472 gemslr.SetLowRankThresholdOtherLevels(this->_gemslr_setups.
_level_setups._lr_tol_eig2_B_setup);
1475 gemslr.SetPreconditionerOptionB(kGemslrBSolveILUT);
1476 gemslr.SetPreconditionerOptionC(kGemslrCSolveILUT);
1479 gemslr.SetIluResidualIters(this->_gemslr_setups.
_level_setups._ilu_residual_iters);
1480 gemslr.SetIluComplexShift(this->_gemslr_setups.
_level_setups._ilu_complex_shift);
1481 gemslr.SetIluDropTolB(this->_gemslr_setups.
_level_setups._B_ilu_tol_B_setup);
1482 gemslr.SetIluDropTolC(this->_gemslr_setups.
_level_setups._C_ilu_tol_B_setup);
1483 gemslr.SetIluMaxRowNnzB(this->_gemslr_setups.
_level_setups._B_ilu_max_row_nnz_B_setup);
1484 gemslr.SetIluMaxRowNnzC(this->_gemslr_setups.
_level_setups._C_ilu_max_row_nnz_B_setup);
1485 gemslr.SetIluFillLevelB(this->_gemslr_setups.
_level_setups._B_ilu_fill_level_B_setup);
1486 gemslr.SetIluFillLevelC(this->_gemslr_setups.
_level_setups._C_ilu_fill_level_B_setup);
1487 gemslr.SetPolyOrder(this->_gemslr_setups.
_level_setups._B_poly_order_B);
1489 return PARGEMSLR_SUCCESS;
1501 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslr_SetLowerGemslr."));
1506 gemslr.SetPrintOption(0);
1586 return PARGEMSLR_SUCCESS;
1598 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslr_SetWithParameterArray."));
1603 this->_print_option = params[PARGEMSLR_IO_GENERAL_PRINT_LEVEL];
1609 this->_gemslr_setups.
_perm_option_setup = params[PARGEMSLR_IO_ILU_PERM_OPTION_GLOBAL];
1611 this->_gemslr_setups.
_nlev_setup = params[PARGEMSLR_IO_PREPOSS_NLEV_GLOBAL];
1612 this->_gemslr_setups.
_nlev_B_setup = params[PARGEMSLR_IO_PREPOSS_NLEV_LOCAL];
1613 this->_gemslr_setups.
_ncomp_setup = params[PARGEMSLR_IO_PREPOSS_NCOMP_GLOBAL];
1614 this->_gemslr_setups.
_ncomp_B_setup = params[PARGEMSLR_IO_PREPOSS_NCOMP_LOCAL];
1615 this->_gemslr_setups.
_kmin_setup = params[PARGEMSLR_IO_PREPOSS_KMIN_GLOBAL];
1616 this->_gemslr_setups.
_kmin_B_setup = params[PARGEMSLR_IO_PREPOSS_KMIN_LOCAL];
1617 this->_gemslr_setups.
_kfactor_setup = params[PARGEMSLR_IO_PREPOSS_KFACTOR_GLOBAL];
1618 this->_gemslr_setups.
_kfactor_B_setup = params[PARGEMSLR_IO_PREPOSS_KFACTOR_LOCAL];
1619 this->_gemslr_setups.
_vertexsep_setup = params[PARGEMSLR_IO_PREPOSS_VTXSEP_GLOBAL] != 0;
1620 this->_gemslr_setups.
_vertexsep_B_setup = params[PARGEMSLR_IO_PREPOSS_VTXSEP_LOCAL] != 0;
1628 this->_gemslr_setups.
_diag_shift_milu = params[PARGEMSLR_IO_ADVANCED_DIAG_SHIFT_MODIFIED];
1632 this->_gemslr_setups.
_level_setups._lr_option1_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION1_GLOBAL];
1633 this->_gemslr_setups.
_level_setups._lr_option2_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION2_GLOBAL];
1634 this->_gemslr_setups.
_level_setups._lr_optionA_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTIONA];
1635 this->_gemslr_setups.
_level_setups._lr_rand_init_setup = params[PARGEMSLR_IO_LR_RAND_INIT_GUESS] != 0.0;
1636 this->_gemslr_setups.
_level_setups._lr_rank_factor1_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR1_GLOBAL];
1637 this->_gemslr_setups.
_level_setups._lr_rank_factor2_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR2_GLOBAL];
1638 this->_gemslr_setups.
_level_setups._lr_rank_factorA_setup = params[PARGEMSLR_IO_LR_RANK_FACTORA];
1639 this->_gemslr_setups.
_level_setups._lr_rank1_setup = params[PARGEMSLR_IO_LR_RANK1_GLOBAL];
1640 this->_gemslr_setups.
_level_setups._lr_rank2_setup = params[PARGEMSLR_IO_LR_RANK2_GLOBAL];
1641 this->_gemslr_setups.
_level_setups._lr_rankA_setup = params[PARGEMSLR_IO_LR_RANK_A];
1642 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor1_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR1_GLOBAL];
1643 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor2_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR2_GLOBAL];
1644 this->_gemslr_setups.
_level_setups._lr_arnoldi_factorA_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTORA];
1645 this->_gemslr_setups.
_level_setups._lr_maxits1_setup = params[PARGEMSLR_IO_LR_MAXITS1_GLOBAL];
1646 this->_gemslr_setups.
_level_setups._lr_maxits2_setup = params[PARGEMSLR_IO_LR_MAXITS2_GLOBAL];
1647 this->_gemslr_setups.
_level_setups._lr_maxitsA_setup = params[PARGEMSLR_IO_LR_MAXITSA];
1648 this->_gemslr_setups.
_level_setups._lr_tol_eig1_setup = params[PARGEMSLR_IO_LR_TOL_EIG1_GLOBAL];
1649 this->_gemslr_setups.
_level_setups._lr_tol_eig2_setup = params[PARGEMSLR_IO_LR_TOL_EIG2_GLOBAL];
1650 this->_gemslr_setups.
_level_setups._lr_tol_eigA_setup = params[PARGEMSLR_IO_LR_TOL_EIGA];
1652 this->_global_precond_option = params[PARGEMSLR_IO_PRECOND_GLOBAL_PRECOND];
1653 this->_gemslr_setups.
_level_setups._B_solve_option1 = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND1];
1654 this->_gemslr_setups.
_level_setups._B_solve_option1_levels = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND1_LEVEL];
1655 this->_gemslr_setups.
_level_setups._B_solve_option2 = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND2];
1656 this->_gemslr_setups.
_level_setups._C_solve_option = params[PARGEMSLR_IO_PRECOND_LOCAL_REPCOND3];
1657 this->_gemslr_setups.
_level_setups._B_smooth_option1 = params[PARGEMSLR_IO_PRECOND_LOCAL_SMOOTHER1];
1659 if(this->_gemslr_setups.
_level_setups._C_solve_option == kGemslrCSolveBJILUK2)
1661 this->_gemslr_setups.
_level_setups._C_solve_option = kGemslrCSolveBJILUK;
1664 if(this->_gemslr_setups.
_level_setups._C_solve_option == kGemslrCSolveBJILUT2)
1666 this->_gemslr_setups.
_level_setups._C_solve_option = kGemslrCSolveBJILUT;
1670 this->_gemslr_setups.
_level_setups._B_ilu_tol_setup = params[PARGEMSLR_IO_ILU_DROPTOL_B_GLOBAL];
1671 this->_gemslr_setups.
_level_setups._C_ilu_tol_setup = params[PARGEMSLR_IO_ILU_DROPTOL_C_GLOBAL];
1672 this->_gemslr_setups.
_level_setups._EF_ilu_tol_setup = params[PARGEMSLR_IO_ILU_DROPTOL_EF_GLOBAL];
1673 this->_gemslr_setups.
_level_setups._S_ilu_tol_setup = params[PARGEMSLR_IO_ILU_DROPTOL_S_GLOBAL];
1674 this->_gemslr_setups.
_level_setups._B_ilu_max_row_nnz_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_B_GLOBAL];
1675 this->_gemslr_setups.
_level_setups._C_ilu_max_row_nnz_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_C_GLOBAL];
1676 this->_gemslr_setups.
_level_setups._S_ilu_max_row_nnz_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_S_GLOBAL];
1677 this->_gemslr_setups.
_level_setups._B_ilu_fill_level_setup = params[PARGEMSLR_IO_ILU_LFIL_B_GLOBAL];
1678 this->_gemslr_setups.
_level_setups._C_ilu_fill_level_setup = params[PARGEMSLR_IO_ILU_LFIL_C_GLOBAL];
1679 this->_gemslr_setups.
_level_setups._B_poly_order = params[PARGEMSLR_IO_POLY_ORDER];
1681 this->_gemslr_setups.
_level_setups._ilu_complex_shift = params[PARGEMSLR_IO_ADVANCED_USE_COMPLEX_SHIFT] != 0.0;
1682 this->_gemslr_setups.
_level_setups._ilu_residual_iters = params[PARGEMSLR_IO_ADVANCED_RESIDUAL_ITERS];
1684 pargemslr_global::_gram_schmidt = params[PARGEMSLR_IO_ADVANCED_GRAM_SCHMIDT];
1686 this->_gemslr_setups.
_level_setups._lr_option1_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION1_LOCAL];
1687 this->_gemslr_setups.
_level_setups._lr_option2_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_OPTION2_LOCAL];
1688 this->_gemslr_setups.
_level_setups._lr_rand_init_B_setup = params[PARGEMSLR_IO_LR_RAND_INIT_GUESS] != 0.0;
1689 this->_gemslr_setups.
_level_setups._lr_rank_factor1_B_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR1_LOCAL];
1690 this->_gemslr_setups.
_level_setups._lr_rank_factor2_B_setup = params[PARGEMSLR_IO_LR_RANK_FACTOR2_LOCAL];
1691 this->_gemslr_setups.
_level_setups._lr_rank1_B_setup = params[PARGEMSLR_IO_LR_RANK1_LOCAL];
1692 this->_gemslr_setups.
_level_setups._lr_rank2_B_setup = params[PARGEMSLR_IO_LR_RANK2_LOCAL];
1693 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor1_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR1_LOCAL];
1694 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor2_B_setup = params[PARGEMSLR_IO_LR_ARNOLDI_FACTOR2_LOCAL];
1695 this->_gemslr_setups.
_level_setups._lr_maxits1_B_setup = params[PARGEMSLR_IO_LR_MAXITS1_LOCAL];
1696 this->_gemslr_setups.
_level_setups._lr_maxits2_B_setup = params[PARGEMSLR_IO_LR_MAXITS2_LOCAL];
1697 this->_gemslr_setups.
_level_setups._lr_tol_eig1_B_setup = params[PARGEMSLR_IO_LR_TOL_EIG1_LOCAL];
1698 this->_gemslr_setups.
_level_setups._lr_tol_eig2_B_setup = params[PARGEMSLR_IO_LR_TOL_EIG2_LOCAL];
1700 this->_gemslr_setups.
_level_setups._B_ilu_tol_B_setup = params[PARGEMSLR_IO_ILU_DROPTOL_B_LOCAL];
1701 this->_gemslr_setups.
_level_setups._C_ilu_tol_B_setup = params[PARGEMSLR_IO_ILU_DROPTOL_C_LOCAL];
1702 this->_gemslr_setups.
_level_setups._B_ilu_max_row_nnz_B_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_B_LOCAL];
1703 this->_gemslr_setups.
_level_setups._C_ilu_max_row_nnz_B_setup = params[PARGEMSLR_IO_ILU_ROWNNZ_C_LOCAL];
1704 this->_gemslr_setups.
_level_setups._B_ilu_fill_level_B_setup = params[PARGEMSLR_IO_ILU_LFIL_B_LOCAL];
1705 this->_gemslr_setups.
_level_setups._C_ilu_fill_level_B_setup = params[PARGEMSLR_IO_ILU_LFIL_C_LOCAL];
1706 this->_gemslr_setups.
_level_setups._B_poly_order_B = params[PARGEMSLR_IO_POLY_ORDER];
1708 return PARGEMSLR_SUCCESS;
1719 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1720 PARGEMSLR_FIRM_CHKERR(option < 0);
1721 PARGEMSLR_FIRM_CHKERR(option > 3);
1722 this->_global_precond_option = option;
1723 return PARGEMSLR_SUCCESS;
1734 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1735 PARGEMSLR_FIRM_CHKERR(option < 0);
1736 PARGEMSLR_FIRM_CHKERR(option > 1);
1738 return PARGEMSLR_SUCCESS;
1749 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1750 PARGEMSLR_FIRM_CHKERR(option < 0);
1751 PARGEMSLR_FIRM_CHKERR(option > 1);
1753 return PARGEMSLR_SUCCESS;
1764 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1765 PARGEMSLR_FIRM_CHKERR(option < 0);
1766 PARGEMSLR_FIRM_CHKERR(option > 2);
1768 return PARGEMSLR_SUCCESS;
1779 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1780 PARGEMSLR_FIRM_CHKERR(option < 0);
1781 PARGEMSLR_FIRM_CHKERR(option > 2);
1783 return PARGEMSLR_SUCCESS;
1794 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1795 PARGEMSLR_FIRM_CHKERR(option < 1);
1797 return PARGEMSLR_SUCCESS;
1808 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1809 PARGEMSLR_FIRM_CHKERR(option < 1);
1811 return PARGEMSLR_SUCCESS;
1822 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1823 PARGEMSLR_FIRM_CHKERR(option < 1);
1825 return PARGEMSLR_SUCCESS;
1836 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1837 PARGEMSLR_FIRM_CHKERR(option < 1);
1839 return PARGEMSLR_SUCCESS;
1850 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1851 PARGEMSLR_FIRM_CHKERR(option < 1);
1853 return PARGEMSLR_SUCCESS;
1864 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1865 PARGEMSLR_FIRM_CHKERR(option < 1);
1867 return PARGEMSLR_SUCCESS;
1878 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1879 PARGEMSLR_FIRM_CHKERR(option < 1);
1881 return PARGEMSLR_SUCCESS;
1892 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1893 PARGEMSLR_FIRM_CHKERR(option < 1);
1895 return PARGEMSLR_SUCCESS;
1906 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1908 return PARGEMSLR_SUCCESS;
1919 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1921 return PARGEMSLR_SUCCESS;
1932 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1934 return PARGEMSLR_SUCCESS;
1945 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1947 return PARGEMSLR_SUCCESS;
1956 template <
typename T>
1959 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1961 return PARGEMSLR_SUCCESS;
1972 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1973 PARGEMSLR_FIRM_CHKERR(option < 1);
1975 return PARGEMSLR_SUCCESS;
1986 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
1987 PARGEMSLR_FIRM_CHKERR(option < 0);
1988 PARGEMSLR_FIRM_CHKERR(option > 2);
1990 return PARGEMSLR_SUCCESS;
2001 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2002 PARGEMSLR_FIRM_CHKERR(option < 0);
2003 PARGEMSLR_FIRM_CHKERR(option > 2);
2004 this->_gemslr_setups.
_level_setups._lr_option1_setup = option;
2005 return PARGEMSLR_SUCCESS;
2016 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2017 PARGEMSLR_FIRM_CHKERR(option < 0);
2018 PARGEMSLR_FIRM_CHKERR(option > 2);
2019 this->_gemslr_setups.
_level_setups._lr_option2_setup = option;
2020 return PARGEMSLR_SUCCESS;
2031 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2032 PARGEMSLR_FIRM_CHKERR(option < 0);
2033 PARGEMSLR_FIRM_CHKERR(option > 2);
2034 this->_gemslr_setups.
_level_setups._lr_optionA_setup = option;
2035 return PARGEMSLR_SUCCESS;
2046 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2047 PARGEMSLR_FIRM_CHKERR(option < 0);
2048 PARGEMSLR_FIRM_CHKERR(option > 2);
2049 this->_gemslr_setups.
_level_setups._lr_option1_B_setup = option;
2050 return PARGEMSLR_SUCCESS;
2061 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2062 PARGEMSLR_FIRM_CHKERR(option < 0);
2063 PARGEMSLR_FIRM_CHKERR(option > 2);
2064 this->_gemslr_setups.
_level_setups._lr_option2_B_setup = option;
2065 return PARGEMSLR_SUCCESS;
2076 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2077 this->_gemslr_setups.
_level_setups._lr_rand_init_setup = option;
2078 return PARGEMSLR_SUCCESS;
2089 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2090 this->_gemslr_setups.
_level_setups._lr_rand_init_B_setup = option;
2091 return PARGEMSLR_SUCCESS;
2100 template <
typename T>
2103 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2104 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2105 this->_gemslr_setups.
_level_setups._lr_rank_factor1_setup = option;
2106 return PARGEMSLR_SUCCESS;
2115 template <
typename T>
2118 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2119 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2120 this->_gemslr_setups.
_level_setups._lr_rank_factor2_setup = option;
2121 return PARGEMSLR_SUCCESS;
2130 template <
typename T>
2133 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2134 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2135 this->_gemslr_setups.
_level_setups._lr_rank_factorA_setup = option;
2136 return PARGEMSLR_SUCCESS;
2145 template <
typename T>
2148 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2149 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2150 this->_gemslr_setups.
_level_setups._lr_rank_factor1_B_setup = option;
2151 return PARGEMSLR_SUCCESS;
2160 template <
typename T>
2163 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2164 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2165 this->_gemslr_setups.
_level_setups._lr_rank_factor2_B_setup = option;
2166 return PARGEMSLR_SUCCESS;
2175 template <
typename T>
2178 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2179 PARGEMSLR_FIRM_CHKERR(option < 0);
2180 this->_gemslr_setups.
_level_setups._lr_rank1_setup = option;
2181 return PARGEMSLR_SUCCESS;
2190 template <
typename T>
2193 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2194 PARGEMSLR_FIRM_CHKERR(option < 0);
2195 this->_gemslr_setups.
_level_setups._lr_rank2_setup = option;
2196 return PARGEMSLR_SUCCESS;
2205 template <
typename T>
2208 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2209 PARGEMSLR_FIRM_CHKERR(option < 0);
2210 this->_gemslr_setups.
_level_setups._lr_rankA_setup = option;
2211 return PARGEMSLR_SUCCESS;
2220 template <
typename T>
2223 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2224 PARGEMSLR_FIRM_CHKERR(option < 0);
2225 this->_gemslr_setups.
_level_setups._lr_rank1_B_setup = option;
2226 return PARGEMSLR_SUCCESS;
2235 template <
typename T>
2238 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2239 PARGEMSLR_FIRM_CHKERR(option < 0);
2240 this->_gemslr_setups.
_level_setups._lr_rank2_B_setup = option;
2241 return PARGEMSLR_SUCCESS;
2250 template <
typename T>
2253 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2254 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2255 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor1_setup = option;
2256 return PARGEMSLR_SUCCESS;
2265 template <
typename T>
2268 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2269 PARGEMSLR_FIRM_CHKERR(option < 0);
2270 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor2_setup = option;
2271 return PARGEMSLR_SUCCESS;
2280 template <
typename T>
2283 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2284 PARGEMSLR_FIRM_CHKERR(option < 0);
2285 this->_gemslr_setups.
_level_setups._lr_arnoldi_factorA_setup = option;
2286 return PARGEMSLR_SUCCESS;
2295 template <
typename T>
2298 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2299 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2300 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor1_B_setup = option;
2301 return PARGEMSLR_SUCCESS;
2310 template <
typename T>
2313 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2314 PARGEMSLR_FIRM_CHKERR(option < T(1.0));
2315 this->_gemslr_setups.
_level_setups._lr_arnoldi_factor2_B_setup = option;
2316 return PARGEMSLR_SUCCESS;
2327 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2328 PARGEMSLR_FIRM_CHKERR(option < 0);
2329 this->_gemslr_setups.
_level_setups._lr_maxits1_setup = option;
2330 return PARGEMSLR_SUCCESS;
2341 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2342 PARGEMSLR_FIRM_CHKERR(option < 0);
2343 this->_gemslr_setups.
_level_setups._lr_maxits2_setup = option;
2344 return PARGEMSLR_SUCCESS;
2355 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2356 PARGEMSLR_FIRM_CHKERR(option < 0);
2357 this->_gemslr_setups.
_level_setups._lr_maxitsA_setup = option;
2358 return PARGEMSLR_SUCCESS;
2369 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2370 PARGEMSLR_FIRM_CHKERR(option < 0);
2371 this->_gemslr_setups.
_level_setups._lr_maxits1_B_setup = option;
2372 return PARGEMSLR_SUCCESS;
2383 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2384 PARGEMSLR_FIRM_CHKERR(option < 0);
2385 this->_gemslr_setups.
_level_setups._lr_maxits2_B_setup = option;
2386 return PARGEMSLR_SUCCESS;
2395 template <
typename T>
2398 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2399 this->_gemslr_setups.
_level_setups._lr_tol_eig1_setup = option;
2400 return PARGEMSLR_SUCCESS;
2409 template <
typename T>
2412 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2413 this->_gemslr_setups.
_level_setups._lr_tol_eig2_setup = option;
2414 return PARGEMSLR_SUCCESS;
2423 template <
typename T>
2426 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2427 this->_gemslr_setups.
_level_setups._lr_tol_eigA_setup = option;
2428 return PARGEMSLR_SUCCESS;
2437 template <
typename T>
2440 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2441 this->_gemslr_setups.
_level_setups._lr_tol_eig1_B_setup = option;
2442 return PARGEMSLR_SUCCESS;
2451 template <
typename T>
2454 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2455 this->_gemslr_setups.
_level_setups._lr_tol_eig2_B_setup = option;
2456 return PARGEMSLR_SUCCESS;
2465 template <
typename T>
2468 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2469 this->_gemslr_setups.
_level_setups._B_ilu_tol_setup = option;
2470 return PARGEMSLR_SUCCESS;
2479 template <
typename T>
2482 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2483 this->_gemslr_setups.
_level_setups._C_ilu_tol_setup = option;
2484 return PARGEMSLR_SUCCESS;
2493 template <
typename T>
2496 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2497 this->_gemslr_setups.
_level_setups._S_ilu_tol_setup = option;
2498 return PARGEMSLR_SUCCESS;
2507 template <
typename T>
2510 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2511 this->_gemslr_setups.
_level_setups._EF_ilu_tol_setup = option;
2512 return PARGEMSLR_SUCCESS;
2521 template <
typename T>
2524 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2525 this->_gemslr_setups.
_level_setups._B_ilu_tol_B_setup = option;
2526 return PARGEMSLR_SUCCESS;
2535 template <
typename T>
2538 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2539 this->_gemslr_setups.
_level_setups._C_ilu_tol_B_setup = option;
2540 return PARGEMSLR_SUCCESS;
2551 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2552 PARGEMSLR_FIRM_CHKERR(option < 0);
2553 this->_gemslr_setups.
_level_setups._B_ilu_max_row_nnz_setup = option;
2554 return PARGEMSLR_SUCCESS;
2565 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2566 PARGEMSLR_FIRM_CHKERR(option < 0);
2567 this->_gemslr_setups.
_level_setups._C_ilu_max_row_nnz_setup = option;
2568 return PARGEMSLR_SUCCESS;
2579 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2580 PARGEMSLR_FIRM_CHKERR(option < 0);
2581 this->_gemslr_setups.
_level_setups._S_ilu_max_row_nnz_setup = option;
2582 return PARGEMSLR_SUCCESS;
2593 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2594 PARGEMSLR_FIRM_CHKERR(option < 0);
2595 this->_gemslr_setups.
_level_setups._B_ilu_max_row_nnz_B_setup = option;
2596 return PARGEMSLR_SUCCESS;
2607 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2608 PARGEMSLR_FIRM_CHKERR(option < 0);
2609 this->_gemslr_setups.
_level_setups._C_ilu_max_row_nnz_B_setup = option;
2610 return PARGEMSLR_SUCCESS;
2621 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2622 PARGEMSLR_FIRM_CHKERR(option < 0);
2623 this->_gemslr_setups.
_level_setups._B_ilu_fill_level_setup = option;
2624 return PARGEMSLR_SUCCESS;
2635 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2636 PARGEMSLR_FIRM_CHKERR(option < 0);
2637 this->_gemslr_setups.
_level_setups._C_ilu_fill_level_setup = option;
2638 return PARGEMSLR_SUCCESS;
2649 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2650 PARGEMSLR_FIRM_CHKERR(option < 0);
2651 this->_gemslr_setups.
_level_setups._B_ilu_fill_level_B_setup = option;
2652 return PARGEMSLR_SUCCESS;
2663 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"GemslrSets"));
2664 PARGEMSLR_FIRM_CHKERR(option < 0);
2665 this->_gemslr_setups.
_level_setups._C_ilu_fill_level_B_setup = option;
2666 return PARGEMSLR_SUCCESS;
2677 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2678 PARGEMSLR_FIRM_CHKERR(option < 1);
2680 return PARGEMSLR_SUCCESS;
2691 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2692 PARGEMSLR_FIRM_CHKERR(option < 1);
2693 this->_gemslr_setups.
_level_setups._B_poly_order_B = option;
2694 return PARGEMSLR_SUCCESS;
2706 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2707 PARGEMSLR_FIRM_CHKERR(option < 0);
2708 PARGEMSLR_FIRM_CHKERR(option > 2);
2709 this->_gemslr_setups.
_level_setups._B_solve_option1 = option;
2710 return PARGEMSLR_SUCCESS;
2722 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2723 this->_gemslr_setups.
_level_setups._B_solve_option1_levels = option;
2724 return PARGEMSLR_SUCCESS;
2736 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2737 PARGEMSLR_FIRM_CHKERR(option < 0);
2738 PARGEMSLR_FIRM_CHKERR(option > 2);
2739 this->_gemslr_setups.
_level_setups._B_solve_option2 = option;
2740 return PARGEMSLR_SUCCESS;
2752 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2753 PARGEMSLR_FIRM_CHKERR(option < 0);
2754 PARGEMSLR_FIRM_CHKERR(option > 2);
2755 this->_gemslr_setups.
_level_setups._B_solve_option1 = option;
2756 this->_gemslr_setups.
_level_setups._B_solve_option1_levels = 0;
2757 this->_gemslr_setups.
_level_setups._B_solve_option2 = option;
2758 return PARGEMSLR_SUCCESS;
2769 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2770 PARGEMSLR_FIRM_CHKERR(option < 0);
2771 PARGEMSLR_FIRM_CHKERR(option > 1);
2772 this->_gemslr_setups.
_level_setups._B_smooth_option1 = option;
2773 return PARGEMSLR_SUCCESS;
2785 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2786 PARGEMSLR_FIRM_CHKERR(option < 0);
2787 PARGEMSLR_FIRM_CHKERR(option > 1);
2788 this->_gemslr_setups.
_level_setups._C_solve_option = option;
2789 return PARGEMSLR_SUCCESS;
2800 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2801 this->_gemslr_setups.
_level_setups._ilu_residual_iters = residual_iters;
2802 return PARGEMSLR_SUCCESS;
2813 PARGEMSLR_FIRM_CHKERR(this->CheckReadySetups(
"ParallelGemslrSets"));
2814 this->_gemslr_setups.
_level_setups._ilu_complex_shift = complex_shift;
2815 return PARGEMSLR_SUCCESS;
2832 virtual int MoveData(
const int &location);
2846 typedef ParallelGemslrClass<ParallelCsrMatrixClass<float>, ParallelVectorClass<float>,
float> precond_gemslr_csr_par_float;
2847 typedef ParallelGemslrClass<ParallelCsrMatrixClass<double>, ParallelVectorClass<double>,
double> precond_gemslr_csr_par_double;
2848 typedef ParallelGemslrClass<ParallelCsrMatrixClass<complexs>, ParallelVectorClass<complexs>, complexs> precond_gemslr_csr_par_complexs;
2849 typedef ParallelGemslrClass<ParallelCsrMatrixClass<complexd>, ParallelVectorClass<complexd>, complexd> precond_gemslr_csr_par_complexd;
int SolveApplyLowRankLevel(VectorType &x, VectorType &rhs, int level)
Apply the low-rank update on a certain level.
Definition: parallel_gemslr.cpp:6249
int SetBNumLevels(int option)
Set the B part target number of levels of GeMSLR.
Definition: parallel_gemslr.hpp:1806
int SetSeperatorOption(bool option)
Set the global separator option of GeMSLR.
Definition: parallel_gemslr.hpp:1904
int SetPartitionOption(int option)
Set the global partition option. 0: ND; 1: RKway.
Definition: parallel_gemslr.hpp:1732
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: parallel_gemslr.hpp:478
int _kfactor_setup
In the recursive Kway partition, from the second level, each time the number of terget subdomains is ...
Definition: gemslr.hpp:1346
ParallelGemslrLevelClass< MatrixType, VectorType, DataType > _lev_A
The structure for the A level low-rank correction.
Definition: parallel_gemslr.hpp:974
VectorType _xlr1_temp_h
Temp vector.
Definition: parallel_gemslr.hpp:703
int CMatVec(int level, int option, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec with the C on the current level.
Definition: parallel_gemslr.cpp:7028
int Clear()
Free the current matrix.
Definition: parallel_gemslr.cpp:102
int SetBSeperatorOption(bool option)
Set the B part separator option of GeMSLR.
Definition: parallel_gemslr.hpp:1917
int SetLowRankOptionTopLevel(int option)
Set the low-rank option on the top level. 0: Standard. 1: Thick-restart.
Definition: parallel_gemslr.hpp:1999
int SetupPermutation()
Setup the permutation of the GeMSLR.
Definition: parallel_gemslr.cpp:1912
int SetupPermutationRKway(MatrixType &A, int nlev_setup, int &nlev_max, int &nlev_used, vector_int &map_v, vector_int &mapptr_v)
Setup the Recursive KWay partition of the GeMSLR.
Definition: parallel_gemslr.cpp:2366
int _inner_iters_maxits_setup
The level of inner iteration. Solve Sx = b with preconditioned GMRES where GeMSLR is used as a precon...
Definition: gemslr.hpp:1432
int _nlev_B_setup
The total number of levels user wants to have in the B part if GeMSLR is used.
Definition: gemslr.hpp:1378
int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
Get comm, np, and myid. Get the global one.
Definition: parallel_gemslr.hpp:326
int SetBIluDropTolC(T option)
Set the recursive GeMSLR last level threshold for ILUT of the global B part.
Definition: parallel_gemslr.hpp:2536
ParallelGemslrSchurMatrixClass< MatrixType, VectorType, DataType > & operator=(const ParallelGemslrSchurMatrixClass< MatrixType, VectorType, DataType > &precond)
The operator = of ParallelGemslrSchurMatrixClass.
Definition: parallel_gemslr.cpp:263
int SetupBSolveGemslr(VectorType &x, VectorType &rhs, int level)
Setup the solve of B matrices of the GeMSLR with GeMSLR.
Definition: parallel_gemslr.cpp:3851
~ParallelGemslrLevelClass()
The destructor of ParallelGemslrLevelClass.
Definition: parallel_gemslr.cpp:513
int SetIluDropTolEF(T option)
Set the threshold for ILUT of the EF part.
Definition: parallel_gemslr.hpp:2508
int SetupLowRankNoRestart(VectorType &x, VectorType &rhs, int level, int option)
Setup the low-rank part of the GeMSLR with arnodi no-restart.
Definition: parallel_gemslr.cpp:4363
virtual int Solve(VectorType &x, VectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: parallel_gemslr.hpp:450
virtual int Solve(VectorType &x, VectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: parallel_gemslr.cpp:5118
int SetLowRankFactorTopLevel(T option)
Set the low-rank factor on the top level. The actuall computed number of low-rank terms is rank * fac...
Definition: parallel_gemslr.hpp:2101
int SetGlobalPrecondOption(int option)
Set the global precond option. 0: BJ; 1: ISCHUR; 2: ESCHUR; 3: MLEV.
Definition: parallel_gemslr.hpp:1717
int GetNumRowsLocal()
Get the local number of rows of the matrix.
Definition: parallel_gemslr.cpp:151
SolverClass< CsrMatrixClass< DataType >, SequentialVectorClass< DataType >, DataType > ** _B_precond
The preconditioners for B matrix.
Definition: parallel_gemslr.hpp:591
IntVectorClass< int > _pperm
The row permutation vector.
Definition: parallel_gemslr.hpp:639
int SCMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = G*x = C\S*x-x. Note that alpha and beta are untouched.
Definition: parallel_gemslr.cpp:6550
int RAPEBFCMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = G*x = (2EB^{-1}F + EB^{-1}BB^{-1}F)C^{-1}x. Note that alpha and beta are unto...
Definition: parallel_gemslr.cpp:6427
The GEMSLR information on each level, contains the solver for B and the low-rank information for S.
Definition: parallel_gemslr.hpp:516
int SetBLowRankRanksOtherLevels(T option)
Set the B part target number of low-rank terms on the other levels.
Definition: parallel_gemslr.hpp:2236
The local real ilu preconditioner, only work for sequential CSR matrix.
Definition: structs.hpp:20
ParallelGemslrLevelClass()
The constructor of ParallelGemslrLevelClass, set everything to 0.
Definition: parallel_gemslr.cpp:500
virtual int SetLocalGemslr(GemslrClass< CsrMatrixClass< DataType >, SequentialVectorClass< DataType >, DataType > &gemslr)
Setup with parameter array. This is the helper function to set the local gemslr for B solve.
Definition: parallel_gemslr.hpp:1434
MatrixType _A_mat
The A matrix on this level.
Definition: parallel_gemslr.hpp:561
int SetBLowRankRanksTopLevel(T option)
Set the B part target number of low-rank terms on the top level.
Definition: parallel_gemslr.hpp:2221
int SolveLevelEsmslrU(VectorType &x_out, VectorType &rhs_in, int level, bool doperm)
Solve starting from a certain level.
int GetSolvePhase()
Get the solve phase.
Definition: parallel_gemslr.hpp:2839
The GEMSLR options.
Definition: gemslr.hpp:1288
int SetIluFillLevelC(int option)
Set the fill level for ILUK of the last level.
Definition: parallel_gemslr.hpp:2633
int SetNumberSubdomainsReduceFactor(int option)
Set the global reduce factor of subdomains on each level of GeMSLR.
Definition: parallel_gemslr.hpp:1876
std::vector< CsrMatrixClass< DataType > > _B_mat_v
The B matrix on this level. C matrix if this is the last level.
Definition: parallel_gemslr.hpp:543
int SetIluDropTolS(T option)
Set the threshold for ILUT of the S part.
Definition: parallel_gemslr.hpp:2494
virtual int SetLowerGemslr(ParallelGemslrClass< MatrixType, VectorType, DataType > &gemslr)
Setup with parameter array. This is the helper function to set the lower level gemslr for explicite S...
Definition: parallel_gemslr.hpp:1498
int PlotPatternGnuPlot(const char *datafilename)
Plot the pattern of the parallel gemslr using gnuplot. Similar to spy in the MATLAB....
Definition: parallel_gemslr.cpp:7394
VectorType _temp_v
Temp vector for the Arnoldi.
Definition: parallel_gemslr.hpp:234
ParallelGemslrEBFCMatrixClass()
The constructor of ParallelGemslrEBFCMatrixClass.
Definition: parallel_gemslr.cpp:20
ParallelGemslrClass()
The constructor of precondioner class.
Definition: parallel_gemslr.cpp:1062
int SetIluFillLevelB(int option)
Set the fill level for ILUK of the B part.
Definition: parallel_gemslr.hpp:2619
ParallelGemslrClass< MatrixType, VectorType, DataType > & operator=(const ParallelGemslrClass< MatrixType, VectorType, DataType > &precond)
The operator = of ParallelGemslrClass.
Definition: parallel_gemslr.cpp:1145
GemslrLevelSetupStruct< DataType > _level_setups
The global setup of low-rank correction on this level.
Definition: gemslr.hpp:1297
Class of matvec with the Schur Complement.
Definition: parallel_gemslr.hpp:205
int SetupLowRankThickRestart(VectorType &x, VectorType &rhs, int level, int option)
Setup the low-rank part of the GeMSLR with arnodi thick-restart.
Definition: parallel_gemslr.cpp:4502
ParallelGemslrEBFCMatrixClass< MatrixType, VectorType, DataType > & operator=(const ParallelGemslrEBFCMatrixClass< MatrixType, VectorType, DataType > &precond)
The operator = of ParallelGemslrEBFCMatrixClass.
Definition: parallel_gemslr.cpp:71
int SetSmoothOptionB(int option)
Set all top levels smoother.
Definition: parallel_gemslr.hpp:2767
int GetMpiInfo(int &np, int &myid, MPI_Comm &comm) const
Get comm, np, and myid. Get the global one.
Definition: parallel_gemslr.hpp:162
ParallelGemslrSchurMatrixClass()
The constructor of ParallelGemslrSchurMatrixClass.
Definition: parallel_gemslr.cpp:212
int SetIluMaxRowNnzC(int option)
Set the maxinum number of nonzeros ILUT of the last level.
Definition: parallel_gemslr.hpp:2563
int SetupVectorPtrStr(VectorType &v)
Set the structure of a vector pointer that has same row partition as this matrix.
Definition: parallel_gemslr.cpp:139
VectorType _xlr2_temp
Temp vector.
Definition: parallel_gemslr.hpp:697
int SetBLowRankThresholdTopLevel(T option)
Set B part max restarts of thick-restart Arnoldi on the top level.
Definition: parallel_gemslr.hpp:2438
int _perm_option_setup
Set the local B reordering option.
Definition: gemslr.hpp:1320
virtual int Clear()
Free the current precondioner.
Definition: parallel_gemslr.hpp:369
DenseMatrixClass< DataType > _Wk
The W matrix for the low-rank correction W*H*W' on this level.
Definition: parallel_gemslr.hpp:609
int SetLowRankArnoldiFactorOtherLevels(T option)
Set the Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_factor.
Definition: parallel_gemslr.hpp:2266
int SetupVectorPtrStr(VectorType &v)
Set the structure of a vector pointer that has same row partition as this matrix.
Definition: parallel_gemslr.cpp:325
int SetLowRankArnoldiFactorA(T option)
Set the Arnoldi factor on A. m steps for arnoldi is rank * rank_factor * arnoldi_factor.
Definition: parallel_gemslr.hpp:2281
virtual ~ParallelGemslrClass()
The destructor of precondioner class.
Definition: parallel_gemslr.cpp:1219
int SetBMinimalNumberSubdomains(int option)
Set the B part minimal number of subdomains on each level of GeMSLR.
Definition: parallel_gemslr.hpp:1862
int SetBLowRankOptionOtherLevels(int option)
Set the B part low-rank option on other levels. 0: Standard. 1: Thick-restart.
Definition: parallel_gemslr.hpp:2059
The real flexgmres solver class.
Definition: fgmres.hpp:29
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: parallel_gemslr.hpp:486
VectorType _sol_temp
The temp vector for permuted x.
Definition: parallel_gemslr.hpp:715
int SetLowRankOptionA(int option)
Set the low-rank option on A. 0: Standard. 1: Thick-restart.
Definition: parallel_gemslr.hpp:2029
bool _vertexsep_setup
Set to true to use vertex seperator. Note that k must be power of 2 for vertex seperator.
Definition: gemslr.hpp:1352
int SolveLevelEsmslr(VectorType &x_out, VectorType &rhs_in, int level, bool doperm)
Solve starting from a certain level.
Definition: parallel_gemslr.cpp:5680
int SetLowRankThresholdTopLevel(T option)
Set max restarts of thick-restart Arnoldi on the top level.
Definition: parallel_gemslr.hpp:2396
virtual ~ParallelGemslrSchurMatrixClass()
The destructor of GemslrEBFCMatrixClass.
Definition: parallel_gemslr.cpp:224
VectorType _rhs2_temp
The temp vector for permuted rhs.
Definition: parallel_gemslr.hpp:733
int SetupPermutationBuildLevelStructure(MatrixType &A, int level_start, vector_int &map_v, vector_int &mapptr_v)
Setup the level structure of the GeMSLR.
Definition: parallel_gemslr.cpp:2496
int SetPreconditionerOption1Levels(int option)
Set top level preconditioner apply levels.
Definition: parallel_gemslr.hpp:2720
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: parallel_gemslr.cpp:7279
int CheckParameters()
Check the input parameters, avoid invalid settings.
Definition: parallel_gemslr.cpp:1440
int PCLRMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = (EsC^{-1})^m*x. Note that alpha and beta are untouched.
Definition: parallel_gemslr.cpp:6690
int SetLowRankRandomInitGuess(bool option)
Set if we use random initial guess for Arnoldi. Otherwise we use 1 as initial guess.
Definition: parallel_gemslr.hpp:2074
Sequential GeMSLR preconditioner.
DenseMatrixClass< DataType > _cHk
The H matrix for the low-rank correction W*H*W' on the last level.
Definition: parallel_gemslr.hpp:621
ParallelGemslrEBFCMatrixClass< MatrixType, VectorType, DataType > _EBFC
The EBFC matrix on this level.
Definition: parallel_gemslr.hpp:585
int SetInnerIterationThreshold(T option)
Set the stop threshold of inner iteration of GeMSLR.
Definition: parallel_gemslr.hpp:1957
int GetDataLocation() const
Get the data location of the matrix.
Definition: parallel_gemslr.hpp:183
int SetBLowRankArnoldiFactorTopLevel(T option)
Set the B part Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_f...
Definition: parallel_gemslr.hpp:2296
virtual int Clear()
Free the current precondioner.
Definition: parallel_gemslr.cpp:1229
virtual int SetWithParameterArray(double *params)
Setup with parameter array.
Definition: parallel_gemslr.hpp:1595
int _perm_option_B_setup
Set the local B reordering option. For B part is GeMSLR is used.
Definition: gemslr.hpp:1372
int SetBLowRankFactorTopLevel(T option)
Set the B part low-rank factor on the top level. The actuall computed number of low-rank terms is ran...
Definition: parallel_gemslr.hpp:2146
VectorType _xlr2_temp_h
Temp vector.
Definition: parallel_gemslr.hpp:709
int SolveB(VectorType &x, VectorType &rhs, int option, int level)
Solve with B on a certain level.
Definition: parallel_gemslr.cpp:6072
int SetupBSolve(VectorType &x, VectorType &rhs)
Setup the solve of B matrices of the GeMSLR.
Definition: parallel_gemslr.cpp:3540
SolverClass< CsrMatrixClass< DataType >, SequentialVectorClass< DataType >, DataType > ** _B_solver
The solvers for B matrix.
Definition: parallel_gemslr.hpp:597
int SetPreconditionerOption1(int option)
Set top level preconditioner.
Definition: parallel_gemslr.hpp:2704
int SetIluComplexShift(bool complex_shift)
Set if we turn on the complex shift or not (complex version only).
Definition: parallel_gemslr.hpp:2811
The class of parallel real/complex vector.
Definition: structs.hpp:14
int SolveLevelEsmslrMul(VectorType &x_out, VectorType &rhs_in, int level, bool doperm)
Solve starting from a certain level.
std::conditional< PargemslrIsDoublePrecision< DataType >::value, double, float >::type _inner_iters_tol_setup
The default convergence_tolorance to lock the eigenvalue.
Definition: gemslr.hpp:1440
virtual long int GetNumNonzeros()
Get the total number of nonzeros the ILU.
Definition: parallel_gemslr.cpp:7219
int SetNumSubdomains(int option)
Set the global target number of subdomains on each level of GeMSLR.
Definition: parallel_gemslr.hpp:1820
VectorType _rhs_temp
The temp vector for permuted rhs.
Definition: parallel_gemslr.hpp:721
int SetLowRankThresholdA(T option)
Set max restarts of thick-restart Arnoldi on A.
Definition: parallel_gemslr.hpp:2424
int SetupPermutationND(MatrixType &A, int nlev_setup, int &nlev_max, int &nlev_used, vector_int &map_v, vector_int &mapptr_v)
Setup the Nested Dissection partition of the GeMSLR.
Definition: parallel_gemslr.cpp:2439
int SolveLevelGemslrU(VectorType &x_out, VectorType &rhs_in, int level, bool doperm)
Solve starting from a certain level.
The data structure for parallel matvec helper, store communication inforamtion for parallel matvec,...
Definition: parallel_csr_matrix.hpp:27
VectorType _sol2_temp
The temp vector for permuted x.
Definition: parallel_gemslr.hpp:727
int SetBLowRankMaxNumberIterationsTopLevel(int option)
Set B part max restarts of thick-restart Arnoldi on the top level.
Definition: parallel_gemslr.hpp:2367
bool _vertexsep_B_setup
Set to true to use vertex seperator. Note that k must be power of 2 for vertex seperator....
Definition: gemslr.hpp:1404
int _global_precond_option
The Schur complement option.
Definition: parallel_gemslr.hpp:952
int SetInnerIterationMaxNumberIterations(int option)
Set the max number of iterations of inner iteration of GeMSLR.
Definition: parallel_gemslr.hpp:1970
int MatVec(char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
In place csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
Definition: parallel_gemslr.cpp:337
int SetBPermutationOption(int option)
Set the B part permutation option. 0: No; 1: RCM; 2: AMD.
Definition: parallel_gemslr.hpp:1777
parallel_log _parlog
The parallel log data structure.
Definition: parallel_gemslr.hpp:523
ParallelGemslrLevelClass< MatrixType, VectorType, DataType > & operator=(const ParallelGemslrLevelClass< MatrixType, VectorType, DataType > &str)
The operator= of ParallelGemslrLevelClass.
Definition: parallel_gemslr.cpp:732
int Setup(int level, int option, ParallelGemslrClass< MatrixType, VectorType, DataType > &gemslr)
Set the current matrix to a certain GEMSLR level.
Definition: parallel_gemslr.cpp:308
int SetupBSolveILUK(VectorType &x, VectorType &rhs, int level)
Setup the solve of B matrices of the GeMSLR with ILUK.
Definition: parallel_gemslr.cpp:3780
int SetSolveOption(int option)
Set the solve option. 0: additive LU solve; 1: additive L solve; 2: multi-solve.
Definition: parallel_gemslr.hpp:1984
int SetPreconditionerOptionB(int option)
Set all top levels preconditioner.
Definition: parallel_gemslr.hpp:2750
int SolveLevelPslr(VectorType &x_out, VectorType &rhs_in, int level, bool doperm)
Solve starting from a certain level.
Definition: parallel_gemslr.cpp:6062
MPI_Comm GetComm() const
Get the MPI_comm.
Definition: parallel_gemslr.hpp:337
int _ncomp_B_setup
The target number of subdomians on each level in the B part if GeMSLR is used.
Definition: gemslr.hpp:1384
VectorType _rhs3_temp
The temp vector for permuted rhs for the upper level.
Definition: parallel_gemslr.hpp:745
int SetInnerIterationOption(bool option)
Set the inner iteration option of GeMSLR.
Definition: parallel_gemslr.hpp:1943
int SetPreconditionerOptionC(int option)
Set last level preconditioner.
Definition: parallel_gemslr.hpp:2783
int SetPolyOrder(int option)
Set poly order for Poly solve of the B part.
Definition: parallel_gemslr.hpp:2675
virtual ~ParallelGemslrEBFCMatrixClass()
The destructor of ParallelGemslrEBFCMatrixClass.
Definition: parallel_gemslr.cpp:32
int _lrc
The size of low-rank correction on this level.
Definition: parallel_gemslr.hpp:531
MatrixType _S_mat
The S matrix on this level.
Definition: parallel_gemslr.hpp:573
bool _ready
If the solver is ready.
Definition: solver.hpp:108
The base solver class.
Definition: solver.hpp:47
The template class complex.
Definition: complex.hpp:24
int EBFCMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = G*x = I - Ci*(Ci\x) + Ei*(UBi(LBi(Fi*(Ci\x). Note that alpha and beta are unt...
Definition: parallel_gemslr.cpp:6329
int SetLowRankA(T option)
Set the target number of low-rank terms for A.
Definition: parallel_gemslr.hpp:2206
IntVectorClass< int > _qperm
The column permutation vector.
Definition: parallel_gemslr.hpp:646
int SetLowRankArnoldiFactorTopLevel(T option)
Set the Arnoldi factor on the top level. m steps for arnoldi is rank * rank_factor * arnoldi_factor.
Definition: parallel_gemslr.hpp:2251
MatrixType _C_mat
The C matrix on this level.
Definition: parallel_gemslr.hpp:567
int _solve_option_setup
The GEMSLR options.
Definition: gemslr.hpp:1446
MatrixType _E_mat
The E matrix on this level.
Definition: parallel_gemslr.hpp:549
int SetIluResidualIters(int residual_iters)
Set the number of residual iterations of B solves in the setup phase. Set to <= 1 to turn off.
Definition: parallel_gemslr.hpp:2798
int _solve_phase_setup
Set the solve phase of the preconditioner.
Definition: gemslr.hpp:1412
int SolveLevelGemslrMul(VectorType &x_out, VectorType &rhs_in, int level, bool doperm)
Solve starting from a certain level.
Definition: parallel_gemslr.cpp:5438
int GetNumRows(int level)
Get the local number of rows on certain level for the low-rank part.
Definition: parallel_gemslr.cpp:6314
ParallelGemslrSchurSolveClass()
The constructor of precondioner class.
Definition: parallel_gemslr.hpp:362
int SetGlobalPartitionOption(bool option)
Set the global partition option of GeMSLR.
Definition: parallel_gemslr.hpp:1930
VectorType _xlr1_temp
Temp vector.
Definition: parallel_gemslr.hpp:691
int _nI
Number of interior nodes on the top level.
Definition: parallel_gemslr.hpp:579
int SetBIluMaxRowNnzB(int option)
Set the recursive GeMSLR B part maxinum number of nonzeros ILUT.
Definition: parallel_gemslr.hpp:2591
VectorType _x_temp
Temp vector, length equal to the size of this level, used to setup the Ptr for this level.
Definition: parallel_gemslr.hpp:679
int _print_option
The print option.
Definition: solver.hpp:114
Class of matvec for low-rank correction, not necessarily EB^{-1}FC^{-1}.
Definition: parallel_gemslr.hpp:35
SequentialVectorClass< DataType > _work_vector
Temp vector on this level.
Definition: parallel_gemslr.hpp:658
int SetupLowRankBuildLowRank(VectorType &x, VectorType &rhs, DenseMatrixClass< DataType > &V, DenseMatrixClass< DataType > &H, int m, int rank, int level, int option)
Given the V and H from Arnoldi, compute the final low-rank correction of S^{-1} - C^{-1}.
Definition: parallel_gemslr.cpp:4829
ParallelGemslrSchurSolveClass< MatrixType, VectorType, DataType > & operator=(ParallelGemslrSchurSolveClass< MatrixType, VectorType, DataType > &&precond)
The operator = of ParallelGemslrSchurSolveClass class.
Definition: parallel_gemslr.hpp:404
bool _enable_inner_iters_setup
The level of inner iteration. Solve Sx = b with preconditioned GMRES where GeMSLR is used as a precon...
Definition: gemslr.hpp:1425
int SetPreconditionerOption2(int option)
Set mid level preconditioner.
Definition: parallel_gemslr.hpp:2734
class pargemslr::ParallelLogClass parallel_log
The data structure for parallel computing, including data structures for MPI and CUDA.
int RAPMatVec(int level, int option, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec with the Schur Complement via RAP.
Definition: parallel_gemslr.cpp:6921
ParallelGemslrSchurSolveClass(ParallelGemslrSchurSolveClass< MatrixType, VectorType, DataType > &&precond)
The move constructor of ParallelGemslrSchurSolveClass class.
Definition: parallel_gemslr.hpp:384
int SetBLowRankFactorOtherLevels(T option)
Set the B part low-rank factor on the other levels. The actuall computed number of low-rank terms is ...
Definition: parallel_gemslr.hpp:2161
int SetupPartialILUT(VectorType &x, VectorType &rhs)
Setup the local partial ILUT.
Definition: parallel_gemslr.cpp:7827
int _work_vector_unit_length
The unit length of the work vector.
Definition: parallel_gemslr.hpp:664
int GetNumColsLocal()
Get the local number of columns of the matrix.
Definition: parallel_gemslr.cpp:162
int GetSize()
Get the size of the problem.
Definition: parallel_gemslr.cpp:7209
int SetPermutationOption(int option)
Set the global permutation option. 0: No; 1: RCM; 2: AMD.
Definition: parallel_gemslr.hpp:1762
CommunicationHelperClass _comm_helper
The communication helper.
Definition: parallel_gemslr.hpp:652
int _partition_option_B_setup
Set the partition option. For B part is GeMSLR is used.
Definition: gemslr.hpp:1366
int SetLowRankFactorA(T option)
Set the low-rank factor on A. The actuall computed number of low-rank terms is rank * factor >= rank.
Definition: parallel_gemslr.hpp:2131
int SetIluMaxRowNnzS(int option)
Set the maxinum number of nonzeros ILUT of the S part.
Definition: parallel_gemslr.hpp:2577
int Clear()
Free the current matrix.
Definition: parallel_gemslr.cpp:294
int SetLowRankMaxNumberIterationsA(int option)
Set max restarts of thick-restart Arnoldi on A.
Definition: parallel_gemslr.hpp:2353
int SetBLowRankArnoldiFactorOtherLevels(T option)
Set the B part Arnoldi factor on other levels. m steps for arnoldi is rank * rank_factor * arnoldi_fa...
Definition: parallel_gemslr.hpp:2311
int BMatVec(int level, int option, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec with the B on the current level.
Definition: parallel_gemslr.cpp:7159
int MatVec(char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
In place csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
Definition: parallel_gemslr.cpp:173
int ACMatVec(int level, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec function y = x-A*M^{-1}*x. Note that alpha and beta are untouched.
Definition: parallel_gemslr.cpp:6618
DenseMatrixClass< DataType > _cWHk
The WH matrix for the low-rank correction (W*H)*W' on the last level.
Definition: parallel_gemslr.hpp:633
int SetLowRankFactorOtherLevels(T option)
Set the low-rank factor on the other levels. The actuall computed number of low-rank terms is rank * ...
Definition: parallel_gemslr.hpp:2116
int SetLowRankMaxNumberIterationsOtherLevels(int option)
Set max restarts of thick-restart Arnoldi on other levels.
Definition: parallel_gemslr.hpp:2339
int _nlev_setup
The total number of levels user wants to have.
Definition: gemslr.hpp:1326
int _kmin_B_setup
The minimal number of subdomains user wants on each level in the recursive Kway partition in the B pa...
Definition: gemslr.hpp:1390
VectorType _sol3_temp
The temp vector for permuted x for the upper level.
Definition: parallel_gemslr.hpp:739
int SetLowRankRanksTopLevel(T option)
Set the target number of low-rank terms on the top level.
Definition: parallel_gemslr.hpp:2176
DataType _diag_shift_milu
The diagonal shift for the modified ILU.
Definition: gemslr.hpp:1458
ParallelGemslrSchurSolveClass(ParallelGemslrSchurSolveClass< MatrixType, VectorType, DataType > &precond)
The move constructor of ParallelGemslrSchurSolveClass class.
Definition: parallel_gemslr.hpp:375
int SetIluDropTolB(T option)
Set the threshold for ILUT of the B part.
Definition: parallel_gemslr.hpp:2466
MatrixType * _matrix
The matrix.
Definition: solver.hpp:72
int SetLowRankThresholdOtherLevels(T option)
Set max restarts of thick-restart Arnoldi on other levels.
Definition: parallel_gemslr.hpp:2410
int SetBLowRankRandomInitGuess(bool option)
Set if we use random initial guess for Arnoldi in the B part. Otherwise we use 1 as initial guess.
Definition: parallel_gemslr.hpp:2087
int SetLowRankRanksOtherLevels(T option)
Set the target number of low-rank terms on the other levels.
Definition: parallel_gemslr.hpp:2191
int SetBIluDropTolB(T option)
Set the recursive GeMSLR B part threshold for ILUT of the global B part.
Definition: parallel_gemslr.hpp:2522
int SetBIluMaxRowNnzC(int option)
Set the recursive GeMSLR last level maxinum number of nonzeros ILUT.
Definition: parallel_gemslr.hpp:2605
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: parallel_gemslr.cpp:7261
int SetLowRankMaxNumberIterationsTopLevel(int option)
Set max restarts of thick-restart Arnoldi on the top level.
Definition: parallel_gemslr.hpp:2325
int SetBLowRankThresholdOtherLevels(T option)
Set B part max restarts of thick-restart Arnoldi on other levels.
Definition: parallel_gemslr.hpp:2452
int SetNumLevels(int option)
Set the global target number of levels of GeMSLR.
Definition: parallel_gemslr.hpp:1792
int Setup(int level, int option, ParallelGemslrClass< MatrixType, VectorType, DataType > &gemslr)
Set the current matrix to a certain GEMSLR level.
Definition: parallel_gemslr.cpp:116
int _kmin_setup
The minimal number of subdomains user wants on each level in the recursive Kway partition.
Definition: gemslr.hpp:1338
virtual long int GetNumNonzeros()
Get the total number of nonzeros the preconditioner.
Definition: parallel_gemslr.hpp:470
MPI_Comm GetComm() const
Get the MPI_comm.
Definition: parallel_gemslr.hpp:173
int _ncomps
Number of subdomains on this level.
Definition: parallel_gemslr.hpp:537
bool _global_partition_setup
Set to true to use vertex seperator. Note that k must be power of 2 for vertex seperator.
Definition: gemslr.hpp:1358
int SetBLowRankMaxNumberIterationsOtherLevels(int option)
Set B part max restarts of thick-restart Arnoldi on other levels.
Definition: parallel_gemslr.hpp:2381
int SetBNumSubdomains(int option)
Set the B part target number of subdomains on each level of GeMSLR.
Definition: parallel_gemslr.hpp:1834
int SetIluMaxRowNnzB(int option)
Set the maxinum number of nonzeros for ILUT of the B part.
Definition: parallel_gemslr.hpp:2549
ParallelGemslrSchurSolveClass< MatrixType, VectorType, DataType > & operator=(const ParallelGemslrSchurSolveClass< MatrixType, VectorType, DataType > &precond)
The operator = of ParallelGemslrSchurSolveClass class.
Definition: parallel_gemslr.hpp:393
int Solve(VectorType &x, VectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: parallel_gemslr.cpp:368
int GetNumNonzeros(long int &nnz_bsolver, long int &nnz_lr)
Get the number of nonzeros in the low-rank correction and the ILU factorization on this level.
Definition: parallel_gemslr.cpp:1020
int _kfactor_B_setup
In the recursive Kway partition, from the second level, each time the number of terget subdomains is ...
Definition: gemslr.hpp:1398
int SetBIluFillLevelB(int option)
Set the fill level for ILUK of the B part.
Definition: parallel_gemslr.hpp:2647
int SetBLowRankOptionTopLevel(int option)
Set the B part low-rank option on the top level. 0: Standard. 1: Thick-restart.
Definition: parallel_gemslr.hpp:2044
int SetBNumberSubdomainsReduceFactor(int option)
Set the B part reduce factor of subdomains on each level of GeMSLR.
Definition: parallel_gemslr.hpp:1890
int _partition_option_setup
Set the partition option.
Definition: gemslr.hpp:1312
DenseMatrixClass< DataType > _cWk
The W matrix for the low-rank correction W*H*W' on the last level.
Definition: parallel_gemslr.hpp:627
int SolveLevelGemslr(VectorType &x_out, VectorType &rhs_in, int level, bool doperm)
Solve starting from a certain level.
Definition: parallel_gemslr.cpp:5185
The local real ilu preconditioner, only work for sequential CSR matrix.
Definition: parallel_gemslr.hpp:26
virtual int SetWithParameterArray(double *params)
Setup with parameter array.
Definition: parallel_gemslr.hpp:496
int SetupLowRank(VectorType &x, VectorType &rhs)
Setup the low-rank part of the GeMSLR.
Definition: parallel_gemslr.cpp:3902
VectorType _xlr_temp
Temp vector.
Definition: parallel_gemslr.hpp:685
int SetBPolyOrder(int option)
Set poly order for Poly solve of the B part of the recursive GeMSLR.
Definition: parallel_gemslr.hpp:2689
DenseMatrixClass< DataType > _WHk
The WH matrix for the low-rank correction (W*H)*W' on this level.
Definition: parallel_gemslr.hpp:615
VectorType _temp_v
Temp vector for the Arnoldi.
Definition: parallel_gemslr.hpp:65
DenseMatrixClass< DataType > _Hk
The H matrix for the low-rank correction W*H*W' on this level.
Definition: parallel_gemslr.hpp:603
int Clear()
Free the current level structure, set everything to 0.
Definition: parallel_gemslr.cpp:947
int _ncomp_setup
The target number of subdomians on each level.
Definition: gemslr.hpp:1332
int SetBPartitionOption(int option)
Set the B part partition option. 0: ND; 1: RKway.
Definition: parallel_gemslr.hpp:1747
std::vector< ParallelGemslrLevelClass< MatrixType, VectorType, DataType > > _levs_v
Vector holding the level struct for all levels starting from the second level. The size of this vecto...
Definition: parallel_gemslr.hpp:968
int SetMinimalNumberSubdomains(int option)
Set the global minimal number of subdomains on each level of GeMSLR.
Definition: parallel_gemslr.hpp:1848
SolverClass< MatrixType, VectorType, DataType > & operator=(const SolverClass< MatrixType, VectorType, DataType > &solver)
The = operator of solver class.
Definition: solver.hpp:210
Class of schur matvec.
Definition: parallel_gemslr.hpp:355
int SetLowRankOptionOtherLevels(int option)
Set the low-rank option on other levels. 0: Standard. 1: Thick-restart.
Definition: parallel_gemslr.hpp:2014
MatrixType _F_mat
The F matrix on this level.
Definition: parallel_gemslr.hpp:555
int SetBIluFillLevelC(int option)
Set the fill level for ILUK of the last level.
Definition: parallel_gemslr.hpp:2661
int SchurMatVec(int level, int option, char trans, const DataType &alpha, VectorType &x, const DataType &beta, VectorType &y)
The matvec with the Schur Complement.
Definition: parallel_gemslr.cpp:6808
int SetupLowRankSubspaceIteration(VectorType &x, VectorType &rhs, int level, int option)
Setup the low-rank part of the GeMSLR with subspace iteration.
Definition: parallel_gemslr.cpp:4269
int SetIluDropTolC(T option)
Set the threshold for ILUT of the last level.
Definition: parallel_gemslr.hpp:2480
virtual int Setup(VectorType &x, VectorType &rhs)
Setup the precondioner phase. Will be called by the solver if not called directly.
Definition: parallel_gemslr.cpp:1577
virtual ~ParallelGemslrSchurSolveClass()
The destructor of precondioner class.
Definition: parallel_gemslr.hpp:415
int SetupBSolveILUT(VectorType &x, VectorType &rhs, int level)
Setup the solve of B matrices of the GeMSLR with ILUT.
Definition: parallel_gemslr.cpp:3704
virtual int Clear()
Free the current solver.
Definition: solver.hpp:264
virtual int Setup(VectorType &x, VectorType &rhs)
Setup the precondioner phase. Will be called by the solver if not called directly.
Definition: parallel_gemslr.hpp:424