Skip to content

Commit

Permalink
Merge pull request #7374 from hkthorn/develop
Browse files Browse the repository at this point in the history
Fixes errors in OrthoManagerTest and enables Epetra testing
  • Loading branch information
jennloe authored May 15, 2020
2 parents 6c8b1da + 4c16cfa commit 2ce8718
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions packages/belos/epetra/test/OrthoManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Triutils)

IF (${PACKAGE_NAME}_ENABLE_Triutils AND ${PACKAGE_NAME}_ENABLE_TSQR)
IF (${PACKAGE_NAME}_ENABLE_Triutils)

TRIBITS_ADD_EXECUTABLE_AND_TEST(
Epetra_OrthoManager_test
SOURCES belos_orthomanager_epetra.cpp
ARGS ""
ARGS "--ortho=ICGS --verbose"
"--ortho=DGKS --verbose"
"--ortho=IMGS --verbose"
COMM serial mpi
)

ENDIF()
15 changes: 8 additions & 7 deletions packages/belos/src/BelosOrthoManagerTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ namespace Belos {
debugOut << "done: || <X2,X1> || = " << err << endl;
}


#ifdef HAVE_BELOS_TSQR
//
// If OM is an OutOfPlaceNormalizerMixin, exercise the
// out-of-place normalization routines.
Expand Down Expand Up @@ -560,6 +560,7 @@ namespace Belos {
<< "=== Done with OutOfPlaceNormalizerMixin tests ==="
<< endl << endl;
}
#endif // HAVE_BELOS_TSQR

{
//
Expand Down Expand Up @@ -640,7 +641,7 @@ namespace Belos {
std::vector<int> ind(1);
ind[0] = i;
RCP<MV> Si = MVT::CloneViewNonConst(*S,ind);
MVT::MvAddMv(scaleS[i],*one,ZERO,*one,*Si);
MVT::MvAddMv(scaleS(i,0),*one,ZERO,*one,*Si);
}
debugOut << "Testing normalize() on a rank-1 multivector " << endl;
const int thisNumFailed = testNormalize(OM,S,MyOM);
Expand Down Expand Up @@ -725,7 +726,7 @@ namespace Belos {
std::vector<int> ind(1);
ind[0] = i;
RCP<MV> Si = MVT::CloneViewNonConst(*S,ind);
MVT::MvAddMv(scaleS[i],*one,ZERO,*one,*Si);
MVT::MvAddMv(scaleS(i,0),*one,ZERO,*one,*Si);
}
debugOut << "Testing projectAndNormalize() on a rank-1 multivector " << endl;
bool constantStride = true;
Expand Down Expand Up @@ -940,9 +941,9 @@ namespace Belos {
// copies of S,MS
Scopy = MVT::CloneCopy(*S);
// randomize this data, it should be overwritten
Teuchos::randomSyncedMatrix(B);
Teuchos::randomSyncedMatrix(*B);
for (size_type i=0; i<C.size(); i++) {
Teuchos::randomSyncedmatrix(*C[i]);
Teuchos::randomSyncedMatrix(*C[i]);
}
// Run test. Since S was specified by the caller and
// Scopy is a copy of S, we don't know what rank to expect
Expand Down Expand Up @@ -996,7 +997,7 @@ namespace Belos {
// data will be overwritten by projectAndNormalize().
// Filling these matrices here is only to catch some
// bugs in projectAndNormalize().
Teuchos::randomSyncedMatrix(B);
Teuchos::randomSyncedMatrix(*B);
for (size_type i=0; i<C.size(); i++) {
Teuchos::randomSyncedMatrix(*C[i]);
}
Expand Down Expand Up @@ -1210,7 +1211,7 @@ namespace Belos {
// random data just to make sure that the normalization
// operated on all the elements of B on which it should
// operate.
Teuchos::randomSyncedMatrix(B);
Teuchos::randomSyncedMatrix(*B);

const int reportedRank = OM->normalize (*S_copy, B);
sout << "normalize() returned rank " << reportedRank << endl;
Expand Down

0 comments on commit 2ce8718

Please sign in to comment.