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

MueLu: Fixes #12768

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class HierarchicalOperator : public TpetraOperator<Scalar, LocalOrdinal, GlobalO
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

//! Returns the Tpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const map_type> getDomainMap() const {
const Teuchos::RCP<const map_type> getDomainMap() const {
return toXpetra(op_->getDomainMap());
}

//! Returns the Tpetra::Map object associated with the range of this operator.
Teuchos::RCP<const map_type> getRangeMap() const {
const Teuchos::RCP<const map_type> getRangeMap() const {
return toXpetra(op_->getRangeMap());
}

Expand Down
8 changes: 4 additions & 4 deletions packages/muelu/research/graham/mf_example_01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ class TridiagonalOperator : public Xpetra::Operator<Scalar, LocalOrdinal, Global
}

//! Returns the Xpetra::Map object associated with the domain of this operator.
Teuchos::RCP<const map_type> getDomainMap() const { return opMap_; }
const Teuchos::RCP<const map_type> getDomainMap() const { return opMap_; }
GrahamBenHarper marked this conversation as resolved.
Show resolved Hide resolved

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

//! Indicates whether this operator supports applying the adjoint operator.
bool hasTransposeApply() const { return true; }
Expand Down Expand Up @@ -405,10 +405,10 @@ class MFProlongatorOperator : public Xpetra::Operator<Scalar, LocalOrdinal, Glob
}

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

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

//! Indicates whether this operator supports applying the adjoint operator.
bool hasTransposeApply() const { return true; }
Expand Down
7 changes: 5 additions & 2 deletions packages/muelu/src/Utils/MueLu_UtilitiesBase_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ UtilitiesBase<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
const CrsMatrixWrap* crsOp = dynamic_cast<const CrsMatrixWrap*>(&A);
if ((crsOp != NULL) && (rowMap->lib() == Xpetra::UseTpetra)) {
using local_vector_type = typename Vector::dual_view_type::t_dev_um;
using execution_space = typename local_vector_type::execution_space;
Kokkos::View<size_t*, execution_space> offsets("offsets", rowMap->getLocalNumElements());
using device_type = typename CrsGraph::device_type;
Kokkos::View<size_t*, device_type> offsets("offsets", rowMap->getLocalNumElements());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the value of execution space in the build that errored out? Just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only errored out in a UVM build (which is not covered by the AT).

crsOp->getCrsGraph()->getLocalDiagOffsets(offsets);
crsOp->getCrsMatrix()->getLocalDiagCopy(*diag, offsets);
} else {
Expand Down Expand Up @@ -1012,6 +1012,9 @@ DetectDirichletRows_kokkos(const Xpetra::Matrix<SC, LO, GO, NO>& A,
Kokkos::deep_copy(boundaryNodes2, boundaryNodes);
return boundaryNodes2;
}
// CAG: No idea why this is needed to avoid "warning: missing return statement at end of non-void function"
GrahamBenHarper marked this conversation as resolved.
Show resolved Hide resolved
Kokkos::View<bool*, memory_space> dummy("dummy", 0);
return dummy;
}

template <class SC, class LO, class GO, class NO>
Expand Down
11 changes: 6 additions & 5 deletions packages/muelu/test/interface/CreateOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ void run_sed(const std::string& pattern, const std::string& baseFile) {
#ifdef __APPLE__
sed_pref = sed_pref + "\"\" ";
#endif

int ret_val = 0;
(void)ret_val; // suppress fscanf return value and unused variable warnings
ret_val = system((sed_pref + pattern + " " + baseFile + ".gold_filtered").c_str());
ret_val = system((sed_pref + pattern + " " + baseFile + ".gold_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);
ret_val = system((sed_pref + pattern + " " + baseFile + ".out_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);
}

bool compare_to_gold(int myRank, const std::string& baseFile) {
Expand All @@ -198,9 +198,10 @@ bool compare_to_gold(int myRank, const std::string& baseFile) {
// Create a copy of outputs
std::string cmd = "cp -f ";
int ret_val = 0;
(void)ret_val; // suppress fscanf return value and unused variable warnings
ret_val = system((cmd + baseFile + ".gold " + baseFile + ".gold_filtered").c_str());
ret_val = system((cmd + baseFile + ".gold " + baseFile + ".gold_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);
ret_val = system((cmd + baseFile + ".out " + baseFile + ".out_filtered").c_str());
TEUCHOS_ASSERT_EQUALITY(ret_val, 0);

// Tpetra produces different eigenvalues in Chebyshev due to using
// std::rand() for generating random vectors, which may be initialized
Expand Down
6 changes: 3 additions & 3 deletions packages/muelu/test/scaling/MatrixLoad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe
if (mueluList.sublist(smootherOrCoarse + ": params").sublist("subdomain solver parameters").get<std::string>("partitioner: type") == "user") {
FILE* fp;
int retVal;
int nBlks, nRows, nnzs, ch, row, col;
int nBlks, nRows, nnzs, row, col;
int procId = comm->getRank();
double val;

Expand All @@ -301,7 +301,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe
fp = fopen(&userBlkFileName[0], "r");
TEUCHOS_TEST_FOR_EXCEPTION(fp == NULL, std::runtime_error, userBlkFileName + " file not found");

while ((ch = getc(fp) != '\n'))
while ((getc(fp) != '\n'))
; // read first line

retVal = fscanf(fp, "%d %d %d\n", &nBlks, &nRows, &nnzs);
Expand Down Expand Up @@ -367,7 +367,7 @@ void readUserBlks(const std::string& userBlkFileName, const std::string& smoothe
fp = fopen(&userBlkFileName[0], "r");
TEUCHOS_TEST_FOR_EXCEPTION(fp == NULL, std::runtime_error, userBlkFileName + " file not found");

while ((ch = getc(fp) != '\n'))
while ((getc(fp) != '\n'))
;

retVal = fscanf(fp, "%d %d %d\n", &nBlks, &nRows, &nnzs);
Expand Down
Loading