Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_PardisoMKL_def.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Amesos2: Templated Direct Sparse Solver Package
6 // Copyright 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ***********************************************************************
41 //
42 // @HEADER
43 
44 
53 #ifndef AMESOS2_PARDISOMKL_DEF_HPP
54 #define AMESOS2_PARDISOMKL_DEF_HPP
55 
56 #include <map>
57 
58 #include <Teuchos_Tuple.hpp>
59 #include <Teuchos_toString.hpp>
60 #include <Teuchos_StandardParameterEntryValidators.hpp>
61 
64 
65 
66 namespace Amesos2 {
67 
68  namespace PMKL {
69 # include <mkl.h>
70 # include <mkl_pardiso.h>
71  }
72 
73  template <class Matrix, class Vector>
74  PardisoMKL<Matrix,Vector>::PardisoMKL(Teuchos::RCP<const Matrix> A,
75  Teuchos::RCP<Vector> X,
76  Teuchos::RCP<const Vector> B)
77  : SolverCore<Amesos2::PardisoMKL,Matrix,Vector>(A, X, B) // instantiate superclass
78  , n_(Teuchos::as<int_t>(this->globalNumRows_))
79  , perm_(this->globalNumRows_)
80  , nrhs_(0)
81  , is_contiguous_(true)
82  {
83  // set the default matrix type
85 
86  PMKL::_INTEGER_t iparm_temp[64];
87  PMKL::_INTEGER_t mtype_temp = mtype_;
88  PMKL::pardisoinit(pt_, &mtype_temp, iparm_temp);
89 
90  for( int i = 0; i < 64; ++i ){
91  iparm_[i] = iparm_temp[i];
92  }
93 
94  // set single or double precision
95  if constexpr ( std::is_same_v<solver_magnitude_type, PMKL::_REAL_t> ) {
96  iparm_[27] = 1; // single-precision
97  } else {
98  iparm_[27] = 0; // double-precision
99  }
100 
101  // Reset some of the default parameters
102  iparm_[34] = 1; // Use zero-based indexing
103 #ifdef HAVE_AMESOS2_DEBUG
104  iparm_[26] = 1; // turn the Pardiso matrix checker on
105 #endif
106  }
107 
108 
109  template <class Matrix, class Vector>
111  {
112  /*
113  * Free any memory allocated by the PardisoMKL library functions
114  */
115  int_t error = 0;
116  void *bdummy, *xdummy;
117 
118  if( this->root_ ){
119  int_t phase = -1; // release all internal solver memory
120  function_map::pardiso( pt_, const_cast<int_t*>(&maxfct_),
121  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
122  nzvals_view_.data(), rowptr_view_.data(),
123  colind_view_.data(), perm_.getRawPtr(), &nrhs_, iparm_,
124  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &error );
125  }
126 
127  check_pardiso_mkl_error(Amesos2::CLEAN, error);
128  }
129 
130 
131  template<class Matrix, class Vector>
132  int
134  {
135  // preOrdering done in PardisoMKL during "Analysis" (aka symbolic
136  // factorization) phase
137 
138  return(0);
139  }
140 
141 
142  template <class Matrix, class Vector>
143  int
145  {
146  int_t error = 0;
147 
148  if( this->root_ ){
149 #ifdef HAVE_AMESOS2_TIMERS
150  Teuchos::TimeMonitor symbFactTimer( this->timers_.symFactTime_ );
151 #endif
152 
153  int_t phase = 11;
154  void *bdummy, *xdummy;
155 
156  function_map::pardiso( pt_, const_cast<int_t*>(&maxfct_),
157  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
158  nzvals_view_.data(), rowptr_view_.data(),
159  colind_view_.data(), perm_.getRawPtr(), &nrhs_, iparm_,
160  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &error );
161  }
162 
163  check_pardiso_mkl_error(Amesos2::SYMBFACT, error);
164 
165  // Pardiso only lets you retrieve the total number of factor
166  // non-zeros, not for each individually. We should document how
167  // such a situation is reported.
168  this->setNnzLU(iparm_[17]);
169 
170  return(0);
171  }
172 
173 
174  template <class Matrix, class Vector>
175  int
177  {
178  int_t error = 0;
179 
180  if( this->root_ ){
181 #ifdef HAVE_AMESOS2_TIMERS
182  Teuchos::TimeMonitor numFactTimer( this->timers_.numFactTime_ );
183 #endif
184 
185  int_t phase = 22;
186  void *bdummy, *xdummy;
187 
188  function_map::pardiso( pt_, const_cast<int_t*>(&maxfct_),
189  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
190  nzvals_view_.data(), rowptr_view_.data(),
191  colind_view_.data(), perm_.getRawPtr(), &nrhs_, iparm_,
192  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &error );
193  }
194 
195  check_pardiso_mkl_error(Amesos2::NUMFACT, error);
196 
197  return( 0 );
198  }
199 
200 
201  template <class Matrix, class Vector>
202  int
204  const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const
205  {
206  using Teuchos::as;
207 
208  int_t error = 0;
209 
210  // Get B data
211  const global_size_type ld_rhs = this->root_ ? X->getGlobalLength() : 0;
212  nrhs_ = as<int_t>(X->getGlobalNumVectors());
213 
214  const size_t val_store_size = as<size_t>(ld_rhs * nrhs_);
215  xvals_.resize(val_store_size);
216  bvals_.resize(val_store_size);
217 
218  { // Get values from RHS B
219 #ifdef HAVE_AMESOS2_TIMERS
220  Teuchos::TimeMonitor mvConvTimer( this->timers_.vecConvTime_ );
221  Teuchos::TimeMonitor redistTimer( this->timers_.vecRedistTime_ );
222 #endif
223 
226  solver_scalar_type>::do_get(B, bvals_(),
227  as<size_t>(ld_rhs),
228  (is_contiguous_ == true) ? ROOTED : CONTIGUOUS_AND_ROOTED,
229  this->rowIndexBase_);
230  }
231 
232  if( this->root_ ){
233 #ifdef HAVE_AMESOS2_TIMERS
234  Teuchos::TimeMonitor solveTimer( this->timers_.solveTime_ );
235 #endif
236 
237  const int_t phase = 33;
238 
239  function_map::pardiso( pt_,
240  const_cast<int_t*>(&maxfct_),
241  const_cast<int_t*>(&mnum_),
242  const_cast<int_t*>(&mtype_),
243  const_cast<int_t*>(&phase),
244  const_cast<int_t*>(&n_),
245  const_cast<solver_scalar_type*>(nzvals_view_.data()),
246  const_cast<int_t*>(rowptr_view_.data()),
247  const_cast<int_t*>(colind_view_.data()),
248  const_cast<int_t*>(perm_.getRawPtr()),
249  &nrhs_,
250  const_cast<int_t*>(iparm_),
251  const_cast<int_t*>(&msglvl_),
252  as<void*>(bvals_.getRawPtr()),
253  as<void*>(xvals_.getRawPtr()), &error );
254  }
255 
256  check_pardiso_mkl_error(Amesos2::SOLVE, error);
257 
258  /* Export X from root to the global space */
259  {
260 #ifdef HAVE_AMESOS2_TIMERS
261  Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
262 #endif
263 
266  solver_scalar_type>::do_put(X, xvals_(),
267  as<size_t>(ld_rhs),
268  (is_contiguous_ == true) ? ROOTED : CONTIGUOUS_AND_ROOTED);
269  }
270 
271  return( 0 );
272 }
273 
274 
275  template <class Matrix, class Vector>
276  bool
278  {
279  // PardisoMKL supports square matrices
280  return( this->globalNumRows_ == this->globalNumCols_ );
281  }
282 
283 
284  template <class Matrix, class Vector>
285  void
286  PardisoMKL<Matrix,Vector>::setParameters_impl(const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
287  {
288  using Teuchos::RCP;
289  using Teuchos::getIntegralValue;
290  using Teuchos::ParameterEntryValidator;
291 
292  RCP<const Teuchos::ParameterList> valid_params = getValidParameters_impl();
293 
294  if( parameterList->isParameter("IPARM(2)") )
295  {
296  RCP<const ParameterEntryValidator> fillin_validator = valid_params->getEntry("IPARM(2)").validator();
297  parameterList->getEntry("IPARM(2)").setValidator(fillin_validator);
298  iparm_[1] = getIntegralValue<int>(*parameterList, "IPARM(2)");
299  }
300 
301  if( parameterList->isParameter("IPARM(4)") )
302  {
303  RCP<const ParameterEntryValidator> prec_validator = valid_params->getEntry("IPARM(4)").validator();
304  parameterList->getEntry("IPARM(4)").setValidator(prec_validator);
305  iparm_[3] = getIntegralValue<int>(*parameterList, "IPARM(4)");
306  }
307 
308  if( parameterList->isParameter("IPARM(8)") )
309  {
310  RCP<const ParameterEntryValidator> refine_validator = valid_params->getEntry("IPARM(8)").validator();
311  parameterList->getEntry("IPARM(8)").setValidator(refine_validator);
312  iparm_[7] = getIntegralValue<int>(*parameterList, "IPARM(8)");
313  }
314 
315  if( parameterList->isParameter("IPARM(10)") )
316  {
317  RCP<const ParameterEntryValidator> pivot_perturb_validator = valid_params->getEntry("IPARM(10)").validator();
318  parameterList->getEntry("IPARM(10)").setValidator(pivot_perturb_validator);
319  iparm_[9] = getIntegralValue<int>(*parameterList, "IPARM(10)");
320  }
321 
322  // First check if the control object requests a transpose solve.
323  // Then solver specific options can override this.
324  iparm_[11] = this->control_.useTranspose_ ? 2 : 0;
325 
326  if( parameterList->isParameter("IPARM(12)") )
327  {
328  RCP<const ParameterEntryValidator> trans_validator = valid_params->getEntry("IPARM(12)").validator();
329  parameterList->getEntry("IPARM(12)").setValidator(trans_validator);
330  iparm_[11] = getIntegralValue<int>(*parameterList, "IPARM(12)");
331  }
332 
333  if( parameterList->isParameter("IPARM(18)") )
334  {
335  RCP<const ParameterEntryValidator> report_validator = valid_params->getEntry("IPARM(18)").validator();
336  parameterList->getEntry("IPARM(18)").setValidator(report_validator);
337  iparm_[17] = getIntegralValue<int>(*parameterList, "IPARM(18)");
338  }
339 
340  if( parameterList->isParameter("IPARM(24)") )
341  {
342  RCP<const ParameterEntryValidator> par_fact_validator = valid_params->getEntry("IPARM(24)").validator();
343  parameterList->getEntry("IPARM(24)").setValidator(par_fact_validator);
344  iparm_[23] = getIntegralValue<int>(*parameterList, "IPARM(24)");
345  }
346 
347  if( parameterList->isParameter("IPARM(25)") )
348  {
349  RCP<const ParameterEntryValidator> par_fbsolve_validator = valid_params->getEntry("IPARM(25)").validator();
350  parameterList->getEntry("IPARM(25)").setValidator(par_fbsolve_validator);
351  iparm_[24] = getIntegralValue<int>(*parameterList, "IPARM(25)");
352  }
353 
354  if( parameterList->isParameter("IPARM(60)") )
355  {
356  RCP<const ParameterEntryValidator> ooc_validator = valid_params->getEntry("IPARM(60)").validator();
357  parameterList->getEntry("IPARM(60)").setValidator(ooc_validator);
358  iparm_[59] = getIntegralValue<int>(*parameterList, "IPARM(60)");
359  }
360 
361  if( parameterList->isParameter("IsContiguous") ){
362  is_contiguous_ = parameterList->get<bool>("IsContiguous");
363  }
364  }
365 
366 
367 /*
368  * TODO: It would be nice if the parameters could be expressed as
369  * either all string or as all integers. I see no way of doing this
370  * at present with the standard validators. However, we could create
371  * our own validators or kindly ask the Teuchos team to add some
372  * features for use.
373  *
374  * The issue is that with the current validators we cannot specify
375  * arbitrary sets of numbers that are the only allowed parameters.
376  * For example the IPARM(2) parameter can take only the values 0, 2,
377  * and 3. The EnhancedNumberValidator can take a min value, and max
378  * value, and a step size, but with those options there is no way to
379  * specify the needed set.
380  *
381  * Another missing feature is the ability to give docstrings for such
382  * numbers. For example IPARM(25) can take on the values 0 and 1.
383  * This would be easy enough to accomplish with just a number
384  * validator, but then have no way to document the effect of each
385  * value.
386  */
387 template <class Matrix, class Vector>
388 Teuchos::RCP<const Teuchos::ParameterList>
390 {
391  using std::string;
392  using Teuchos::as;
393  using Teuchos::RCP;
394  using Teuchos::tuple;
395  using Teuchos::toString;
396  using Teuchos::EnhancedNumberValidator;
397  using Teuchos::setStringToIntegralParameter;
398  using Teuchos::anyNumberParameterEntryValidator;
399 
400  static Teuchos::RCP<const Teuchos::ParameterList> valid_params;
401 
402  if( is_null(valid_params) ){
403  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
404 
405  // Use pardisoinit to get some default values;
406  void *pt_dummy[64];
407  PMKL::_INTEGER_t mtype_temp = mtype_;
408  PMKL::_INTEGER_t iparm_temp[64];
409  PMKL::pardisoinit(pt_dummy,
410  const_cast<PMKL::_INTEGER_t*>(&mtype_temp),
411  const_cast<PMKL::_INTEGER_t*>(iparm_temp));
412 
413  setStringToIntegralParameter<int>("IPARM(2)", toString(iparm_temp[1]),
414  "Fill-in reducing ordering for the input matrix",
415  tuple<string>("0", "2", "3"),
416  tuple<string>("The minimum degree algorithm",
417  "Nested dissection algorithm from METIS",
418  "OpenMP parallel nested dissection algorithm"),
419  tuple<int>(0, 2, 3),
420  pl.getRawPtr());
421 
422  Teuchos::RCP<EnhancedNumberValidator<int> > iparm_4_validator
423  = Teuchos::rcp( new EnhancedNumberValidator<int>() );
424  iparm_4_validator->setMin(0);
425  pl->set("IPARM(4)" , as<int>(iparm_temp[3]) , "Preconditioned CGS/CG",
426  iparm_4_validator);
427 
428  setStringToIntegralParameter<int>("IPARM(12)", toString(iparm_temp[11]),
429  "Solve with transposed or conjugate transposed matrix A",
430  tuple<string>("0", "1", "2"),
431  tuple<string>("Non-transposed",
432  "Conjugate-transposed",
433  "Transposed"),
434  tuple<int>(0, 1, 2),
435  pl.getRawPtr());
436 
437  setStringToIntegralParameter<int>("IPARM(24)", toString(iparm_temp[23]),
438  "Parallel factorization control",
439  tuple<string>("0", "1"),
440  tuple<string>("PARDISO uses the previous algorithm for factorization",
441  "PARDISO uses the new two-level factorization algorithm"),
442  tuple<int>(0, 1),
443  pl.getRawPtr());
444 
445  setStringToIntegralParameter<int>("IPARM(25)", toString(iparm_temp[24]),
446  "Parallel forward/backward solve control",
447  tuple<string>("0", "1"),
448  tuple<string>("PARDISO uses the parallel algorithm for the solve step",
449  "PARDISO uses the sequential forward and backward solve"),
450  tuple<int>(0, 1),
451  pl.getRawPtr());
452 
453  setStringToIntegralParameter<int>("IPARM(60)", toString(iparm_temp[59]),
454  "PARDISO mode (OOC mode)",
455  tuple<string>("0", "2"),
456  tuple<string>("In-core PARDISO",
457  "Out-of-core PARDISO. The OOC PARDISO can solve very "
458  "large problems by holding the matrix factors in files "
459  "on the disk. Hence the amount of RAM required by OOC "
460  "PARDISO is significantly reduced."),
461  tuple<int>(0, 2),
462  pl.getRawPtr());
463 
464  Teuchos::AnyNumberParameterEntryValidator::EPreferredType preferred_int =
465  Teuchos::AnyNumberParameterEntryValidator::PREFER_INT;
466 
467  Teuchos::AnyNumberParameterEntryValidator::AcceptedTypes accept_int( false );
468  accept_int.allowInt( true );
469 
470  pl->set("IPARM(8)" , as<int>(iparm_temp[8]) , "Iterative refinement step",
471  anyNumberParameterEntryValidator(preferred_int, accept_int));
472 
473  pl->set("IPARM(10)", as<int>(iparm_temp[9]) , "Pivoting perturbation",
474  anyNumberParameterEntryValidator(preferred_int, accept_int));
475 
476  pl->set("IPARM(18)", as<int>(iparm_temp[17]), "Report the number of non-zero elements in the factors",
477  anyNumberParameterEntryValidator(preferred_int, accept_int));
478 
479  pl->set("IsContiguous", true, "Whether GIDs contiguous");
480 
481  valid_params = pl;
482  }
483 
484  return valid_params;
485 }
486 
487 
488 
489 template <class Matrix, class Vector>
490 bool
492 {
493 #ifdef HAVE_AMESOS2_TIMERS
494  Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
495 #endif
496 
497  // PardisoMKL does not need matrix data in the pre-ordering phase
498  if( current_phase == PREORDERING ) return( false );
499 
500  if( this->root_ ){
501  Kokkos::resize(nzvals_view_, this->globalNumNonZeros_);
502  Kokkos::resize(colind_view_, this->globalNumNonZeros_);
503  Kokkos::resize(rowptr_view_, this->globalNumRows_ + 1);
504  }
505 
506  int_t nnz_ret = 0;
507  {
508 #ifdef HAVE_AMESOS2_TIMERS
509  Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
510 #endif
511 
514  host_value_type_array, host_ordinal_type_array, host_size_type_array>::do_get(
515  this->matrixA_.ptr(),
516  nzvals_view_, colind_view_, rowptr_view_, nnz_ret,
517  (is_contiguous_ == true) ? ROOTED : CONTIGUOUS_AND_ROOTED,
518  SORTED_INDICES,
519  this->rowIndexBase_);
520  }
521 
522  return( true );
523 }
524 
525 
526 template <class Matrix, class Vector>
527 void
529  int_t error) const
530 {
531  int error_i = error;
532  Teuchos::broadcast(*(this->getComm()), 0, &error_i); // We only care about root's value
533 
534  if( error == 0 ) return; // No error
535 
536  std::string errmsg = "Other error";
537  switch( error ){
538  case -1:
539  errmsg = "PardisoMKL reported error: 'Input inconsistent'";
540  break;
541  case -2:
542  errmsg = "PardisoMKL reported error: 'Not enough memory'";
543  break;
544  case -3:
545  errmsg = "PardisoMKL reported error: 'Reordering problem'";
546  break;
547  case -4:
548  errmsg =
549  "PardisoMKL reported error: 'Zero pivot, numerical "
550  "factorization or iterative refinement problem'";
551  break;
552  case -5:
553  errmsg = "PardisoMKL reported error: 'Unclassified (internal) error'";
554  break;
555  case -6:
556  errmsg = "PardisoMKL reported error: 'Reordering failed'";
557  break;
558  case -7:
559  errmsg = "PardisoMKL reported error: 'Diagonal matrix is singular'";
560  break;
561  case -8:
562  errmsg = "PardisoMKL reported error: '32-bit integer overflow problem'";
563  break;
564  case -9:
565  errmsg = "PardisoMKL reported error: 'Not enough memory for OOC'";
566  break;
567  case -10:
568  errmsg = "PardisoMKL reported error: 'Problems with opening OOC temporary files'";
569  break;
570  case -11:
571  errmsg = "PardisoMKL reported error: 'Read/write problem with OOC data file'";
572  break;
573  }
574 
575  TEUCHOS_TEST_FOR_EXCEPTION( true, std::runtime_error, errmsg );
576 }
577 
578 
579 template <class Matrix, class Vector>
580 void
582 {
583  if( mtype == 0 ){
584  if( complex_ ){
585  mtype_ = 13; // complex, unsymmetric
586  } else {
587  mtype_ = 11; // real, unsymmetric
588  }
589  } else {
590  switch( mtype ){
591  case 11:
592  TEUCHOS_TEST_FOR_EXCEPTION( complex_,
593  std::invalid_argument,
594  "Cannot set a real Pardiso matrix type with scalar type complex" );
595  mtype_ = 11; break;
596  case 13:
597  TEUCHOS_TEST_FOR_EXCEPTION( !complex_,
598  std::invalid_argument,
599  "Cannot set a complex Pardiso matrix type with non-complex scalars" );
600  mtype_ = 13; break;
601  default:
602  TEUCHOS_TEST_FOR_EXCEPTION( true,
603  std::invalid_argument,
604  "Symmetric matrices are not yet supported by the Amesos2 interface" );
605  }
606  }
607 }
608 
609 
610 template <class Matrix, class Vector>
611 const char* PardisoMKL<Matrix,Vector>::name = "PARDISOMKL";
612 
613 template <class Matrix, class Vector>
614 const typename PardisoMKL<Matrix,Vector>::int_t
616 
617 template <class Matrix, class Vector>
618 const typename PardisoMKL<Matrix,Vector>::int_t
620 
621 template <class Matrix, class Vector>
622 const typename PardisoMKL<Matrix,Vector>::int_t
624 
625 
626 } // end namespace Amesos
627 
628 #endif // AMESOS2_PARDISOMKL_DEF_HPP
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers...
Definition: Amesos2_SolverCore_decl.hpp:105
~PardisoMKL()
Destructor.
Definition: Amesos2_PardisoMKL_def.hpp:110
PardisoMKL(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize from Teuchos::RCP.
Definition: Amesos2_PardisoMKL_def.hpp:74
EPhase
Used to indicate a phase in the direct solution.
Definition: Amesos2_TypeDecl.hpp:65
void set_pardiso_mkl_matrix_type(int_t mtype=0)
Definition: Amesos2_PardisoMKL_def.hpp:581
Helper class for getting 1-D copies of multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:267
void * pt_[64]
PardisoMKL internal data address pointer.
Definition: Amesos2_PardisoMKL_decl.hpp:289
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.
Amesos2 interface to the PardisoMKL package.
Definition: Amesos2_PardisoMKL_decl.hpp:83
int numericFactorization_impl()
PardisoMKL specific numeric factorization.
Definition: Amesos2_PardisoMKL_def.hpp:176
int symbolicFactorization_impl()
Perform symbolic factorization of the matrix using PardisoMKL.
Definition: Amesos2_PardisoMKL_def.hpp:144
A Matrix adapter interface for Amesos2.
Definition: Amesos2_MatrixAdapter_decl.hpp:76
bool loadA_impl(EPhase current_phase)
Reads matrix data into internal structures.
Definition: Amesos2_PardisoMKL_def.hpp:491
Similar to get_ccs_helper , but used to get a CRS representation of the given matrix.
Definition: Amesos2_Util.hpp:659
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > &parameterList)
Definition: Amesos2_PardisoMKL_def.hpp:286
int solve_impl(const Teuchos::Ptr< MultiVecAdapter< Vector > > X, const Teuchos::Ptr< const MultiVecAdapter< Vector > > B) const
PardisoMKL specific solve.
Definition: Amesos2_PardisoMKL_def.hpp:203
void check_pardiso_mkl_error(EPhase phase, int_t error) const
Throws an appropriate runtime error in the event that error &lt; 0 .
Definition: Amesos2_PardisoMKL_def.hpp:528
Helper class for putting 1-D data arrays into multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:373
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:176
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition: Amesos2_PardisoMKL_def.hpp:389
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition: Amesos2_PardisoMKL_def.hpp:277
int_t mtype_
The matrix type. We deal only with unsymmetrix matrices.
Definition: Amesos2_PardisoMKL_decl.hpp:291
int_t iparm_[64]
Definition: Amesos2_PardisoMKL_decl.hpp:301
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition: Amesos2_PardisoMKL_def.hpp:133