diff --git a/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp b/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp index da3fec8fdcad..0fd850e5033b 100644 --- a/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp +++ b/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp @@ -1353,14 +1353,17 @@ namespace MueLu { TEUCHOS_TEST_FOR_EXCEPTION(partName != "zoltan" && partName != "zoltan2", Exceptions::InvalidArgument, "Invalid partitioner name: \"" << partName << "\". Valid options: \"zoltan\", \"zoltan2\""); - bool switched = false; - (void)switched; #ifndef HAVE_MUELU_ZOLTAN + bool switched = false; if (partName == "zoltan") { this->GetOStream(Warnings0) << "Zoltan interface is not available, trying to switch to Zoltan2" << std::endl; partName = "zoltan2"; switched = true; } +#else +# ifndef HAVE_MUELU_ZOLTAN + bool switched = false; +# endif #endif #ifndef HAVE_MUELU_ZOLTAN2 if (partName == "zoltan2" && !switched) { diff --git a/packages/muelu/test/scaling/DriverCore.hpp b/packages/muelu/test/scaling/DriverCore.hpp index 112c5f61dac3..745b93b7a323 100644 --- a/packages/muelu/test/scaling/DriverCore.hpp +++ b/packages/muelu/test/scaling/DriverCore.hpp @@ -223,6 +223,40 @@ void PreconditionerSetup(Teuchos::RCP +struct Matvec_Wrapper{ + static void UnwrapEpetra(Teuchos::RCP >& A, + Teuchos::RCP >& X, + Teuchos::RCP >& B, + Teuchos::RCP& Aepetra, + Teuchos::RCP& Xepetra, + Teuchos::RCP& Bepetra) { + throw std::runtime_error("Template parameter mismatch"); + } +}; + + +template +struct Matvec_Wrapper { + static void UnwrapEpetra(Teuchos::RCP >& A, + Teuchos::RCP >& X, + Teuchos::RCP >& B, + Teuchos::RCP& Aepetra, + Teuchos::RCP& Xepetra, + Teuchos::RCP& Bepetra) { + typedef double SC; + typedef int LO; + typedef GlobalOrdinal GO; + typedef Kokkos::Compat::KokkosSerialWrapperNode NO; + Aepetra = Xpetra::Helpers::Op2EpetraCrs(A); + Xepetra = Teuchos::rcp(& Xpetra::toEpetra(*X),false); + Bepetra = Teuchos::rcp(& Xpetra::toEpetra(*B),false); + } +}; +#endif //************************************************************************************* template @@ -271,13 +305,11 @@ void SystemSolve(Teuchos::RCP Aepetra; Teuchos::RCP Xepetra,Bepetra; if(lib==Xpetra::UseEpetra) { - Aepetra = Xpetra::Helpers::Op2EpetraCrs(A); - Xepetra = rcp(& Xpetra::toEpetra(*X),false); - Bepetra = rcp(& Xpetra::toEpetra(*B),false); + Matvec_Wrapper::UnwrapEpetra(A,X,B,Aepetra,Xepetra,Bepetra); } #endif diff --git a/packages/xpetra/sup/Utils/Xpetra_MatrixUtils.hpp b/packages/xpetra/sup/Utils/Xpetra_MatrixUtils.hpp index 922c36611d75..3df758169343 100644 --- a/packages/xpetra/sup/Utils/Xpetra_MatrixUtils.hpp +++ b/packages/xpetra/sup/Utils/Xpetra_MatrixUtils.hpp @@ -453,7 +453,7 @@ class MatrixUtils { Ac->getLocalDiagCopy(*diagVec); LocalOrdinal lZeroDiags = 0; - Teuchos::ArrayRCP< Scalar > diagVal = diagVec->getDataNonConst(0); + Teuchos::ArrayRCP< const Scalar > diagVal = diagVec->getData(0); for (size_t i = 0; i < rowMap->getNodeNumElements(); i++) { if (TST::magnitude(diagVal[i]) <= threshold) { @@ -521,7 +521,7 @@ class MatrixUtils { #ifdef HAVE_XPETRA_DEBUG // only for debugging // check whether Ac has been repaired... Ac->getLocalDiagCopy(*diagVec); - Teuchos::ArrayRCP< Scalar > diagVal2 = diagVec->getDataNonConst(0); + diagVal = diagVec->getData(0); for (size_t r = 0; r < Ac->getRowMap()->getNodeNumElements(); r++) { if (TST::magnitude(diagVal[r]) <= threshold) { fos << "Error: there are too small entries left on diagonal after repair..." << std::endl;