From 6ff6da5cd364db8ac5e553cccd916fd800af6e7d Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Tue, 5 Nov 2024 11:56:10 -0700 Subject: [PATCH] Cleaning up my messy debug outputs and checks Signed-off-by: Luc Berger-Vergiat --- .../tpetra/core/src/Tpetra_CrsMatrix_def.hpp | 32 +++++++++---------- ..._Details_getDiagCopyWithoutOffsets_def.hpp | 7 ---- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/packages/tpetra/core/src/Tpetra_CrsMatrix_def.hpp b/packages/tpetra/core/src/Tpetra_CrsMatrix_def.hpp index 132fd6c3c0f6..c9a634d6f65d 100644 --- a/packages/tpetra/core/src/Tpetra_CrsMatrix_def.hpp +++ b/packages/tpetra/core/src/Tpetra_CrsMatrix_def.hpp @@ -3271,22 +3271,22 @@ CrsMatrix:: "a view with global column indices by calling getGlobalRowCopy()."); const RowInfo rowInfo = staticGraph_->getRowInfo (localRow); - // if (rowInfo.localRow != Teuchos::OrdinalTraits::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::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 " diff --git a/packages/tpetra/core/src/Tpetra_Details_getDiagCopyWithoutOffsets_def.hpp b/packages/tpetra/core/src/Tpetra_Details_getDiagCopyWithoutOffsets_def.hpp index b5f9281d8284..64dfa2cec53a 100644 --- a/packages/tpetra/core/src/Tpetra_Details_getDiagCopyWithoutOffsets_def.hpp +++ b/packages/tpetra/core/src/Tpetra_Details_getDiagCopyWithoutOffsets_def.hpp @@ -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::zero (); const GO gblInd = lclRowMap_.getGlobalElement (lclRowInd); @@ -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"); } } @@ -216,8 +211,6 @@ getLocalDiagCopyWithoutOffsetsNotFillComplete ( ::Tpetra::Vector } } else { // ! debug - Kokkos::printf("\n\n\nRunning on Kokkos::Serial: %s\n", std::is_same_v ? "true" : "false"); - functor_type functor (lclNumErrs, diag, A); }