Skip to content

Commit

Permalink
Cleaning up my messy debug outputs and checks
Browse files Browse the repository at this point in the history
Signed-off-by: Luc Berger-Vergiat <[email protected]>
  • Loading branch information
lucbv committed Nov 5, 2024
1 parent f2e80bc commit 6ff6da5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
32 changes: 16 additions & 16 deletions packages/tpetra/core/src/Tpetra_CrsMatrix_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3271,22 +3271,22 @@ CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
"a view with global column indices by calling getGlobalRowCopy().");

const RowInfo rowInfo = staticGraph_->getRowInfo (localRow);
// if (rowInfo.localRow != Teuchos::OrdinalTraits<size_t>::invalid () &&
// rowInfo.numEntries > 0) {
// indices = staticGraph_->lclIndsUnpacked_wdv.getHostSubview(
// rowInfo.offset1D,
// rowInfo.numEntries,
// Access::ReadOnly);
// values = valuesUnpacked_wdv.getHostSubview(rowInfo.offset1D,
// rowInfo.numEntries,
// Access::ReadOnly);
// }
// else {
// // This does the right thing (reports an empty row) if the input
// // row is invalid.
// indices = local_inds_host_view_type();
// values = values_host_view_type();
// }
if (rowInfo.localRow != Teuchos::OrdinalTraits<size_t>::invalid () &&
rowInfo.numEntries > 0) {
indices = staticGraph_->lclIndsUnpacked_wdv.getHostSubview(
rowInfo.offset1D,
rowInfo.numEntries,
Access::ReadOnly);
values = valuesUnpacked_wdv.getHostSubview(rowInfo.offset1D,
rowInfo.numEntries,
Access::ReadOnly);
}
else {
// This does the right thing (reports an empty row) if the input
// row is invalid.
indices = local_inds_host_view_type();
values = values_host_view_type();
}

#ifdef HAVE_TPETRA_DEBUG
const char suffix[] = ". This should never happen. Please report this "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class GetLocalDiagCopyWithoutOffsetsNotFillCompleteFunctor {

void operator () (const LO& lclRowInd, LO& errCount) const {
using KokkosSparse::findRelOffset;
Kokkos::printf("Not hanging yet [0]\n");

D_lcl_1d_(lclRowInd) = Kokkos::ArithTraits<IST>::zero ();
const GO gblInd = lclRowMap_.getGlobalElement (lclRowInd);
Expand All @@ -120,23 +119,19 @@ class GetLocalDiagCopyWithoutOffsetsNotFillCompleteFunctor {
else { // row index is also in the column Map on this process
typename row_matrix_type::local_inds_host_view_type lclColInds;
typename row_matrix_type::values_host_view_type curVals;
Kokkos::printf("Not hanging yet [1]\n");
A_.getLocalRowView(lclRowInd, lclColInds, curVals);
Kokkos::printf("Not hanging yet [2]\n");
LO numEnt = lclColInds.extent(0);
// The search hint is always zero, since we only call this
// once per row of the matrix.
const LO hint = 0;
const LO offset =
findRelOffset (lclColInds, numEnt, lclColInd, hint, sorted_);
Kokkos::printf("Not hanging yet [3]\n");
if (offset == numEnt) { // didn't find the diagonal column index
errCount++;
}
else {
D_lcl_1d_(lclRowInd) = curVals[offset];
}
Kokkos::printf("Not hanging yet [4]\n");
}
}

Expand Down Expand Up @@ -216,8 +211,6 @@ getLocalDiagCopyWithoutOffsetsNotFillComplete ( ::Tpetra::Vector<SC, LO, GO, NT>
}
}
else { // ! debug
Kokkos::printf("\n\n\nRunning on Kokkos::Serial: %s\n", std::is_same_v<typename functor_type::host_execution_space, Kokkos::Serial> ? "true" : "false");

functor_type functor (lclNumErrs, diag, A);
}

Expand Down

0 comments on commit 6ff6da5

Please sign in to comment.