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

Fixes errors in OrthoManagerTest and enables Epetra testing #7374

Merged
merged 1 commit into from
May 15, 2020
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
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