Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge trilinos/develop into e3sm-project/develop #100

Merged
merged 24 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6b6bc03
Panzer: improve setup times for vector basis mass matrices
rppawlo Feb 14, 2024
5514e6b
Panzer: fix empty eblock case
rppawlo Feb 16, 2024
ffdc6a5
Adding iostream include statement to source file
seanofthemillers Feb 16, 2024
8d81725
Panzer: cleanup formatting, no functional changes
rppawlo Feb 16, 2024
4ae003e
amesos2 : remove dependency to disable tacho interface on cuda/hip
iyamazaki Feb 17, 2024
d3c9e1e
Xpetra: Derive RowMatrix from Operator
cgcgcg Feb 16, 2024
b1dedc4
MueLu Utilities: Handle RowMatrix in Op2*TpetraRow
cgcgcg Feb 18, 2024
89f26b3
MueLu Ifpack2: Fix inefficiency in Hiptmair with Chebyshev sub-smoothers
cgcgcg Feb 18, 2024
1f2cc31
MueLu: Fix bad SubFactoryMonitors
cgcgcg Feb 19, 2024
f43dfac
MueLu Ifpack2 Chebyshev: Enable use with Operator
cgcgcg Feb 19, 2024
69f24ea
MueLu SaPFactory_kokkos: Add missing features from SaPFactory
cgcgcg Feb 13, 2024
7deabed
MueLu SaPFactory_kokkos: Add constraints methods from SaPFactory
cgcgcg Feb 13, 2024
052ad9a
Piro: Fix ProductModelEvaluator (#12749)
mperego Feb 19, 2024
085df59
Merge Pull Request #12754 from rppawlo/Trilinos/panzer-vector-basis-m…
trilinos-autotester Feb 19, 2024
e67ebaa
FROSch: Propagate Xpetra changes
cgcgcg Feb 19, 2024
ab9128a
Tpetra: Error out for COMPLEX_FLOAT=ON, FLOAT=OFF
cgcgcg Feb 19, 2024
922e859
Merge pull request #12747 from seanofthemillers/iostream_fix_for_kk_e…
ndellingwood Feb 19, 2024
398f1ad
Merge Pull Request #12755 from cgcgcg/Trilinos/complexFloatFix
trilinos-autotester Feb 19, 2024
7c3e3b4
Merge Pull Request #12753 from cgcgcg/Trilinos/mueluFixes
trilinos-autotester Feb 19, 2024
3c8ea87
MueLu: Merge SaPFactory_kokkos and SaPFactory
cgcgcg Feb 13, 2024
ea3d582
MueLu: Rebase gold files
cgcgcg Feb 13, 2024
8ec2714
Merge Pull Request #12740 from cgcgcg/Trilinos/refactorNullspaceFactory
trilinos-autotester Feb 19, 2024
b86d7c2
Merge pull request #12752 from iyamazaki/amesos2-tacho
iyamazaki Feb 20, 2024
daedb36
Merge remote-tracking branch 'upstream/develop' into develop
bartgol Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/amesos2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ TRIBITS_ADD_OPTION_AND_DEFINE(${PACKAGE_NAME}_ENABLE_KLU2
ON
)

IF (Kokkos_ENABLE_CUDA OR Kokkos_ENABLE_HIP)
tribits_disable_optional_dependency(ShyLU_NodeTacho "NOTE: Disabling ${PACKAGE_NAME}_ENABLE_ShyLU_NodeTacho because CUDA or HIP is enabled in Kokkos")
ENDIF()

TRIBITS_ADD_OPTION_AND_DEFINE(${PACKAGE_NAME}_ENABLE_Basker
HAVE_AMESOS2_BASKER
"Enable Basker in Amesos2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//@HEADER

#include <sstream>
#include <iostream>

#include "Kokkos_Core.hpp"

Expand Down
8 changes: 4 additions & 4 deletions packages/muelu/adapters/stratimikos/Xpetra_ThyraLinearOp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ class XpetraThyraLinearOp : public Xpetra::Operator<Scalar, LocalOrdinal, Global
//@}

//! Returns the Tpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getDomainMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getDomainMap() const {
throw Exceptions::RuntimeError("Interface not supported");
}

// //! Returns the Tpetra::Map object associated with the range of this operator.
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getRangeMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getRangeMap() const {
throw Exceptions::RuntimeError("Interface not supported");
}

Expand Down Expand Up @@ -171,12 +171,12 @@ class XpetraThyraLinearOp<double, LocalOrdinal, GlobalOrdinal, Node> : public Xp
//@}

//! Returns the Tpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getDomainMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getDomainMap() const {
return A_->getDomainMap();
}

