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

WIP (Do Not Merge!!): Belos Small Dense Matrix Abstraction #11837

Draft
wants to merge 101 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
7d7d11f
Added DenseMatrix template param to Belos::MultiVecTraits.
jennloe Dec 30, 2022
b0edf1d
Add Dense template paramter to solver manager base class and solver f…
jennloe Dec 30, 2022
477b83b
Remove Serial Dense from ICGSOrthoMgr
jennloe Mar 1, 2023
96295ea
Removed Serial Dense from MatOrthoMgr.
jennloe Mar 1, 2023
df26d53
Removed SerialDense from OrthoMgr.
jennloe Mar 1, 2023
941aef2
Added Dense param to blockGMRESIter.
jennloe Mar 1, 2023
0292e2e
Added template param to Gmres iterations.
jennloe Mar 1, 2023
f95685a
Add dense param to GMRES sol mgr and base class.
jennloe Mar 1, 2023
8783b12
Added template param to FGmres iter and OrthoMgrFactory.
jennloe Mar 1, 2023
c1aae82
First attempt at outlining a few Dense Matrix Traits.
jennloe Mar 2, 2023
1a7908e
Add header file to Belos src needed for Thyra to compile.
jennloe Mar 8, 2023
2bf6b52
Updated DenseMatrixAdapter functions. Wrote a partial Teuchos Serial …
jennloe Mar 8, 2023
c2def60
Expanded MultiVec Traits and corresponding Teuchos adapter, which pas…
jennloe Mar 14, 2023
13df066
BlockGmres solver partially running through dense mat traits
jennloe Mar 16, 2023
960a8eb
Add default constructor to dense mat taits.
jennloe Mar 18, 2023
528fa48
Update reshape traits fct to have init to zero option.
jennloe Mar 18, 2023
fc139a3
Added more functions for GMRES transition.
jennloe Mar 20, 2023
395e1e6
Converted BlockGmresIter outer layer to use abstract dense.
jennloe Mar 20, 2023
d0739e7
Added Frobenius norm to dense traits.
jennloe Mar 21, 2023
151dc13
Converted ICGS to dense abstract interface.
jennloe Mar 21, 2023
1041919
First attempt at Kokkos adapter.
jennloe Mar 27, 2023
224c8e7
Minor adjustment of comments.
jennloe Mar 28, 2023
320c164
Kokkos Dense adapter now passes dense unit test.
jennloe Mar 28, 2023
3aa2c2b
Reorganized Tpetra MV traits to allow future specialization for Kokko…
jennloe Apr 25, 2023
313c464
We now have a working Kokkos::View Dense adapter that is passing basic
jennloe May 2, 2023
87d118d
Converted IMGS OrthoMgr to new Dense interface.
jennloe May 3, 2023
a612e82
Fixed build error in ICGS.
jennloe May 3, 2023
0ec1fad
Incorporated Dense Abstract interface into status tests.
jennloe May 4, 2023
37ab644
GMRES spaces experiment.
jennloe May 8, 2023
eb55f67
Converted BelosLSQR and added ValueConst function explicitly in the n…
jennloe Jun 26, 2023
1408eec
Finally got the Kokkos Dense + Tpetra Block GMRES test building and p…
jennloe Jul 7, 2023
fe70991
Got DenseMat template param added to all needed solvers at the top le…
jennloe Jul 24, 2023
cc67d9a
Test many dense scalar types with SerialDenseMat Teuchos traits, via …
jennloe Jul 31, 2023
1fd4d71
Remove requirement to mark rawptr data modified. Fix two instances of…
jennloe Jul 31, 2023
8215a8e
Added SyncHostToDevice function for DenseMatTraits.
jennloe Jul 31, 2023
27919a7
Added syncs around TRSM. No change in failing test.
jennloe Jul 31, 2023
f185d30
Added syncs to LS problem solve. No change in failing test.
jennloe Jul 31, 2023
0294e71
Added extra syncs. Encountering deep copy error. Added debug statemen…
jennloe Aug 14, 2023
94d4e2c
Converted Minres to abstract layer; works with Teuchos dense backend.
jennloe Jul 26, 2023
b6ee456
Minres solver converted and runs with KK dense on CPU.
jennloe Jul 31, 2023
a758bb3
Fixed a deep copy issue for strided matrices. Also added some couts f…
jennloe Sep 18, 2023
3a10253
Fix Kokkos stride method for dense matrix traits and small code cleanup
hkthorn Oct 10, 2023
25dbff5
Improve integration of dense matrix traits into LSQR
hkthorn Oct 17, 2023
e0cc948
Converts BiCGStab and TFQMR solver to use dense matrix template
hkthorn Oct 17, 2023
7a36c9f
Removes unused implicit residual norm status test
hkthorn Oct 17, 2023
86f2a61
Remove unused Teuchos_SerialDenseMatrix.hpp header file
hkthorn Oct 17, 2023
d0b2c05
Removes default argument for dense matrix template argument
hkthorn Oct 17, 2023
2c4bb5d
Minor change to binary name for Kokkos::DualView MINRES test
hkthorn Oct 17, 2023
e464d9f
Converts PCPG solver to use dense matrix traits
hkthorn Oct 17, 2023
42d9f4e
Removes unused typedef
hkthorn Oct 19, 2023
58718cf
Fixes GCRODR template to include dense matrix argument
hkthorn Oct 19, 2023
3f6e805
Removes duplicate definition of MINRES directory
hkthorn Oct 19, 2023
bac24be
Fixes MINRES test so it will compile.
hkthorn Oct 19, 2023
d83ce59
Fixes MVOPTester code for Kokkos. Now this test passes on ascicgpu030.
hkthorn Oct 23, 2023
7ae9648
Fixes MINRES solver for Kokkos. Now the MINRES test passes on ascicg…
hkthorn Oct 23, 2023
a803a20
Finishes integration of dense matrix traits into PCPG
hkthorn Oct 24, 2023
64db2ef
Fixes all orthogonalization classes and testers to work with dense ma…
hkthorn Oct 25, 2023
3a11dc9
Removes debugging statements
hkthorn Oct 26, 2023
df5e218
Changes diagonal updating to use Subview/PutScalar methods
hkthorn Oct 26, 2023
64fe160
Adds Teuchos::SerialDenseMatrix test for DenseMatrixTester
hkthorn Oct 26, 2023
98bfad4
Converts over TSQR classes in Belos to use dense matrix template argu…
hkthorn Oct 26, 2023
22297a6
Converts flexible GMRES to use dense matrix traits and adds test
hkthorn Oct 26, 2023
b72580f
Converts fixed-point solver to use dense matrix template
hkthorn Oct 26, 2023
121a8c1
Adds missing override to address build warning
hkthorn Nov 2, 2023
b1a8e2a
Removed unnecessary Teuchos SDM header
hkthorn Nov 2, 2023
f0ec43d
Moves pseudo-block GMRES data structures to iteration header
hkthorn Nov 3, 2023
9574ca1
Adds override statment to address compiler warning
hkthorn Nov 10, 2023
8b0eebc
Converts single-vector CG, pseudo-block CG, and stochastic CG to DMT
hkthorn Nov 10, 2023
af8a58f
Removes unused serial dense matrix objects
hkthorn Nov 15, 2023
573ec2e
Adds DenseSolver interface for block CG solver
hkthorn Dec 13, 2023
f17ad3e
Fixes dense solver for Kokkos interface, clean up CG solvers
hkthorn Dec 13, 2023
3e4cce1
Finished converting GMRES-variants to dense matrix traits
hkthorn Dec 15, 2023
0128f03
Adds GMRES resolve test for Kokkos DualView, fixes templates in other…
hkthorn Dec 18, 2023
14ddb95
Fixes compile error for CommandLineProcessor
hkthorn Jun 13, 2024
a9dc57e
Fixes OrthoFactory to use dense matrix traits in template argument
hkthorn Jun 14, 2024
c97d73f
Inserts missing device to host synchronization
hkthorn Jun 14, 2024
72497f1
Fixing const correctness in arguments
hkthorn Jul 31, 2024
2906ae8
Fixes CreateCopy and GetRawHostPtr, updates test
hkthorn Jul 31, 2024
9b7fe27
Update GCRODR solver to use dense matrix traits
hkthorn Jul 31, 2024
1a24f3d
Adds tests for GCRODR and CG solver using Kokkos::DualView dense matrix
hkthorn Aug 2, 2024
7f1084c
Fix headers to be consistent with recent changes
hkthorn Aug 5, 2024
7927d18
Add complex-valued tests for minres, bicgstab, and gcrodr
hkthorn Aug 7, 2024
d4276de
Consolidates Teuchos::ScalarTraits typedefs
hkthorn Aug 23, 2024
6cdbb07
Corrects use of DMT::Value to DMT::ValueConst.
hkthorn Aug 23, 2024
11ae709
Comments out failing BiCGStab test
hkthorn Aug 23, 2024
c6d6a2c
Adding new tests to exercise orthogonalization options with GCRODR
hkthorn Aug 26, 2024
279fd1a
Adding method to debugging output to enable better understanding of p…
hkthorn Aug 26, 2024
2a73f52
Completes integration of DenseMatrixTraits
hkthorn Aug 26, 2024
d475b4d
Changes scalar values from SerialDenseMatrix to std::vector<>
hkthorn Aug 27, 2024
8a134a3
Moves several dense matrix objects to std::vector objects
hkthorn Aug 28, 2024
938a8c3
Remove unnecessary header
hkthorn Aug 29, 2024
5bc1810
Code cleanup to remove unnecessary dense matrix views
hkthorn Aug 30, 2024
66abf15
Final clean up before dense matrix traits transformation of RCG
hkthorn Aug 30, 2024
1fb7ff7
Convert SerialDenseMatrix objects to dense matrix traits.
hkthorn Sep 4, 2024
f104a8c
Cleans up use of MvAddMv to use Assign when more appropriate
hkthorn Sep 9, 2024
5832db1
Finishes migration of GEMM calls to use Teuchos::BLAS class
hkthorn Sep 9, 2024
d668fbe
Removes unused one/zero definitions after MvAddMv -> Assign changes
hkthorn Sep 17, 2024
e8e54fb
Fixes RCG solver to be correct with Kokkos::DualView
hkthorn Sep 18, 2024
0ed48a1
Removes unused zero and one definitions
hkthorn Sep 18, 2024
4b6ea43
Fix deprecated std::random_shuffle call
hkthorn Sep 25, 2024
21240dc
Update pseudo-block solvers for dense matrix abstraction
hkthorn Sep 25, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,21 @@ void registerSolverFactory() {
typedef double ST;
typedef Epetra_MultiVector MV;
typedef Epetra_Operator OP;
typedef Teuchos::SerialDenseMatrix<int,ST> DM;

Impl::registerSolverSubclassForTypes<BiCGStabSolMgr<ST,MV,OP>, ST, MV, OP> ("BICGSTAB");
Impl::registerSolverSubclassForTypes<BlockCGSolMgr<ST,MV,OP>, ST, MV, OP> ("BLOCK CG");
Impl::registerSolverSubclassForTypes<BlockGmresSolMgr<ST,MV,OP>, ST, MV, OP> ("BLOCK GMRES");
Impl::registerSolverSubclassForTypes<BlockCGSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("BLOCK CG");
Impl::registerSolverSubclassForTypes<BlockGmresSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("BLOCK GMRES");
Impl::registerSolverSubclassForTypes<FixedPointSolMgr<ST,MV,OP>, ST, MV, OP> ("FIXED POINT");
Impl::registerSolverSubclassForTypes<GCRODRSolMgr<ST,MV,OP>, ST, MV, OP> ("GCRODR");
Impl::registerSolverSubclassForTypes<GmresPolySolMgr<ST,MV,OP>, ST, MV, OP> ("HYBRID BLOCK GMRES");
Impl::registerSolverSubclassForTypes<LSQRSolMgr<ST,MV,OP>, ST, MV, OP> ("LSQR");
Impl::registerSolverSubclassForTypes<MinresSolMgr<ST,MV,OP>, ST, MV, OP> ("MINRES");
Impl::registerSolverSubclassForTypes<PCPGSolMgr<ST,MV,OP>, ST, MV, OP> ("PCPG");
Impl::registerSolverSubclassForTypes<PseudoBlockCGSolMgr<ST,MV,OP>, ST, MV, OP> ("PSEUDOBLOCK CG");
Impl::registerSolverSubclassForTypes<PseudoBlockGmresSolMgr<ST,MV,OP>, ST, MV, OP> ("PSEUDOBLOCK GMRES");
Impl::registerSolverSubclassForTypes<GCRODRSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("GCRODR");
Impl::registerSolverSubclassForTypes<GmresPolySolMgr<ST,MV,OP,DM>, ST, MV, OP> ("HYBRID BLOCK GMRES");
Impl::registerSolverSubclassForTypes<LSQRSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("LSQR");
Impl::registerSolverSubclassForTypes<MinresSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("MINRES");
Impl::registerSolverSubclassForTypes<PCPGSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("PCPG");
Impl::registerSolverSubclassForTypes<PseudoBlockCGSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("PSEUDOBLOCK CG");
Impl::registerSolverSubclassForTypes<PseudoBlockGmresSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("PSEUDOBLOCK GMRES");
Impl::registerSolverSubclassForTypes<PseudoBlockTFQMRSolMgr<ST,MV,OP>, ST, MV, OP> ("PSEUDOBLOCK TFQMR");
Impl::registerSolverSubclassForTypes<RCGSolMgr<ST,MV,OP>, ST, MV, OP> ("RCG");
Impl::registerSolverSubclassForTypes<RCGSolMgr<ST,MV,OP,DM>, ST, MV, OP> ("RCG");
Impl::registerSolverSubclassForTypes<TFQMRSolMgr<ST,MV,OP>, ST, MV, OP> ("TFQMR");
}

