Skip to content

Commit

Permalink
Merge branch 'develop' into kksptrsv-new-cusparse-api
Browse files Browse the repository at this point in the history
  • Loading branch information
vqd8a committed Nov 11, 2022
2 parents 6080423 + 94306b6 commit 418d35c
Show file tree
Hide file tree
Showing 169 changed files with 1,252 additions and 1,114 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ documentation of each package.

We appreciate your willingness to contribute to the Trilinos project. Please
familiarize yourself with our [contributing
guidelines](https://github.com/trilinos/Trilinos/blob/master/CONTRIBUTING.md)
.
guidelines](https://github.com/trilinos/Trilinos/blob/master/CONTRIBUTING.md).
5 changes: 5 additions & 0 deletions packages/ifpack2/doc/UsersGuide/options.tex
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ \section{Chebyshev}\label{s:Chebyshev}
{bool}
{\false}
{The \texttt{apply} call will optionally return the norm of the residual.}
\ccc{chebyshev: compute spectral radius}
{bool}
{\true}
{The power method will compute the spectral radius if true. If false, it will
instead compute the dominant eigenvalue (these differ by absolute value).}
\ccc{eigen-analysis: type}
{string}
{"power-method"}
Expand Down
6 changes: 6 additions & 0 deletions packages/ifpack2/src/Ifpack2_Details_Chebyshev_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ class Chebyshev : public Teuchos::Describable {
/// always use the zero vector(s) as the initial guess(es). If
/// false, then apply() will use X on input as the initial
/// guess(es).
/// - "chebyshev: compute spectral radius" (\c bool): If true, the
/// power method will compute the spectral radius of the operator.
/// If false, it will compute the dominant eigenvalue.
///
/// Parameters that govern backwards compatibility:
/// - "chebyshev: textbook algorithm" (\c bool): If true, use the
Expand Down Expand Up @@ -509,6 +512,9 @@ class Chebyshev : public Teuchos::Describable {
//! Whether apply() will compute and return the max residual norm.
bool computeMaxResNorm_;

//! Whether the power method will compute the spectral radius or the dominant eigenvalue.
bool computeSpectralRadius_;

/// If true, the ChebyshevKernel operator will not to use a fused kernel
/// and insead use native blas/SpMV operators
bool ckUseNativeSpMV_;
Expand Down
11 changes: 10 additions & 1 deletion packages/ifpack2/src/Ifpack2_Details_Chebyshev_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ Chebyshev (Teuchos::RCP<const row_matrix_type> A) :
assumeMatrixUnchanged_ (false),
textbookAlgorithm_ (false),
computeMaxResNorm_ (false),
computeSpectralRadius_(true),
ckUseNativeSpMV_(false),
debug_ (false)
{
Expand Down Expand Up @@ -338,6 +339,7 @@ Chebyshev (Teuchos::RCP<const row_matrix_type> A,
assumeMatrixUnchanged_ (false),
textbookAlgorithm_ (false),
computeMaxResNorm_ (false),
computeSpectralRadius_(true),
ckUseNativeSpMV_(false),
debug_ (false)
{
Expand Down Expand Up @@ -384,6 +386,7 @@ setParameters (Teuchos::ParameterList& plist)
const bool defaultAssumeMatrixUnchanged = false;
const bool defaultTextbookAlgorithm = false;
const bool defaultComputeMaxResNorm = false;
const bool defaultComputeSpectralRadius = true;
const bool defaultCkUseNativeSpMV = false;
const bool defaultDebug = false;

Expand All @@ -406,6 +409,7 @@ setParameters (Teuchos::ParameterList& plist)
bool assumeMatrixUnchanged = defaultAssumeMatrixUnchanged;
bool textbookAlgorithm = defaultTextbookAlgorithm;
bool computeMaxResNorm = defaultComputeMaxResNorm;
bool computeSpectralRadius = defaultComputeSpectralRadius;
bool ckUseNativeSpMV = defaultCkUseNativeSpMV;
bool debug = defaultDebug;

Expand Down Expand Up @@ -640,6 +644,9 @@ setParameters (Teuchos::ParameterList& plist)
if (plist.isParameter ("chebyshev: compute max residual norm")) {
computeMaxResNorm = plist.get<bool> ("chebyshev: compute max residual norm");
}
if (plist.isParameter ("chebyshev: compute spectral radius")) {
computeSpectralRadius = plist.get<bool> ("chebyshev: compute spectral radius");
}

// Test for Ifpack parameters that we won't ever implement here.
// Be careful to use the one-argument version of get(), since the
Expand Down Expand Up @@ -694,6 +701,7 @@ setParameters (Teuchos::ParameterList& plist)
assumeMatrixUnchanged_ = assumeMatrixUnchanged;
textbookAlgorithm_ = textbookAlgorithm;
computeMaxResNorm_ = computeMaxResNorm;
computeSpectralRadius_ = computeSpectralRadius;
ckUseNativeSpMV_ = ckUseNativeSpMV;
debug_ = debug;

Expand Down Expand Up @@ -895,7 +903,8 @@ Chebyshev<ScalarType, MV>::compute ()

Teuchos::RCP<Teuchos::FancyOStream> stream = (debug_ ? out_ : Teuchos::null);
computedLambdaMax = PowerMethod::powerMethodWithInitGuess (*A_, *D_, eigMaxIters_, x, y,
eigRelTolerance_, eigNormalizationFreq_, stream);
eigRelTolerance_, eigNormalizationFreq_, stream,
computeSpectralRadius_);
}
else
computedLambdaMax = cgMethod (*A_, *D_, eigMaxIters_);
Expand Down
Loading

0 comments on commit 418d35c

Please sign in to comment.