From 4c16cfad8664f634729064c22df6fc85ded8da4d Mon Sep 17 00:00:00 2001 From: "Heidi K. Thornquist" Date: Thu, 14 May 2020 21:34:03 -0600 Subject: [PATCH] Fixes errors in OrthoManagerTest and enables Epetra testing The OrthoManagerTest had several typos in it, which were not found because all tests that used it were essentially disabled. The OrthoManagerTest has been fixed and all TSQR-specific tests have been placed behind an ifdef. The Epetra interface test for the OrthoManager has been enabled and the dependency on TSQR has been removed due to the change in the tester. --- .../belos/epetra/test/OrthoManager/CMakeLists.txt | 8 ++++++-- packages/belos/src/BelosOrthoManagerTest.hpp | 15 ++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/belos/epetra/test/OrthoManager/CMakeLists.txt b/packages/belos/epetra/test/OrthoManager/CMakeLists.txt index fb3707d36d66..e4e3a24536b4 100644 --- a/packages/belos/epetra/test/OrthoManager/CMakeLists.txt +++ b/packages/belos/epetra/test/OrthoManager/CMakeLists.txt @@ -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() diff --git a/packages/belos/src/BelosOrthoManagerTest.hpp b/packages/belos/src/BelosOrthoManagerTest.hpp index 53da89c1edee..97589c149d13 100644 --- a/packages/belos/src/BelosOrthoManagerTest.hpp +++ b/packages/belos/src/BelosOrthoManagerTest.hpp @@ -463,7 +463,7 @@ namespace Belos { debugOut << "done: || || = " << err << endl; } - +#ifdef HAVE_BELOS_TSQR // // If OM is an OutOfPlaceNormalizerMixin, exercise the // out-of-place normalization routines. @@ -560,6 +560,7 @@ namespace Belos { << "=== Done with OutOfPlaceNormalizerMixin tests ===" << endl << endl; } +#endif // HAVE_BELOS_TSQR { // @@ -640,7 +641,7 @@ namespace Belos { std::vector ind(1); ind[0] = i; RCP 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); @@ -725,7 +726,7 @@ namespace Belos { std::vector ind(1); ind[0] = i; RCP 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; @@ -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; inormalize (*S_copy, B); sout << "normalize() returned rank " << reportedRank << endl;