// //! Returns the Tpetra::Map object associated with the range of this operator.
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getRangeMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> getRangeMap() const {
return A_->getRangeMap();
}

Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Interface/MueLu_FactoryFactory_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
#include "MueLu_GeometricInterpolationPFactory_kokkos.hpp"
#ifdef HAVE_MUELU_DEPRECATED_CODE
#include "MueLu_NullspaceFactory_kokkos.hpp"
#endif
#include "MueLu_SaPFactory_kokkos.hpp"
#endif
#include "MueLu_SemiCoarsenPFactory_kokkos.hpp"
#include "MueLu_StructuredAggregationFactory_kokkos.hpp"
#include "MueLu_TentativePFactory_kokkos.hpp"
Expand Down Expand Up @@ -308,8 +308,8 @@ class FactoryFactory : public BaseClass {
if (factoryName == "GeometricInterpolationPFactory_kokkos") return Build2<GeometricInterpolationPFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
#ifdef HAVE_MUELU_DEPRECATED_CODE
if (factoryName == "NullspaceFactory_kokkos") return Build2<NullspaceFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
#endif
if (factoryName == "SaPFactory_kokkos") return Build2<SaPFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
#endif
if (factoryName == "SemiCoarsenPFactory_kokkos") return Build2<SemiCoarsenPFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
if (factoryName == "StructuredAggregationFactory_kokkos") return Build2<StructuredAggregationFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
if (factoryName == "TentativePFactory_kokkos") return Build2<TentativePFactory_kokkos>(paramList, factoryMapIn, factoryManagersIn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@

#include "MueLu_CoalesceDropFactory_kokkos.hpp"
// #include "MueLu_CoordinatesTransferFactory_kokkos.hpp"
#include "MueLu_SaPFactory_kokkos.hpp"
#include "MueLu_TentativePFactory_kokkos.hpp"

#if defined(HAVE_MUELU_ISORROPIA) && defined(HAVE_MPI)
Expand Down Expand Up @@ -290,11 +289,7 @@ void MLParameterListInterpreter<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetP
RFact = rcp(new TransPFactory());
} else if (agg_damping != 0.0 && bEnergyMinimization == false) {
// smoothed aggregation (SA-AMG)
RCP<Factory> SaPFact;
if (useKokkosRefactor)
SaPFact = rcp(new SaPFactory_kokkos());
else
SaPFact = rcp(new SaPFactory());
RCP<Factory> SaPFact = rcp(new SaPFactory());
SaPFact->SetParameter("sa: damping factor", ParameterEntry(agg_damping));
PFact = SaPFact;
RFact = rcp(new TransPFactory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
#endif

#include "MueLu_CoalesceDropFactory_kokkos_fwd.hpp"
#include "MueLu_SaPFactory_kokkos_fwd.hpp"
#include "MueLu_SemiCoarsenPFactory_kokkos_fwd.hpp"
#include "MueLu_TentativePFactory_kokkos_fwd.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
#include "MueLu_LowPrecisionFactory.hpp"

#include "MueLu_CoalesceDropFactory_kokkos.hpp"
#include "MueLu_SaPFactory_kokkos.hpp"
#include "MueLu_SemiCoarsenPFactory_kokkos.hpp"
#include "MueLu_TentativePFactory_kokkos.hpp"

Expand Down Expand Up @@ -1940,7 +1939,7 @@ template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
void ParameterListInterpreter<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
UpdateFactoryManager_SA(ParameterList& paramList, const ParameterList& defaultList, FactoryManager& manager, int /* levelID */, std::vector<keep_pair>& keeps) const {
// Smoothed aggregation
MUELU_KOKKOS_FACTORY(P, SaPFactory, SaPFactory_kokkos);
RCP<Factory> P = rcp(new SaPFactory());
ParameterList Pparams;
if (paramList.isSublist("matrixmatrix: kernel params"))
Pparams.sublist("matrixmatrix: kernel params", false) = paramList.sublist("matrixmatrix: kernel params");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
#include "MueLu_InterfaceAggregationFactory_fwd.hpp"

#include "MueLu_CoalesceDropFactory_kokkos_fwd.hpp"
#include "MueLu_SaPFactory_kokkos_fwd.hpp"
#include "MueLu_TentativePFactory_kokkos_fwd.hpp"

namespace MueLu {
Expand Down
7 changes: 1 addition & 6 deletions packages/muelu/src/MueCentral/MueLu_FactoryManager_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
#include "MueLu_InverseApproximationFactory.hpp"

#include "MueLu_CoalesceDropFactory_kokkos.hpp"
#include "MueLu_SaPFactory_kokkos.hpp"
#include "MueLu_TentativePFactory_kokkos.hpp"

#include "MueLu_FactoryManager_decl.hpp"
Expand Down Expand Up @@ -130,11 +129,7 @@ const RCP<const FactoryBase> FactoryManager<Scalar, LocalOrdinal, GlobalOrdinal,
if (varName == "Ptent") return MUELU_KOKKOS_FACTORY(varName, TentativePFactory, TentativePFactory_kokkos);
if (varName == "P") {
// GetFactory("Ptent"): we need to use the same factory instance for both "P" and "Nullspace"
RCP<Factory> factory;
if (useKokkos_)
factory = rcp(new SaPFactory_kokkos());
else
factory = rcp(new SaPFactory());
RCP<Factory> factory = rcp(new SaPFactory());
factory->SetFactory("P", GetFactory("Ptent"));
return SetAndReturnDefaultFactory(varName, factory);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Operators/MueLu_Maxwell1_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ class Maxwell1 : public VerboseObject, public Xpetra::Operator<Scalar, LocalOrdi
virtual ~Maxwell1() {}

//! Returns the Xpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const Map> getDomainMap() const;
const Teuchos::RCP<const Map> getDomainMap() const;

//! Returns the Xpetra::Map object associated with the range of this operator.
Teuchos::RCP<const Map> getRangeMap() const;
const Teuchos::RCP<const Map> getRangeMap() const;

//! Returns Jacobian matrix SM
const Teuchos::RCP<Matrix>& getJacobian() const {
Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Operators/MueLu_Maxwell1_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
namespace MueLu {

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Maxwell1<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDomainMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Maxwell1<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDomainMap() const {
return SM_Matrix_->getDomainMap();
}

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Maxwell1<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getRangeMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > Maxwell1<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getRangeMap() const {
return SM_Matrix_->getRangeMap();
}

Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Operators/MueLu_MultiPhys_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ class MultiPhys : public VerboseObject, public Xpetra::Operator<Scalar, LocalOrd
virtual ~MultiPhys() {}

//! Returns the Xpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const Map> getDomainMap() const;
const Teuchos::RCP<const Map> getDomainMap() const;

//! Returns the Xpetra::Map object associated with the range of this operator.
Teuchos::RCP<const Map> getRangeMap() const;
const Teuchos::RCP<const Map> getRangeMap() const;

//! Set parameters
void setParameters(Teuchos::ParameterList& list);
Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Operators/MueLu_MultiPhys_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@
namespace MueLu {

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> MultiPhys<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDomainMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> MultiPhys<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDomainMap() const {
return AmatMultiphysics_->getDomainMap();
}

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> MultiPhys<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getRangeMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> MultiPhys<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getRangeMap() const {
return AmatMultiphysics_->getRangeMap();
}

Expand Down
5 changes: 2 additions & 3 deletions packages/muelu/src/Operators/MueLu_RefMaxwell_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

#include "MueLu_CoalesceDropFactory_kokkos_fwd.hpp"
#include "MueLu_TentativePFactory_kokkos_fwd.hpp"
#include "MueLu_SaPFactory_kokkos_fwd.hpp"

#include "MueLu_ZoltanInterface_fwd.hpp"
#include "MueLu_Zoltan2Interface_fwd.hpp"
Expand Down Expand Up @@ -424,10 +423,10 @@ class RefMaxwell : public VerboseObject, public Xpetra::Operator<Scalar, LocalOr
virtual ~RefMaxwell() {}

//! Returns the Xpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const Map> getDomainMap() const;
const Teuchos::RCP<const Map> getDomainMap() const;

//! Returns the Xpetra::Map object associated with the range of this operator.
Teuchos::RCP<const Map> getRangeMap() const;
const Teuchos::RCP<const Map> getRangeMap() const;

//! Returns Jacobian matrix SM
const Teuchos::RCP<Matrix> &getJacobian() const {
Expand Down
11 changes: 4 additions & 7 deletions packages/muelu/src/Operators/MueLu_RefMaxwell_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

#include "MueLu_CoalesceDropFactory_kokkos.hpp"
#include "MueLu_TentativePFactory_kokkos.hpp"
#include "MueLu_SaPFactory_kokkos.hpp"
#include <Kokkos_Core.hpp>
#include <KokkosSparse_CrsMatrix.hpp>

Expand Down Expand Up @@ -122,12 +121,12 @@ Matrix2CrsMatrix(Teuchos::RCP<Xpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdi
}

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > RefMaxwell<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDomainMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > RefMaxwell<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDomainMap() const {
return SM_Matrix_->getDomainMap();
}

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > RefMaxwell<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getRangeMap() const {
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > RefMaxwell<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getRangeMap() const {
return SM_Matrix_->getRangeMap();
}

Expand Down Expand Up @@ -1752,14 +1751,12 @@ void RefMaxwell<Scalar, LocalOrdinal, GlobalOrdinal, Node>::buildNodalProlongato
if (useKokkos_) {
dropFact = rcp(new CoalesceDropFactory_kokkos());
TentativePFact = rcp(new TentativePFactory_kokkos());
if (algo == "sa")
SaPFact = rcp(new SaPFactory_kokkos());
} else {
dropFact = rcp(new CoalesceDropFactory());
TentativePFact = rcp(new TentativePFactory());
if (algo == "sa")
SaPFact = rcp(new SaPFactory());
}
if (algo == "sa")
SaPFact = rcp(new SaPFactory());
dropFact->SetFactory("UnAmalgamationInfo", amalgFact);

double dropTol = parameterList_.get<double>("aggregation: drop tol");
Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Operators/MueLu_XpetraOperator_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class XpetraOperator : public Xpetra::Operator<Scalar, LocalOrdinal, GlobalOrdin
//@}

//! Returns the Tpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > getDomainMap() const;
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > getDomainMap() const;

//! Returns the Tpetra::Map object associated with the range of this operator.
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > getRangeMap() const;
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > getRangeMap() const;

//! Returns in Y the result of a Xpetra::Operator applied to a Xpetra::MultiVector X.
/*!
Expand Down
4 changes: 2 additions & 2 deletions packages/muelu/src/Operators/MueLu_XpetraOperator_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
namespace MueLu {

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
XpetraOperator<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
getDomainMap() const {
typedef Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> Matrix;
Expand All @@ -61,7 +61,7 @@ XpetraOperator<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
}

template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
const Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
XpetraOperator<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
getRangeMap() const {
typedef Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> Matrix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void RebalanceTransferFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(

RCP<const Import> newImporter;
{
SubFactoryMonitor(*this, "Import construction", coarseLevel);
SubFactoryMonitor subM2(*this, "Import construction", coarseLevel);
newImporter = ImportFactory::Build(importer->getTargetMap(), rebalancedP->getColMap());
}
rebalancedP2->replaceDomainMapAndImporter(importer->getTargetMap(), newImporter);
Expand Down
29 changes: 15 additions & 14 deletions packages/muelu/src/Smoothers/MueLu_Ifpack2Smoother_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,14 +717,14 @@ void Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetupChebyshev(
prec_ = Ifpack2::Factory::create(type_, tA, overlap_);
SetPrecParameters();
{
SubFactoryMonitor(*this, "Preconditioner init", currentLevel);
SubFactoryMonitor m(*this, "Preconditioner init", currentLevel);
prec_->initialize();
}
} else
SetPrecParameters();

{
SubFactoryMonitor(*this, "Preconditioner compute", currentLevel);
SubFactoryMonitor m(*this, "Preconditioner compute", currentLevel);
prec_->compute();
}

Expand Down Expand Up @@ -782,7 +782,7 @@ void Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetupHiptmair(L
}
if (smoother2 == "CHEBYSHEV") {
ParameterList& list2 = paramList.sublist("hiptmair: smoother list 2");
SetupChebyshevEigenvalues(currentLevel, "A", "EdgeMatrix ", list2);
SetupChebyshevEigenvalues(currentLevel, "NodeMatrix", "NodeMatrix ", list2);
}

// FIXME: Should really add some checks to make sure the eigenvalue calcs worked like in
Expand Down Expand Up @@ -830,9 +830,10 @@ template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Scalar Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetupChebyshevEigenvalues(Level& currentLevel, const std::string& matrixName, const std::string& label, ParameterList& paramList) const {
// Helper: This gets used for smoothers that want to set up Chebyhev
typedef Teuchos::ScalarTraits<SC> STS;
SC negone = -STS::one();
RCP<const Matrix> currentA = currentLevel.Get<RCP<Matrix>>(matrixName);
SC lambdaMax = negone;
SC negone = -STS::one();
RCP<Operator> currentA = currentLevel.Get<RCP<Operator>>(matrixName);
RCP<Matrix> matA = rcp_dynamic_cast<Matrix>(currentA);
SC lambdaMax = negone;

std::string maxEigString = "chebyshev: max eigenvalue";
std::string eigRatioString = "chebyshev: ratio eigenvalue";
Expand All @@ -844,12 +845,11 @@ Scalar Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetupChebyshe
else
lambdaMax = paramList.get<SC>(maxEigString);
this->GetOStream(Statistics1) << label << maxEigString << " (cached with smoother parameter list) = " << lambdaMax << std::endl;
RCP<Matrix> matA = rcp_dynamic_cast<Matrix>(A_);
if (!matA.is_null())
matA->SetMaxEigenvalueEstimate(lambdaMax);

} else {
lambdaMax = currentA->GetMaxEigenvalueEstimate();
} else if (!matA.is_null()) {
lambdaMax = matA->GetMaxEigenvalueEstimate();
if (lambdaMax != negone) {
this->GetOStream(Statistics1) << label << maxEigString << " (cached with matrix) = " << lambdaMax << std::endl;
paramList.set(maxEigString, lambdaMax);
Expand All @@ -871,11 +871,11 @@ Scalar Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetupChebyshe
// ratio = max(number of fine DOFs / number of coarse DOFs, defaultValue)
//
// NOTE: We don't need to request previous level matrix as we know for sure it was constructed
RCP<const Matrix> fineA = currentLevel.GetPreviousLevel()->Get<RCP<Matrix>>(matrixName);
size_t nRowsFine = fineA->getGlobalNumRows();
size_t nRowsCoarse = currentA->getGlobalNumRows();
RCP<const Operator> fineA = currentLevel.GetPreviousLevel()->Get<RCP<Operator>>(matrixName);
size_t nRowsFine = fineA->getDomainMap()->getGlobalNumElements();
size_t nRowsCoarse = currentA->getDomainMap()->getGlobalNumElements();

SC levelRatio = as<SC>(as<float>(nRowsFine) / nRowsCoarse);
SC levelRatio = as<SC>(as<double>(nRowsFine) / nRowsCoarse);
if (STS::magnitude(levelRatio) > STS::magnitude(ratio))
ratio = levelRatio;
}
Expand Down Expand Up @@ -913,8 +913,9 @@ Scalar Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::SetupChebyshe
paramList.remove(paramName);
}
if (doScale) {
TEUCHOS_ASSERT(!matA.is_null());
const bool doReciprocal = true;
RCP<Vector> lumpedDiagonal = Utilities::GetLumpedMatrixDiagonal(*currentA, doReciprocal, chebyReplaceTol, chebyReplaceVal, chebyReplaceSingleEntryRowWithZero, useAverageAbsDiagVal);
RCP<Vector> lumpedDiagonal = Utilities::GetLumpedMatrixDiagonal(*matA, doReciprocal, chebyReplaceTol, chebyReplaceVal, chebyReplaceSingleEntryRowWithZero, useAverageAbsDiagVal);
const Xpetra::TpetraVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& tmpVec = dynamic_cast<const Xpetra::TpetraVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>&>(*lumpedDiagonal);
paramList.set("chebyshev: operator inv diagonal", tmpVec.getTpetra_Vector());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ class MatrixFreeTentativeP : public Xpetra::Operator<Scalar, LocalOrdinal, Globa
void residual(const MultiVector &X, const MultiVector &B, MultiVector &R) const override;

// get the range map
Teuchos::RCP<const Map> getRangeMap() const override {
const Teuchos::RCP<const Map> getRangeMap() const override {
return fine_map_;
}

// get the domain map
Teuchos::RCP<const Map> getDomainMap() const override {
const Teuchos::RCP<const Map> getDomainMap() const override {
return coarse_map_;
}

Expand Down
Loading
Loading