Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_STRUMPACK_def.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Amesos2: Templated Direct Sparse Solver Package
4 //
5 // Copyright 2011 NTESS and the Amesos2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 
11 #ifndef AMESOS2_STRUMPACK_DEF_HPP
12 #define AMESOS2_STRUMPACK_DEF_HPP
13 
14 #include <Teuchos_Tuple.hpp>
15 #include <Teuchos_StandardParameterEntryValidators.hpp>
16 
18 #include "Amesos2_Util.hpp"
19 
20 #include <memory>
21 #ifdef HAVE_MPI
22 #include <Teuchos_DefaultMpiComm.hpp>
23 #include "StrumpackSparseSolverMPIDist.hpp"
24 #else
25 #include "StrumpackSparseSolver.hpp"
26 #endif
27 
28 namespace Amesos2 {
29 
30 
31  template <class Matrix, class Vector>
32  STRUMPACK<Matrix,Vector>::STRUMPACK(Teuchos::RCP<const Matrix> A,
33  Teuchos::RCP<Vector> X,
34  Teuchos::RCP<const Vector> B)
35  : SolverCore<Amesos2::STRUMPACK,Matrix,Vector>(A, X, B)
36 
37  {
38  using Teuchos::Comm;
39 #ifdef HAVE_MPI
40  using Teuchos::MpiComm;
41 #endif
42  using Teuchos::ParameterList;
43  using Teuchos::parameterList;
44  using Teuchos::RCP;
45  using Teuchos::rcp;
46  using Teuchos::rcp_dynamic_cast;
47  typedef global_ordinal_type GO;
48 #ifdef HAVE_MPI
49  typedef Tpetra::Map<local_ordinal_type, GO, node_type> map_type;
50 #endif
51  RCP<const Comm<int> > comm = this->getComm ();
52 
53 #ifdef HAVE_MPI
54  RCP<const MpiComm<int> > mpiComm =
55  rcp_dynamic_cast<const MpiComm<int> > (comm);
56  TEUCHOS_TEST_FOR_EXCEPTION
57  (mpiComm.is_null (), std::logic_error, "Amesos2::STRUMPACK "
58  "constructor: The matrix's communicator is not an MpiComm!");
59  MPI_Comm rawMpiComm = (* (mpiComm->getRawMpiComm ())) ();
60 
61  sp_ = Teuchos::RCP<strumpack::StrumpackSparseSolverMPIDist<scalar_type,GO>>
62  // (new strumpack::StrumpackSparseSolverMPIDist<scalar_type,GO>(rawMpiComm, this->control_.verbose_));
63  (new strumpack::StrumpackSparseSolverMPIDist<scalar_type,GO>(rawMpiComm, true));
64 #else
65  sp_ = Teuchos::RCP<strumpack::StrumpackSparseSolver<scalar_type,GO>>
66  (new strumpack::StrumpackSparseSolver<scalar_type,GO>(this->control_.verbose_, this->root_));
67 
68 #endif
69 
70 /*
71  Do we need this?
72  (What parameters do we set here that are not already provided?)
73 */
74  RCP<ParameterList> default_params =
75  parameterList (* (this->getValidParameters ()));
76  this->setParameters (default_params);
77 
78 #ifdef HAVE_MPI
79  const size_t myNumRows = this->matrixA_->getLocalNumRows();
80  const GO indexBase = this->matrixA_->getRowMap ()->getIndexBase ();
81  strumpack_rowmap_ =
82  rcp (new map_type (this->globalNumRows_, myNumRows, indexBase, comm));
83 #endif
84  }
85 
86 
88 // DELETE //
90 
91  template <class Matrix, class Vector>
93  {
94  }
95 
96 
98 // PRE-ORDERING //
100  template<class Matrix, class Vector>
101  int
103  {
104 #ifdef HAVE_AMESOS2_TIMERS
105  Teuchos::TimeMonitor preOrderTime( this->timers_.preOrderTime_ );
106 #endif
107 
108  // nothing to do: reordering and symbolic factorization are done
109  // together in call to ->reorder
110 
111  return EXIT_SUCCESS;
112  }
113 
114 
115 
117 // SYMBOLIC-FACTORIZATION //
119 
120  template <class Matrix, class Vector>
121  int
123  {
124 #ifdef HAVE_AMESOS2_TIMERS
125  Teuchos::TimeMonitor symFactTime( this->timers_.symFactTime_ );
126 #endif
127 
128  strumpack::ReturnCode ret = sp_->reorder();
129  TEUCHOS_TEST_FOR_EXCEPTION( ret == strumpack::ReturnCode::MATRIX_NOT_SET,
130  std::runtime_error,
131  "STRUMPACK matrix reordering failed: "
132  "matrix was not set." );
133  TEUCHOS_TEST_FOR_EXCEPTION( ret == strumpack::ReturnCode::REORDERING_ERROR,
134  std::runtime_error,
135  "STRUMPACK matrix reordering failed." );
136 
137  return EXIT_SUCCESS;
138  }
139 
140 
142 // NUMERIC-FACTORIZATION //
144 
145  template <class Matrix, class Vector>
146  int
148  {
149 #ifdef HAVE_AMESOS2_TIMERS
150  Teuchos::TimeMonitor numFactTimer(this->timers_.numFactTime_);
151 #endif
152 
153  strumpack::ReturnCode ret = sp_->factor();
154  // Check output
155  TEUCHOS_TEST_FOR_EXCEPTION( ret != strumpack::ReturnCode::SUCCESS,
156  std::runtime_error,
157  "Error in STRUMPACK factorization." );
158 
159  return EXIT_SUCCESS;
160  }
161 
162 
164 // SOLVE //
166 
167  template <class Matrix, class Vector>
168  int
170  const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const
171  {
172 
173 #ifdef HAVE_MPI
174  // local_len_rhs is how many of the multivector rows belong to
175  // this processor
176  const size_t local_len_rhs = strumpack_rowmap_->getLocalNumElements();
177  const global_size_type nrhs = X->getGlobalNumVectors();
178 
179  // make sure our multivector storage is sized appropriately
180  bvals_.resize(nrhs * local_len_rhs);
181  xvals_.resize(nrhs * local_len_rhs);
182 
183  {
184 
185 #ifdef HAVE_AMESOS2_TIMERS
186  Teuchos::TimeMonitor convTimer(this->timers_.vecConvTime_);
187 #endif
188 
189  {
190 #ifdef HAVE_AMESOS2_TIMERS
191  Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
192 #endif
193  //get dristributed data from Trilinos
194  typedef Util::get_1d_copy_helper<MultiVecAdapter<Vector>,scalar_type> copy_helper;
195  copy_helper::do_get(B,
196  bvals_(),
197  local_len_rhs,
198  Teuchos::ptrInArg(*strumpack_rowmap_));
199  }
200  } // end block for conversion time
201 
202  {
203 #ifdef HAVE_AMESOS2_TIMERS
204  Teuchos::TimeMonitor solveTimer(this->timers_.solveTime_);
205 #endif
206  strumpack::DenseMatrixWrapper<scalar_type>
207  Bsp(local_len_rhs, nrhs, bvals_().getRawPtr(), local_len_rhs),
208  Xsp(local_len_rhs, nrhs, xvals_().getRawPtr(), local_len_rhs);
209  strumpack::ReturnCode ret =sp_->solve(Bsp, Xsp);
210 
211  TEUCHOS_TEST_FOR_EXCEPTION( ret != strumpack::ReturnCode::SUCCESS,
212  std::runtime_error,
213  "Error in STRUMPACK solve" );
214  } // end block for solve time
215 
216 
217  {
218 #ifdef HAVE_AMESOS2_TIMERS
219  Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
220 #endif
221 
222  //get dristributed data from STRUMPACK after solving
223  typedef Util::put_1d_data_helper<MultiVecAdapter<Vector>,scalar_type> put_helper;
224  put_helper::do_put(X,
225  xvals_(),
226  local_len_rhs,
227  Teuchos::ptrInArg(*strumpack_rowmap_));
228  }
229 #else //NO MPI
230  using Teuchos::as;
231  const global_size_type ld_rhs = this->root_ ? X->getGlobalLength() : 0;
232  const size_t nrhs = X->getGlobalNumVectors();
233  bvals_.resize(nrhs * ld_rhs);
234  xvals_.resize(nrhs * ld_rhs);
235 
236  {
237 #ifdef HAVE_AMESOS2_TIMERS
238  Teuchos::TimeMonitor solveTimer(this->timers_.solveTime_);
239 #endif
240 
241  strumpack::DenseMatrixWrapper<scalar_type>
242  Bsp(ld_rhs, nrhs, bvals_().getRawPtr(), ld_rhs),
243  Xsp(ld_rhs, nrhs, xvals_().getRawPtr(), ld_rhs);
244  strumpack::ReturnCode ret =sp_->solve(Bsp, Xsp);
245 
246  TEUCHOS_TEST_FOR_EXCEPTION( ret != strumpack::ReturnCode::SUCCESS,
247  std::runtime_error,
248  "Error in STRUMPACK solve" );
249  } // end block for solve time
250 
251  {
252 #ifdef HAVE_AMESOS2_TIMERS
253  Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
254 #endif
255 
257  MultiVecAdapter<Vector>,scalar_type>::do_put(X, xvals_(),
258  as<size_t>(ld_rhs),
259  ROOTED, this->rowIndexBase_);
260  }
261 #endif
262  return EXIT_SUCCESS;
263  }
264 
265 
266  template <class Matrix, class Vector>
267  bool
269  {
270 #ifdef HAVE_MPI
271  // STRUMPACK requires square matrices
272  return( this->globalNumRows_ == this->globalNumCols_ );
273 #else
274  return( this->matrixA_->getGlobalNumRows() == this->matrixA_->getGlobalNumCols() );
275 #endif
276  }
277 
278 
279 
281 // SET_PARAMETERS //
283 
284  template <class Matrix, class Vector>
285  void
286  STRUMPACK<Matrix,Vector>::setParameters_impl(const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
287  {
288  using Teuchos::as;
289  using Teuchos::RCP;
290  using Teuchos::getIntegralValue;
291  using Teuchos::ParameterEntryValidator;
292 
293  RCP<const Teuchos::ParameterList> valid_params = getValidParameters_impl();
294 
295  if( parameterList->isParameter("Matching") ){
296  RCP<const ParameterEntryValidator> matching_validator = valid_params->getEntry("Matching").validator();
297  parameterList->getEntry("Matching").setValidator(matching_validator);
298 
299  sp_->options().set_matching(getIntegralValue<strumpack::MatchingJob>(*parameterList, "Matching"));
300  }
301 
302  if( parameterList->isParameter("Ordering") ){
303  RCP<const ParameterEntryValidator> reordering_validator = valid_params->getEntry("Ordering").validator();
304  parameterList->getEntry("Ordering").setValidator(reordering_validator);
305 
306  sp_->options().set_reordering_method(getIntegralValue<strumpack::ReorderingStrategy>(*parameterList, "Ordering"));
307  }
308 
309  if( parameterList->isParameter("ReplaceTinyPivot") ){
310  RCP<const ParameterEntryValidator> replacepivot_validator = valid_params->getEntry("ReplaceTinyPivot").validator();
311  parameterList->getEntry("ReplaceTinyPivot").setValidator(replacepivot_validator);
312 
313  if( replacepivot_validator) {
314  sp_->options().enable_replace_tiny_pivots();
315  }
316  else{
317  sp_->options().disable_replace_tiny_pivots();
318  }
319  }
320 
321  if( parameterList->isParameter("IterRefine") ){
322  RCP<const ParameterEntryValidator> iter_refine_validator = valid_params->getEntry("IterRefine").validator();
323  parameterList->getEntry("IterRefine").setValidator(iter_refine_validator);
324 
325  sp_->options().set_Krylov_solver(getIntegralValue<strumpack::KrylovSolver>(*parameterList, "IterRefine"));
326  }
327 
328  if( parameterList->isParameter("Compression") ){
329  RCP<const ParameterEntryValidator> compression_validator = valid_params->getEntry("Compression").validator();
330  parameterList->getEntry("Compression").setValidator(compression_validator);
331 
332  sp_->options().set_compression(getIntegralValue<strumpack::CompressionType>(*parameterList, "Compression"));
333  }
334 
335  TEUCHOS_TEST_FOR_EXCEPTION( this->control_.useTranspose_,
336  std::invalid_argument,
337  "STRUMPACK does not support solving the tranpose system" );
338 
339  }
340 
341  template <class Matrix, class Vector>
342  Teuchos::RCP<const Teuchos::ParameterList>
344  {
345  using std::string;
346  using Teuchos::tuple;
347  using Teuchos::ParameterList;
348  using Teuchos::EnhancedNumberValidator;
349  using Teuchos::setStringToIntegralParameter;
350  using Teuchos::stringToIntegralParameterEntryValidator;
351 
352  static Teuchos::RCP<const Teuchos::ParameterList> valid_params;
353 
354  if( is_null(valid_params) ){
355  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
356 
357  setStringToIntegralParameter<strumpack::MatchingJob>("Matching", "NONE",
358  "Specifies how to permute the "
359  "matrix for numerical stability",
360  tuple<string>("NONE", "MAX_CARDINALITY", "MAX_SMALLEST_DIAGONAL", "MAX_SMALLEST_DIAGONAL_2", "MAX_DIAGONAL_SUM", "MAX_DIAGONAL_PRODUCT_SCALING", "COMBBLAS"),
361  tuple<string>("NONE", "MAX_CARDINALITY", "MAX_SMALLEST_DIAGONAL", "MAX_SMALLEST_DIAGONAL_2", "MAX_DIAGONAL_SUM", "MAX_DIAGONAL_PRODUCT_SCALING", "COMBBLAS"),
362  tuple<strumpack::MatchingJob>(strumpack::MatchingJob::NONE,
363  strumpack::MatchingJob::MAX_CARDINALITY,
364  strumpack::MatchingJob::MAX_SMALLEST_DIAGONAL,
365  strumpack::MatchingJob::MAX_SMALLEST_DIAGONAL_2,
366  strumpack::MatchingJob::MAX_DIAGONAL_SUM,
367  strumpack::MatchingJob::MAX_DIAGONAL_PRODUCT_SCALING,
368  strumpack::MatchingJob::COMBBLAS),
369  pl.getRawPtr());
370 
371 #if defined(STRUMPACK_USE_PARMETIS)
372  std::string default_ordering("PARMETIS");
373 #else
374  std::string default_ordering("METIS");
375 #endif
376  setStringToIntegralParameter<strumpack::ReorderingStrategy>("Ordering", default_ordering,
377  "Specifies how to permute the "
378  "matrix for sparsity preservation",
379  tuple<string>("NATURAL", "PARMETIS", "METIS", "SCOTCH", "GEOMETRIC", "PTSCOTCH", "RCM"),
380  tuple<string>("Natural ordering",
381  "ParMETIS ordering",
382  "Metis ordering",
383  "Scotch ordering",
384  "Geometric ordering",
385  "PTScotch ordering",
386  "RCM"),
387  tuple<strumpack::ReorderingStrategy>(strumpack::ReorderingStrategy::NATURAL,
388  strumpack::ReorderingStrategy::PARMETIS,
389  strumpack::ReorderingStrategy::METIS,
390  strumpack::ReorderingStrategy::SCOTCH,
391  strumpack::ReorderingStrategy::GEOMETRIC,
392  strumpack::ReorderingStrategy::PTSCOTCH,
393  strumpack::ReorderingStrategy::RCM),
394  pl.getRawPtr());
395 
396  pl->set("ReplaceTinyPivot", true, "Specifies whether to replace tiny diagonals during LU factorization");
397 
398 
399 // There are multiple options available for an iterative refinement,
400 // however we recommend the use of "DIRECT" within the Amesos2 interface
401  setStringToIntegralParameter<strumpack::KrylovSolver>("IterRefine", "DIRECT",
402  "Type of iterative refinement to use",
403  tuple<string>("AUTO", "DIRECT", "REFINE", "PREC_GMRES", "GMRES", "PREC_BICGSTAB", "BICGSTAB"),
404  tuple<string>("Use iterative refinement if no compression is used, otherwise use GMRes.",
405  "Single application of the multifrontal solver.",
406  "Iterative refinement.",
407  "Preconditioned GMRes.",
408  "UN-preconditioned GMRes.",
409  "Preconditioned BiCGStab.",
410  "UN-preconditioned BiCGStab."),
411  tuple<strumpack::KrylovSolver>(strumpack::KrylovSolver::AUTO,
412  strumpack::KrylovSolver::DIRECT,
413  strumpack::KrylovSolver::REFINE,
414  strumpack::KrylovSolver::PREC_GMRES,
415  strumpack::KrylovSolver::GMRES,
416  strumpack::KrylovSolver::PREC_BICGSTAB,
417  strumpack::KrylovSolver::BICGSTAB),
418  pl.getRawPtr());
419 
420 // There are multiple options available for the compression of the matrix,
421 // we recommend the use of "NONE" within the Amesos2 interface
422  setStringToIntegralParameter<strumpack::CompressionType>("Compression", "NONE",
423  "Type of compression to use",
424  tuple<string>("NONE", "HSS", "BLR", "HODLR", "LOSSLESS", "LOSSY"),
425  tuple<string>("No compression, purely direct solver.",
426  "HSS compression of frontal matrices.",
427  "Block low-rank compression of fronts.",
428  "Hierarchically Off-diagonal Low-Rank compression of frontal matrices.",
429  "Lossless compresssion.",
430  "Lossy compresssion."),
431  tuple<strumpack::CompressionType>(strumpack::CompressionType::NONE,
432  strumpack::CompressionType::HSS,
433  strumpack::CompressionType::BLR,
434  strumpack::CompressionType::HODLR,
435  strumpack::CompressionType::LOSSLESS,
436  strumpack::CompressionType::LOSSY),
437  pl.getRawPtr());
438 
439 
440 
441 
442  valid_params = pl;
443  }
444 
445  return valid_params;
446  }
447 
448 
449 
451 // LOAD_DATA //
453 
454  template <class Matrix, class Vector>
455  bool
457  using Teuchos::Array;
458  using Teuchos::ArrayView;
459  using Teuchos::ptrInArg;
460  using Teuchos::as;
461  using Teuchos::rcp_dynamic_cast; // Do I need this?
462 
463  using Teuchos::Comm;
464 #ifdef HAVE_MPI
465  using Teuchos::MpiComm;
466 
467  #ifdef HAVE_AMESOS2_TIMERS
468  Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
469  #endif
470 
471  Teuchos::RCP<const MatrixAdapter<Matrix> > redist_mat
472  = this->matrixA_->get(ptrInArg(*strumpack_rowmap_));
473 
474  typedef global_ordinal_type GO;
475  GO l_nnz, l_rows;
476  l_nnz = as<GO>(redist_mat->getLocalNNZ());
477  l_rows = as<GO>(redist_mat->getLocalNumRows());
478 
479  RCP<const Comm<int> > comm = this->getComm ();
480  RCP<const MpiComm<int> > mpiComm =
481  rcp_dynamic_cast<const MpiComm<int> > (comm);
482 
483  const int numProcs = comm->getSize ();
484  const int myRank = comm->getRank ();
485  Array<GO> dist(numProcs+1);
486  dist[0] = 0;
487  dist[myRank+1] = as<GO>(strumpack_rowmap_->getMaxGlobalIndex()) + 1;
488 
489  MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, dist.data()+1, sizeof(GO), MPI_BYTE,
490  mpiComm->getRawMpiComm()->operator()());
491  Kokkos::resize(nzvals_view_, l_nnz);
492  Kokkos::resize(colind_view_, l_nnz);
493  Kokkos::resize(rowptr_view_, l_rows + 1);
494 
495 
496  GO nnz_ret = 0;
497  {
498 #ifdef HAVE_AMESOS2_TIMERS
499  Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
500 #endif
501 
503  host_value_type_array, host_ordinal_type_array, host_ordinal_type_array >::do_get(
504  redist_mat.ptr(),
505  nzvals_view_, colind_view_, rowptr_view_,
506  nnz_ret,
507  ptrInArg(*strumpack_rowmap_),
508  ROOTED,
509  ARBITRARY);
510  }
511 
512 
513  TEUCHOS_TEST_FOR_EXCEPTION( nnz_ret != l_nnz,
514  std::runtime_error,
515  "Did not get the expected number of non-zero vals");
516 
517  // Get the csr data type for this type of matrix
518  sp_->set_distributed_csr_matrix
519  (l_rows, rowptr_view_.data(), colind_view_.data(),
520  nzvals_view_.data(), dist.getRawPtr(), false);
521 
522 #else
523 #ifdef HAVE_AMESOS2_TIMERS
524  Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
525 #endif
526 
527  typedef global_ordinal_type GO;
528  GO nnz_ret = 0;
529 
530  if( this->root_ ){
531  Kokkos::resize(nzvals_view_, this->globalNumNonZeros_);
532  Kokkos::resize(colind_view_, this->globalNumNonZeros_);
533  Kokkos::resize(rowptr_view_, this->globalNumRows_ + 1);
534  }
535  {
536 #ifdef HAVE_AMESOS2_TIMERS
537  Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
538 #endif
539 
541  host_value_type_array, host_ordinal_type_array, host_ordinal_type_array >::do_get(
542  this->matrixA_.ptr(),
543  nzvals_view_, colind_view_, rowptr_view_,
544  nnz_ret,
545  ROOTED,
546  ARBITRARY, this->rowIndexBase_);
547  }
548 
549  TEUCHOS_TEST_FOR_EXCEPTION( nnz_ret != this->globalNumNonZeros_,
550  std::runtime_error,
551  "Did not get the expected number of non-zero vals");
552 
553  // Get the csr data type for this type of matrix
554  sp_->set_csr_matrix(this->globalNumRows_, rowptr_view_.data(), colind_view_.data(),
555  nzvals_view_.data(), false);
556 
557 #endif
558  return true;
559  }
560 
561 
562  template<class Matrix, class Vector>
563  const char* STRUMPACK<Matrix,Vector>::name = "STRUMPACK";
564 
565 
566 } // end namespace Amesos2
567 #endif // AMESOS2_STRUMPACK_DEF_HPP
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Return a const parameter list of all of the valid parameters that this-&gt;setParameterList(...) will accept.
Definition: Amesos2_SolverCore_def.hpp:524
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers...
Definition: Amesos2_SolverCore_decl.hpp:71
STRUMPACK(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize from Teuchos::RCP.
Definition: Amesos2_STRUMPACK_def.hpp:32
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition: Amesos2_STRUMPACK_def.hpp:102
EPhase
Used to indicate a phase in the direct solution.
Definition: Amesos2_TypeDecl.hpp:31
super_type & setParameters(const Teuchos::RCP< Teuchos::ParameterList > &parameterList) override
Set/update internal variables and solver options.
Definition: Amesos2_SolverCore_def.hpp:492
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > &parameterList)
Definition: Amesos2_STRUMPACK_def.hpp:286
bool root_
If true, then this is the root processor.
Definition: Amesos2_SolverCore_decl.hpp:472
global_size_type globalNumRows_
Number of global rows in matrixA_.
Definition: Amesos2_SolverCore_decl.hpp:442
Helper class for getting 1-D copies of multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:233
int symbolicFactorization_impl()
Perform symbolic factorization of the matrix using STRUMPACK.
Definition: Amesos2_STRUMPACK_def.hpp:122
Utility functions for Amesos2.
Control control_
Parameters for solving.
Definition: Amesos2_SolverCore_decl.hpp:460
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const override
Returns a pointer to the Teuchos::Comm communicator with this operator.
Definition: Amesos2_SolverCore_decl.hpp:329
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition: Amesos2_STRUMPACK_def.hpp:268
bool loadA_impl(EPhase current_phase)
Reads matrix data into internal solver structures.
Definition: Amesos2_STRUMPACK_def.hpp:456
Similar to get_ccs_helper , but used to get a CRS representation of the given matrix.
Definition: Amesos2_Util.hpp:625
Amesos2 interface to STRUMPACK direct solver and preconditioner.
Definition: Amesos2_STRUMPACK_decl.hpp:37
~STRUMPACK()
Destructor.
Definition: Amesos2_STRUMPACK_def.hpp:92
Helper class for putting 1-D data arrays into multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:339
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:142
Teuchos::RCP< const MatrixAdapter< Matrix > > matrixA_
The LHS operator.
Definition: Amesos2_SolverCore_decl.hpp:421
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition: Amesos2_STRUMPACK_def.hpp:343
int solve_impl(const Teuchos::Ptr< MultiVecAdapter< Vector > > X, const Teuchos::Ptr< const MultiVecAdapter< Vector > > B) const
STRUMPACK specific solve.
Definition: Amesos2_STRUMPACK_def.hpp:169
int numericFactorization_impl()
STRUMPACK specific numeric factorization.
Definition: Amesos2_STRUMPACK_def.hpp:147