Expand Down
5 changes: 3 additions & 2 deletions packages/belos/epetra/test/MVOPTester/cxx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "BelosMVOPTester.hpp"
#include "BelosEpetraAdapter.hpp"
#include "BelosOutputManager.hpp"
#include "BelosTeuchosDenseAdapter.hpp"

#include "Teuchos_StandardCatchMacros.hpp"

Expand Down Expand Up @@ -121,7 +122,7 @@ int main(int argc, char *argv[])

// Issue several useful typedefs;
typedef Belos::MultiVec<double> EMV;
//typedef Belos::Operator<double> EOP; // unused
typedef Teuchos::SerialDenseMatrix<int, double> TDM;

// Create an Epetra_MultiVector for an initial std::vector to start the solver.
// Note that this needs to have the same number of columns as the blocksize.
Expand All @@ -135,7 +136,7 @@ int main(int argc, char *argv[])
}

// test the Epetra adapter multivector
ierr = Belos::TestMultiVecTraits<double,EMV>(MyOM,ivec);
ierr = Belos::TestMultiVecTraits<double,EMV,TDM>(MyOM,ivec);
gerr &= ierr;
if (ierr) {
MyOM->print(Belos::Warnings,"*** EpetraAdapter PASSED TestMultiVecTraits()\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ main (int argc, char *argv[])
// subclass, given a name for the subclass. The name is not the
// same as the class' syntactic name: e.g., "DKGS" is the name of
// DkgsOrthoManager.
Belos::OrthoManagerFactory< scalar_type, MV, OP > factory;
Belos::OrthoManagerFactory< scalar_type, MV, OP, serial_matrix_type > factory;
// The name of the (Mat)OrthoManager subclass to instantiate.
std::string ortho (factory.defaultName());

Expand Down Expand Up @@ -528,7 +528,7 @@ main (int argc, char *argv[])
// should return zero).
int numFailed = 0;
{
typedef Belos::Test::OrthoManagerTester<scalar_type, MV> tester_type;
typedef Belos::Test::OrthoManagerTester<scalar_type, MV, serial_matrix_type> tester_type;
debugOut << "Running OrthoManager tests..." << endl;
numFailed = tester_type::runTests (OM, isRankRevealing, S,
sizeX1, sizeX2, outMan);
Expand Down
10 changes: 8 additions & 2 deletions packages/belos/kokkos/example/CMakeLists.txt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove KKGMRESEX in final.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST(
COMM serial mpi
)

TRIBITS_ADD_EXECUTABLE_AND_TEST(
Kokkos_KKGMRESEx
SOURCES ex_real_A.cpp
COMM serial mpi
)

TRIBITS_ADD_EXECUTABLE_AND_TEST(
Kokkos_BlockCGEx
SOURCES BlockCGKokkosExFile.cpp
Expand All @@ -25,8 +31,8 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST(

TRIBITS_COPY_FILES_TO_BINARY_DIR(CopyExampleMtxFiles
SOURCE_DIR ${Belos_SOURCE_DIR}/kokkos/example
SOURCE_FILES bcsstk12.mtx
EXEDEPS Kokkos_BlockCGEx Kokkos_BlockGmresEx Kokkos_GCRODREx
SOURCE_FILES bcsstk12.mtx bcsstk09.mtx
EXEDEPS Kokkos_BlockCGEx Kokkos_BlockGmresEx Kokkos_GCRODREx Kokkos_KKGMRESEx
)

IF(Teuchos_ENABLE_COMPLEX)
Expand Down
14 changes: 8 additions & 6 deletions packages/belos/kokkos/example/GCRODRComplexKokkosExFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "BelosGCRODRSolMgr.hpp"
#include "BelosOutputManager.hpp"

#include "Teuchos_SerialDenseMatrix.hpp"
#include "Teuchos_CommandLineProcessor.hpp"
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_StandardCatchMacros.hpp"
Expand All @@ -41,11 +42,12 @@ bool success = true;
typedef Kokkos::complex<double> ST;
typedef int OT;
typedef Kokkos::DefaultExecutionSpace EXSP;
typedef Teuchos::ScalarTraits<ST> SCT;
typedef Teuchos::ScalarTraits<ST> SCT;
typedef Teuchos::SerialDenseMatrix<int,ST>DM;
typedef SCT::magnitudeType MT;
typedef Belos::KokkosMultiVec<ST, EXSP> MV;
typedef Belos::MultiVec<ST> KMV;
typedef Belos::Operator<ST> KOP;
typedef Belos::KokkosMultiVec<ST, EXSP> MV;
typedef Belos::MultiVec<ST> KMV;
typedef Belos::Operator<ST> KOP;
typedef Belos::MultiVecTraits<ST,KMV> MVT;
typedef Belos::OperatorTraits<ST,KMV,KOP> OPT;

Expand Down Expand Up @@ -136,8 +138,8 @@ try {
// *******************************************************************
//
// Create an iterative solver manager.
RCP< Belos::SolverManager<ST,KMV,KOP> > newSolver
= rcp( new Belos::GCRODRSolMgr<ST,KMV,KOP,true>(rcpFromRef(problem), rcpFromRef(belosList)) );
RCP< Belos::SolverManager<ST,KMV,KOP,DM> > newSolver
= rcp( new Belos::GCRODRSolMgr<ST,KMV,KOP,DM,true>(rcpFromRef(problem), rcpFromRef(belosList)) );

//
// **********Print out information about problem*******************
Expand Down
2 changes: 1 addition & 1 deletion packages/belos/kokkos/example/GCRODRKokkosExFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ try {
//
// Create an iterative solver manager.
RCP< Belos::SolverManager<ST,KMV,KOP> > newSolver
= rcp( new Belos::GCRODRSolMgr<ST,KMV,KOP,true>(rcpFromRef(problem), rcpFromRef(belosList)) );
= rcp( new Belos::GCRODRSolMgr<ST,KMV,KOP>(rcpFromRef(problem), rcpFromRef(belosList)) );

//
// **********Print out information about problem*******************
Expand Down
Loading
Loading