Skip to content

Commit

Permalink
Ifpack2: Add Schur complements to the BlockTriDiag solver. (#12344)
Browse files Browse the repository at this point in the history
* Add Schur complements to the BlockTriDiag solver.

* Build warning free

* Update the PR with Luc's comments

* Reorder the loops to avoid branching
  • Loading branch information
kliegeois committed Oct 24, 2023
1 parent dcd4ed5 commit 6ad4a25
Show file tree
Hide file tree
Showing 7 changed files with 3,398 additions and 1,497 deletions.
6 changes: 4 additions & 2 deletions packages/ifpack2/example/BlockTriDi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace { // (anonymous)

// Values of command-line arguments.
struct CmdLineArgs {
CmdLineArgs ():blockSize(-1),numIters(10),numRepeats(1),tol(1e-12),nx(172),ny(-1),nz(-1),mx(1),my(1),mz(1),sublinesPerLine(1),useStackedTimer(false),overlapCommAndComp(false){}
CmdLineArgs ():blockSize(-1),numIters(10),numRepeats(1),tol(1e-12),nx(172),ny(-1),nz(-1),mx(1),my(1),mz(1),sublinesPerLine(1),sublinesPerLineSchur(1),useStackedTimer(false),overlapCommAndComp(false){}

std::string mapFilename;
std::string matrixFilename;
Expand All @@ -35,6 +35,7 @@ struct CmdLineArgs {
int my;
int mz;
int sublinesPerLine;
int sublinesPerLineSchur;
bool useStackedTimer;
bool overlapCommAndComp;
std::string problemName;
Expand Down Expand Up @@ -71,6 +72,7 @@ getCmdLineArgs (CmdLineArgs& args, int argc, char* argv[])
"Whether to run with overlapCommAndComp)");
cmdp.setOption("problemName", &args.problemName, "Human-readable problem name for Watchr plot");
cmdp.setOption("matrixType", &args.matrixType, "matrixType");
cmdp.setOption("sublinesPerLineSchur", &args.sublinesPerLineSchur, "sublinesPerLineSchur");
auto result = cmdp.parse (argc, argv);
return result == Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL;
}
Expand Down Expand Up @@ -573,7 +575,7 @@ main (int argc, char* argv[])

{
Teuchos::TimeMonitor precSetupTimeMon (*precSetupTime);
precond = rcp(new BTDC(Ablock,parts,args.overlapCommAndComp));
precond = rcp(new BTDC(Ablock,parts,args.sublinesPerLineSchur,args.overlapCommAndComp));

if(rank0) std::cout<<"Initializing preconditioner..."<<std::endl;
precond->initialize ();
Expand Down
859 changes: 859 additions & 0 deletions packages/ifpack2/src/Ifpack2_BlockComputeResidualVector.hpp

Large diffs are not rendered by default.

Loading

0 comments on commit 6ad4a25

Please sign in to comment.