Ifpack2: Hypre interface and ordinal type matching - #15090
Conversation
|
CDash for AT2 results [Currently only accessible from Sandia networks] |
ef0637a to
61d37cb
Compare
|
Did Hypre change this? Because originally this definitely did build and run correctly. Maybe use a typedef so that it's easier to change it back? |
|
I wonder if you built hypre/trilinos in a different way - I think the way the code is currently set up would work if local_ordinal and global_ordinal were both |
|
Your PR updated files that did not respect package formatting settings. Patchdiff --git a/packages/ifpack2/src/Ifpack2_Hypre_decl.hpp b/packages/ifpack2/src/Ifpack2_Hypre_decl.hpp
index e21d1476..4e46d6b8 100644
--- a/packages/ifpack2/src/Ifpack2_Hypre_decl.hpp
+++ b/packages/ifpack2/src/Ifpack2_Hypre_decl.hpp
@@ -287,13 +287,13 @@ class Hypre : virtual public Ifpack2::Preconditioner<typename MatrixType::scalar
template <class LocalOrdinal, class Node>
class Hypre<Tpetra::RowMatrix<HYPRE_Real, LocalOrdinal, HYPRE_BigInt, Node> > : virtual public Ifpack2::Preconditioner<HYPRE_Real,
- LocalOrdinal,
- HYPRE_BigInt,
- Node>,
- virtual public Ifpack2::Details::CanChangeMatrix<Tpetra::RowMatrix<HYPRE_Real,
- LocalOrdinal,
- HYPRE_BigInt,
- Node> > {
+ LocalOrdinal,
+ HYPRE_BigInt,
+ Node>,
+ virtual public Ifpack2::Details::CanChangeMatrix<Tpetra::RowMatrix<HYPRE_Real,
+ LocalOrdinal,
+ HYPRE_BigInt,
+ Node> > {
public:
//! \name Typedefs
//@{
diff --git a/packages/ifpack2/src/Ifpack2_Hypre_def.hpp b/packages/ifpack2/src/Ifpack2_Hypre_def.hpp
index 048d02a5..7c8ed23d 100644
--- a/packages/ifpack2/src/Ifpack2_Hypre_def.hpp
+++ b/packages/ifpack2/src/Ifpack2_Hypre_def.hpp
@@ -395,7 +395,7 @@ int Hypre<Tpetra::RowMatrix<HYPRE_Real, LocalOrdinal, HYPRE_BigInt, Node> >::Set
}
HYPRE_BigInt GlobalRow[1];
HYPRE_Int numEntries = (HYPRE_Int)indices.extent(0);
- GlobalRow[0] = GloballyContiguousRowMap_->getGlobalElement(i);
+ GlobalRow[0] = GloballyContiguousRowMap_->getGlobalElement(i);
IFPACK2_CHK_ERR(HYPRE_IJMatrixSetValues(HypreG_, 1, &numEntries, GlobalRow, new_indices.data(), values.data()));
}
IFPACK2_CHK_ERR(HYPRE_IJMatrixAssemble(HypreG_));
@@ -548,10 +548,10 @@ int Hypre<Tpetra::RowMatrix<HYPRE_Real, LocalOrdinal, HYPRE_BigInt, Node> >::Cal
//==============================================================================
template <class LocalOrdinal, class Node>
void Hypre<Tpetra::RowMatrix<HYPRE_Real, LocalOrdinal, HYPRE_BigInt, Node> >::apply(const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &X,
- Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &Y,
- Teuchos::ETransp mode,
- scalar_type alpha,
- scalar_type beta) const {
+ Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &Y,
+ Teuchos::ETransp mode,
+ scalar_type alpha,
+ scalar_type beta) const {
using LO = local_ordinal_type;
using SC = scalar_type;
const std::string timerName("Ifpack2::Hypre::apply");
@@ -621,8 +621,8 @@ void Hypre<Tpetra::RowMatrix<HYPRE_Real, LocalOrdinal, HYPRE_BigInt, Node> >::ap
//==============================================================================
template <class LocalOrdinal, class Node>
void Hypre<Tpetra::RowMatrix<HYPRE_Real, LocalOrdinal, HYPRE_BigInt, Node> >::applyMat(const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &X,
- Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &Y,
- Teuchos::ETransp mode) const {
+ Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> &Y,
+ Teuchos::ETransp mode) const {
A_->apply(X, Y, mode);
} // applyMat()
More details about our use of clang-format and other tools can be found in the wiki. |
|
I think this should work if you build trilinos with |
|
I always built with |
|
ahh, IIRC that one makes |
|
Ok. Sounds like your changes are an improvement, but might require additional changes to the Trilinos Spack package? |
|
I guess it depends on how prescriptive you want to be about expected build failures, heh. In the current head I don't think there is a check that the hypre types and trilinos types are consistent. |
|
Howdy @cgcgcg I finally had time to take another look at the MR, and I’m not sure if I am remembering our discussion correctly. My sketched notes were that you suggested adding a typedef so that a developer can more easily toggle back to the way things were set up in the current head. But looking again I’m not sure that’s right. Apologies for thinking out loud below, let me lay out my thinking…
Let me know if I'm misremembering what we discussed, or if there was something else I should modify. |
|
Finally had a look: Does this mean that we should outright specialize like so instead of ? |
|
@cgcgcg my app's tests are passing with these changes |
|
Made some small changes as hypre@3.0: changes a header file name that ifpack2 references. |
|
I've been testing these changes off of Trilinos 17.1.1 |
e284e4d to
1c7dec7
Compare
cgcgcg
left a comment
There was a problem hiding this comment.
@berselius LGTM. Please sign off your commits.
|
Might be my own ignorance here with the signoffs - I think the commits its complaining about was something I brought in with a merge or rebase. Is there an easy way to fix it? |
|
Oh, my bad. Yes, please rebase onto develop. That should get rid of the unsigned merge commits. |
…PRE_BigInt to match up Signed-off-by: Jeff Haack <haack@lanl.gov>
Signed-off-by: Jeff Haack <haack@lanl.gov>
Signed-off-by: Jeff Haack <haack@lanl.gov>
Signed-off-by: Jeff Haack <haack@lanl.gov>
Signed-off-by: Jeff Haack <haack@lanl.gov>
Signed-off-by: Jeff Haack <haack@lanl.gov>
1c7dec7 to
3196e5f
Compare
@trilinos/ifpack2
Motivation
global_ordinaland hypre's quasi-equivalentHYPRE_BigIntdid not map to each other in the Ifpack2 hypre interface implementationTesting