Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_CssMKL_def.hpp
Go to the documentation of this file.
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 
19 #ifndef AMESOS2_CSSMKL_DEF_HPP
20 #define AMESOS2_CSSMKL_DEF_HPP
21 
22 #include <map>
23 
24 #include <Teuchos_Tuple.hpp>
25 #include <Teuchos_toString.hpp>
26 #include <Teuchos_StandardParameterEntryValidators.hpp>
27 
29 #include "Amesos2_CssMKL_decl.hpp"
30 
31 
32 namespace Amesos2 {
33 
34  namespace PMKL {
35 # include <mkl.h>
36 # include <mkl_pardiso.h>
37  }
38 
39  template <class Matrix, class Vector>
40  CssMKL<Matrix,Vector>::CssMKL(Teuchos::RCP<const Matrix> A,
41  Teuchos::RCP<Vector> X,
42  Teuchos::RCP<const Vector> B)
43  : SolverCore<Amesos2::CssMKL,Matrix,Vector>(A, X, B) // instantiate superclass
44  , n_(Teuchos::as<int_t>(this->globalNumRows_))
45  , perm_(this->globalNumRows_)
46  , nrhs_(0)
47  , css_initialized_(false)
48  , is_contiguous_(true)
49  {
50  // set the default matrix type
52  set_css_mkl_default_parameters(pt_, iparm_);
53 
54  // index base
55  const global_ordinal_type indexBase = this->matrixA_->getRowMap ()->getIndexBase ();
56  iparm_[34] = (indexBase == 0 ? 1 : 0); /* Use one or zero-based indexing */
57  // 1D block-row distribution
58  auto frow = this->matrixA_->getRowMap()->getMinGlobalIndex();
59  auto nrows = this->matrixA_->getLocalNumRows();
60  iparm_[39] = 2; /* Matrix input format. */
61  iparm_[40] = frow; /* > Beginning of input domain. */
62  iparm_[41] = frow+nrows-1; /* > End of input domain. */
63 
64  // get MPI Comm
65  Teuchos::RCP<const Teuchos::Comm<int> > matComm = this->matrixA_->getComm ();
66  TEUCHOS_TEST_FOR_EXCEPTION(
67  matComm.is_null (), std::logic_error, "Amesos2::CssMKL "
68  "constructor: The matrix's communicator is null!");
69  Teuchos::RCP<const Teuchos::MpiComm<int> > matMpiComm =
70  Teuchos::rcp_dynamic_cast<const Teuchos::MpiComm<int> > (matComm);
71  TEUCHOS_TEST_FOR_EXCEPTION(
72  matMpiComm.is_null (), std::logic_error, "Amesos2::CssMKL "
73  "constructor: The matrix's communicator is not an MpiComm!");
74  TEUCHOS_TEST_FOR_EXCEPTION(
75  matMpiComm->getRawMpiComm ().is_null (), std::logic_error, "Amesos2::"
76  "CssMKL constructor: The matrix's communicator claims to be a "
77  "Teuchos::MpiComm<int>, but its getRawPtrComm() method returns "
78  "Teuchos::null! This means that the underlying MPI_Comm doesn't even "
79  "exist, which likely implies that the Teuchos::MpiComm was constructed "
80  "incorrectly. It means something different than if the MPI_Comm were "
81  "MPI_COMM_NULL.");
82  MPI_Comm CssComm = *(matMpiComm->getRawMpiComm ());
83  CssComm_ = MPI_Comm_c2f(CssComm);
84 
85  // rowmap for loadA (to have locally contiguous)
86  css_rowmap_ =
87  Teuchos::rcp (new map_type (this->globalNumRows_, nrows, indexBase, matComm));
88  }
89 
90 
91  template <class Matrix, class Vector>
93  {
94  /*
95  * Free any memory allocated by the CssMKL library functions
96  */
97  int_t error = 0;
98  if (css_initialized_)
99  {
100  int_t phase = -1; // release all internal solver memory
101  void *bdummy, *xdummy;
102  const MPI_Fint CssComm = CssComm_;
103  function_map::cluster_sparse_solver( pt_, const_cast<int_t*>(&maxfct_),
104  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
105  nzvals_view_.data(), rowptr_view_.data(),
106  colind_view_.data(), perm_.getRawPtr(), &nrhs_, iparm_,
107  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &CssComm, &error );
108  css_initialized_ = false;
109  }
110  check_css_mkl_error(Amesos2::CLEAN, error);
111  }
112 
113 
114  template<class Matrix, class Vector>
115  int
117  {
118  // preOrdering done during "Analysis" (aka symbolic
119  // factorization) phase
120  return(0);
121  }
122 
123 
124  template <class Matrix, class Vector>
125  int
127  {
128  int_t error = 0;
129  {
130 #ifdef HAVE_AMESOS2_TIMERS
131  Teuchos::TimeMonitor symbFactTimer( this->timers_.symFactTime_ );
132 #endif
133 
134  int_t phase = 11; // Analysis
135  void *bdummy, *xdummy;
136  const MPI_Fint CssComm = CssComm_;
137  function_map::cluster_sparse_solver( pt_, const_cast<int_t*>(&maxfct_),
138  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
139  nzvals_view_.data(), rowptr_view_.data(),
140  colind_view_.data(), perm_.getRawPtr(), &nrhs_, iparm_,
141  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &CssComm, &error );
142  }
143  check_css_mkl_error(Amesos2::SYMBFACT, error);
144 
145  // Pardiso only lets you retrieve the total number of factor
146  // non-zeros, not for each individually. We should document how
147  // such a situation is reported.
148  this->setNnzLU(iparm_[17]);
149  css_initialized_ = true;
150 
151  return(0);
152  }
153 
154 
155  template <class Matrix, class Vector>
156  int
158  {
159  int_t error = 0;
160  {
161 #ifdef HAVE_AMESOS2_TIMERS
162  Teuchos::TimeMonitor numFactTimer( this->timers_.numFactTime_ );
163 #endif
164 
165  //int_t phase = 12; // Analysis, numerical factorization
166  int_t phase = 22; // Numerical factorization
167  void *bdummy, *xdummy;
168  const MPI_Fint CssComm = CssComm_;
169  function_map::cluster_sparse_solver( pt_, const_cast<int_t*>(&maxfct_),
170  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
171  nzvals_view_.data(), rowptr_view_.data(),
172  colind_view_.data(), perm_.getRawPtr(), &nrhs_, iparm_,
173  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &CssComm, &error );
174  }
175  check_css_mkl_error(Amesos2::NUMFACT, error);
176 
177  return( 0 );
178  }
179 
180 
181  template <class Matrix, class Vector>
182  int
184  const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const
185  {
186  using Teuchos::as;
187 
188  // Get B data
189  const local_ordinal_type ld_rhs = this->matrixA_->getLocalNumRows();
190  nrhs_ = as<int_t>(X->getGlobalNumVectors());
191 
192  const size_t val_store_size = as<size_t>(ld_rhs * nrhs_);
193  xvals_.resize(val_store_size);
194  bvals_.resize(val_store_size);
195  {
196 #ifdef HAVE_AMESOS2_TIMERS
197  Teuchos::TimeMonitor mvConvTimer( this->timers_.vecConvTime_ );
198  Teuchos::TimeMonitor redistTimer( this->timers_.vecRedistTime_ );
199 #endif
200 
203  solver_scalar_type>::do_get(B, bvals_(),
204  as<size_t>(ld_rhs),
205  DISTRIBUTED_NO_OVERLAP,
206  this->rowIndexBase_);
207  }
208 
209  int_t error = 0;
210  {
211 #ifdef HAVE_AMESOS2_TIMERS
212  Teuchos::TimeMonitor solveTimer( this->timers_.solveTime_ );
213 #endif
214 
215  const int_t phase = 33; // Solve, iterative refinement
216  const MPI_Fint CssComm = CssComm_;
217  function_map::cluster_sparse_solver( pt_,
218  const_cast<int_t*>(&maxfct_),
219  const_cast<int_t*>(&mnum_),
220  const_cast<int_t*>(&mtype_),
221  const_cast<int_t*>(&phase),
222  const_cast<int_t*>(&n_),
223  const_cast<solver_scalar_type*>(nzvals_view_.data()),
224  const_cast<int_t*>(rowptr_view_.data()),
225  const_cast<int_t*>(colind_view_.data()),
226  const_cast<int_t*>(perm_.getRawPtr()),
227  &nrhs_,
228  const_cast<int_t*>(iparm_),
229  const_cast<int_t*>(&msglvl_),
230  as<void*>(bvals_.getRawPtr()),
231  as<void*>(xvals_.getRawPtr()), &CssComm, &error );
232  }
233  check_css_mkl_error(Amesos2::SOLVE, error);
234 
235  /* Get values to X */
236  {
237 #ifdef HAVE_AMESOS2_TIMERS
238  Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
239 #endif
240 
243  solver_scalar_type>::do_put(X, xvals_(),
244  as<size_t>(ld_rhs),
245  DISTRIBUTED_NO_OVERLAP);
246  }
247 
248  return( 0 );
249 }
250 
251 
252  template <class Matrix, class Vector>
253  bool
255  {
256  // CssMKL supports square matrices
257  return( this->globalNumRows_ == this->globalNumCols_ );
258  }
259 
260 
261  template <class Matrix, class Vector>
262  void
263  CssMKL<Matrix,Vector>::setParameters_impl(const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
264  {
265  using Teuchos::RCP;
266  using Teuchos::getIntegralValue;
267  using Teuchos::ParameterEntryValidator;
268 
269  RCP<const Teuchos::ParameterList> valid_params = getValidParameters_impl();
270 
271  // Fill-in reordering: 0 = minimum degree, 2 = METIS 4.0.1 (default), 3 = METIS 5.1, 4 = AMD,
272  if( parameterList->isParameter("IPARM(2)") )
273  {
274  RCP<const ParameterEntryValidator> fillin_validator = valid_params->getEntry("IPARM(2)").validator();
275  parameterList->getEntry("IPARM(2)").setValidator(fillin_validator);
276  iparm_[1] = getIntegralValue<int>(*parameterList, "IPARM(2)");
277  }
278 
279  // Max numbers of iterative refinement steps
280  if( parameterList->isParameter("IPARM(8)") )
281  {
282  RCP<const ParameterEntryValidator> refine_validator = valid_params->getEntry("IPARM(8)").validator();
283  parameterList->getEntry("IPARM(8)").setValidator(refine_validator);
284  iparm_[7] = getIntegralValue<int>(*parameterList, "IPARM(8)");
285  }
286 
287  // Perturb the pivot elements
288  if( parameterList->isParameter("IPARM(10)") )
289  {
290  RCP<const ParameterEntryValidator> pivot_perturb_validator = valid_params->getEntry("IPARM(10)").validator();
291  parameterList->getEntry("IPARM(10)").setValidator(pivot_perturb_validator);
292  iparm_[9] = getIntegralValue<int>(*parameterList, "IPARM(10)");
293  }
294 
295  // First check if the control object requests a transpose solve.
296  // Then solver specific options can override this.
297  iparm_[11] = this->control_.useTranspose_ ? 2 : 0;
298  // Normal solve (0), or a transpose solve (1)
299  if( parameterList->isParameter("IPARM(12)") )
300  {
301  RCP<const ParameterEntryValidator> trans_validator = valid_params->getEntry("IPARM(12)").validator();
302  parameterList->getEntry("IPARM(12)").setValidator(trans_validator);
303  iparm_[11] = getIntegralValue<int>(*parameterList, "IPARM(12)");
304  }
305 
306  // (Non-)symmetric matchings : detault 1 for nonsymmetric and 0 for symmetric matrix (default is nonsymmetric)
307  if( parameterList->isParameter("IPARM(13)") )
308  {
309  RCP<const ParameterEntryValidator> trans_validator = valid_params->getEntry("IPARM(13)").validator();
310  parameterList->getEntry("IPARM(13)").setValidator(trans_validator);
311  iparm_[12] = getIntegralValue<int>(*parameterList, "IPARM(13)");
312  }
313 
314  // Output: Number of nonzeros in the factor LU
315  if( parameterList->isParameter("IPARM(18)") )
316  {
317  RCP<const ParameterEntryValidator> report_validator = valid_params->getEntry("IPARM(18)").validator();
318  parameterList->getEntry("IPARM(18)").setValidator(report_validator);
319  iparm_[17] = getIntegralValue<int>(*parameterList, "IPARM(18)");
320  }
321 
322  if( parameterList->isParameter("IsContiguous") ){
323  is_contiguous_ = parameterList->get<bool>("IsContiguous");
324  }
325  }
326 
327 
328 /*
329  * TODO: It would be nice if the parameters could be expressed as
330  * either all string or as all integers. I see no way of doing this
331  * at present with the standard validators. However, we could create
332  * our own validators or kindly ask the Teuchos team to add some
333  * features for use.
334  *
335  * The issue is that with the current validators we cannot specify
336  * arbitrary sets of numbers that are the only allowed parameters.
337  * For example the IPARM(2) parameter can take only the values 0, 2,
338  * and 3. The EnhancedNumberValidator can take a min value, and max
339  * value, and a step size, but with those options there is no way to
340  * specify the needed set.
341  *
342  * Another missing feature is the ability to give docstrings for such
343  * numbers. For example IPARM(25) can take on the values 0 and 1.
344  * This would be easy enough to accomplish with just a number
345  * validator, but then have no way to document the effect of each
346  * value.
347  */
348 template <class Matrix, class Vector>
349 Teuchos::RCP<const Teuchos::ParameterList>
351 {
352  using std::string;
353  using Teuchos::as;
354  using Teuchos::RCP;
355  using Teuchos::tuple;
356  using Teuchos::toString;
357  using Teuchos::EnhancedNumberValidator;
358  using Teuchos::setStringToIntegralParameter;
359  using Teuchos::anyNumberParameterEntryValidator;
360 
361  static Teuchos::RCP<const Teuchos::ParameterList> valid_params;
362 
363  if( is_null(valid_params) ){
364  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
365 
366  void* pt_temp[64];
367  int_t iparm_temp[64];
368  set_css_mkl_default_parameters(pt_temp, iparm_temp);
369  setStringToIntegralParameter<int>("IPARM(2)", toString(iparm_temp[1]),
370  "Fill-in reducing ordering for the input matrix",
371  tuple<string>("2", "3", "10"),
372  tuple<string>("Nested dissection algorithm from METIS",
373  "Parallel version of the nested dissection algorithm",
374  "MPI version of the nested dissection and symbolic factorization algorithms"),
375  tuple<int>(2, 3, 10),
376  pl.getRawPtr());
377 
378  setStringToIntegralParameter<int>("IPARM(12)", toString(iparm_temp[11]),
379  "Solve with transposed or conjugate transposed matrix A",
380  tuple<string>("0", "1", "2"),
381  tuple<string>("Non-transposed",
382  "Conjugate-transposed",
383  "Transposed"),
384  tuple<int>(0, 1, 2),
385  pl.getRawPtr());
386 
387  setStringToIntegralParameter<int>("IPARM(13)", toString(iparm_temp[12]),
388  "Use weighted matching",
389  tuple<string>("0", "1"),
390  tuple<string>("No matching", "Use matching"),
391  tuple<int>(0, 1),
392  pl.getRawPtr());
393 
394  Teuchos::AnyNumberParameterEntryValidator::EPreferredType preferred_int =
395  Teuchos::AnyNumberParameterEntryValidator::PREFER_INT;
396 
397  Teuchos::AnyNumberParameterEntryValidator::AcceptedTypes accept_int( false );
398  accept_int.allowInt( true );
399 
400  pl->set("IPARM(8)" , as<int>(iparm_temp[7]) , "Iterative refinement step",
401  anyNumberParameterEntryValidator(preferred_int, accept_int));
402 
403  pl->set("IPARM(10)", as<int>(iparm_temp[9]) , "Pivoting perturbation",
404  anyNumberParameterEntryValidator(preferred_int, accept_int));
405 
406  pl->set("IPARM(18)", as<int>(iparm_temp[17]), "Report the number of non-zero elements in the factors",
407  anyNumberParameterEntryValidator(preferred_int, accept_int));
408 
409  pl->set("IsContiguous", true, "Whether GIDs contiguous");
410 
411  valid_params = pl;
412  }
413 
414  return valid_params;
415 }
416 
417 
418 
419 template <class Matrix, class Vector>
420 bool
422 {
423 #ifdef HAVE_AMESOS2_TIMERS
424  Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
425 #endif
426 
427  // CssMKL does not need matrix data in the pre-ordering phase
428  if( current_phase == PREORDERING ) return( false );
429 
430  EDistribution dist_option = (iparm_[39] != 0 ? DISTRIBUTED_NO_OVERLAP : ((is_contiguous_ == true) ? ROOTED : CONTIGUOUS_AND_ROOTED));
431  if (current_phase == SYMBFACT) {
432  if (dist_option == DISTRIBUTED_NO_OVERLAP) {
433  Kokkos::resize(nzvals_temp_, this->matrixA_->getLocalNNZ());
434  Kokkos::resize(nzvals_view_, this->matrixA_->getLocalNNZ());
435  Kokkos::resize(colind_view_, this->matrixA_->getLocalNNZ());
436  Kokkos::resize(rowptr_view_, this->matrixA_->getLocalNumRows() + 1);
437  } else {
438  if( this->root_ ) {
439  Kokkos::resize(nzvals_temp_, this->matrixA_->getGlobalNNZ());
440  Kokkos::resize(nzvals_view_, this->matrixA_->getGlobalNNZ());
441  Kokkos::resize(colind_view_, this->matrixA_->getGlobalNNZ());
442  Kokkos::resize(rowptr_view_, this->matrixA_->getGlobalNumRows() + 1);
443  } else {
444  Kokkos::resize(nzvals_temp_, 0);
445  Kokkos::resize(nzvals_view_, 0);
446  Kokkos::resize(colind_view_, 0);
447  Kokkos::resize(rowptr_view_, 0);
448  }
449  }
450  }
451 
452  {
453 #ifdef HAVE_AMESOS2_TIMERS
454  Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
455 #endif
456  int_t nnz_ret = 0;
458  host_value_type_array,host_ordinal_type_array, host_size_type_array >::do_get(
459  this->matrixA_.ptr(),
460  nzvals_temp_, colind_view_, rowptr_view_,
461  nnz_ret,
462  Teuchos::ptrInArg(*css_rowmap_),
463  dist_option,
464  SORTED_INDICES);
465  Kokkos::deep_copy(nzvals_view_, nzvals_temp_);
466  }
467  return( true );
468 }
469 
470 
471 template <class Matrix, class Vector>
472 void
474  int_t error) const
475 {
476  int error_i = error;
477  Teuchos::broadcast(*(this->getComm()), 0, &error_i); // We only care about root's value
478 
479  if( error == 0 ) return; // No error
480 
481  std::string errmsg = "Other error";
482  switch( error ){
483  case -1:
484  errmsg = "CssMKL reported error: 'Input inconsistent'";
485  break;
486  case -2:
487  errmsg = "CssMKL reported error: 'Not enough memory'";
488  break;
489  case -3:
490  errmsg = "CssMKL reported error: 'Reordering problem'";
491  break;
492  case -4:
493  errmsg =
494  "CssMKL reported error: 'Zero pivot, numerical "
495  "factorization or iterative refinement problem'";
496  break;
497  case -5:
498  errmsg = "CssMKL reported error: 'Unclassified (internal) error'";
499  break;
500  case -6:
501  errmsg = "CssMKL reported error: 'Reordering failed'";
502  break;
503  case -7:
504  errmsg = "CssMKL reported error: 'Diagonal matrix is singular'";
505  break;
506  case -8:
507  errmsg = "CssMKL reported error: '32-bit integer overflow problem'";
508  break;
509  case -9:
510  errmsg = "CssMKL reported error: 'Not enough memory for OOC'";
511  break;
512  case -10:
513  errmsg = "CssMKL reported error: 'Problems with opening OOC temporary files'";
514  break;
515  case -11:
516  errmsg = "CssMKL reported error: 'Read/write problem with OOC data file'";
517  break;
518  }
519  errmsg += (" at phase = "+std::to_string(phase));
520 
521  TEUCHOS_TEST_FOR_EXCEPTION( true, std::runtime_error, errmsg );
522 }
523 
524 
525 template <class Matrix, class Vector>
526 void
528 {
529  if( mtype == 0 ){
530  if( complex_ ){
531  mtype_ = 13; // complex, unsymmetric
532  } else {
533  mtype_ = 11; // real, unsymmetric
534  }
535  } else {
536  switch( mtype ){
537  case 11:
538  TEUCHOS_TEST_FOR_EXCEPTION( complex_,
539  std::invalid_argument,
540  "Cannot set a real Pardiso matrix type with scalar type complex" );
541  mtype_ = 11; break;
542  case 13:
543  TEUCHOS_TEST_FOR_EXCEPTION( !complex_,
544  std::invalid_argument,
545  "Cannot set a complex Pardiso matrix type with non-complex scalars" );
546  mtype_ = 13; break;
547  default:
548  TEUCHOS_TEST_FOR_EXCEPTION( true,
549  std::invalid_argument,
550  "Symmetric matrices are not yet supported by the Amesos2 interface" );
551  }
552  }
553 }
554 
555 template <class Matrix, class Vector>
556 void
557 CssMKL<Matrix,Vector>::set_css_mkl_default_parameters(void* pt[], int_t iparm[]) const
558 {
559  for( int i = 0; i < 64; ++i ){
560  pt[i] = nullptr;
561  iparm[i] = 0;
562  }
563  iparm[0] = 1; /* No solver default */
564  // Reset some of the default parameters
565  iparm[1] = 10; /* 2: Fill-in reordering from METIS, 3: thread dissection, 10: MPI version of the nested dissection and symbolic factorization*/
566  iparm[7] = 0; /* Max numbers of iterative refinement steps */
567  iparm[9] = 13; /* Perturb the pivot elements with 1E-13 */
568  iparm[10] = 0; /* Disable nonsymmetric permutation and scaling MPS */
569  iparm[11] = 0; /* Normal solve (0), or a transpose solve (1) */
570  iparm[12] = 0; /* Do not use (non-)symmetric matchings */
571  iparm[17] = -1; /* Output: Number of nonzeros in the factor LU */
572  iparm[20] = -1; /* Pivoting for symmetric indefinite matrices */
573  iparm[26] = 1; /* Check input matrix is sorted */
574 
575  // set single or double precision
576  if constexpr ( std::is_same_v<solver_magnitude_type, PMKL::_REAL_t> ) {
577  iparm[27] = 1; // single-precision
578  } else {
579  iparm[27] = 0; // double-precision
580  }
581  iparm[34] = 1; /* Use zero-based indexing */
582 }
583 
584 template <class Matrix, class Vector>
585 const char* CssMKL<Matrix,Vector>::name = "CSSMKL";
586 
587 template <class Matrix, class Vector>
588 const typename CssMKL<Matrix,Vector>::int_t
589 CssMKL<Matrix,Vector>::msglvl_ = 0; // set to be one, for more CSS messages
590 
591 template <class Matrix, class Vector>
592 const typename CssMKL<Matrix,Vector>::int_t
593 CssMKL<Matrix,Vector>::maxfct_ = 1;
594 
595 template <class Matrix, class Vector>
596 const typename CssMKL<Matrix,Vector>::int_t
597 CssMKL<Matrix,Vector>::mnum_ = 1;
598 
599 
600 } // end namespace Amesos
601 
602 #endif // AMESOS2_CSSMKL_DEF_HPP
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers...
Definition: Amesos2_SolverCore_decl.hpp:71
EPhase
Used to indicate a phase in the direct solution.
Definition: Amesos2_TypeDecl.hpp:31
void check_css_mkl_error(EPhase phase, int_t error) const
Throws an appropriate runtime error in the event that error &lt; 0 .
Definition: Amesos2_CssMKL_def.hpp:473
Amesos2 interface to the CssMKL package.
Definition: Amesos2_CssMKL_decl.hpp:49
~CssMKL()
Destructor.
Definition: Amesos2_CssMKL_def.hpp:92
global_size_type globalNumRows_
Number of global rows in matrixA_.
Definition: Amesos2_SolverCore_decl.hpp:442
int_t iparm_[64]
Definition: Amesos2_CssMKL_decl.hpp:276
Helper class for getting 1-D copies of multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:233
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition: Amesos2_CssMKL_def.hpp:116
CssMKL(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize from Teuchos::RCP.
Definition: Amesos2_CssMKL_def.hpp:40
void set_css_mkl_matrix_type(int_t mtype=0)
Definition: Amesos2_CssMKL_def.hpp:527
bool loadA_impl(EPhase current_phase)
Reads matrix data into internal structures.
Definition: Amesos2_CssMKL_def.hpp:421
A template class that does nothing useful besides show developers what, in general, needs to be done to add a new solver interface to the Amesos2 collection.
int numericFactorization_impl()
CssMKL specific numeric factorization.
Definition: Amesos2_CssMKL_def.hpp:157
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition: Amesos2_CssMKL_def.hpp:254
int solve_impl(const Teuchos::Ptr< MultiVecAdapter< Vector > > X, const Teuchos::Ptr< const MultiVecAdapter< Vector > > B) const
CssMKL specific solve.
Definition: Amesos2_CssMKL_def.hpp:183
void * pt_[64]
CssMKL internal data address pointer.
Definition: Amesos2_CssMKL_decl.hpp:261
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition: Amesos2_CssMKL_def.hpp:350
Similar to get_ccs_helper , but used to get a CRS representation of the given matrix.
Definition: Amesos2_Util.hpp:625
int symbolicFactorization_impl()
Perform symbolic factorization of the matrix using CssMKL.
Definition: Amesos2_CssMKL_def.hpp:126
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > &parameterList)
Definition: Amesos2_CssMKL_def.hpp:263
EDistribution
Definition: Amesos2_TypeDecl.hpp:89
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