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( Meta::is_same<solver_magnitude_type, PMKL::_REAL_t>::value ){
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 
224  if ( is_contiguous_ == true ) {
227  solver_scalar_type>::do_get(B, bvals_(),
228  as<size_t>(ld_rhs),
229  ROOTED, this->rowIndexBase_);
230  }
231  else {
234  solver_scalar_type>::do_get(B, bvals_(),
235  as<size_t>(ld_rhs),
236  CONTIGUOUS_AND_ROOTED, this->rowIndexBase_);
237  }
238  }
239 
240  if( this->root_ ){
241 #ifdef HAVE_AMESOS2_TIMERS
242  Teuchos::TimeMonitor solveTimer( this->timers_.solveTime_ );
243 #endif
244 
245  const int_t phase = 33;
246 
247  function_map::pardiso( pt_,
248  const_cast<int_t*>(&maxfct_),
249  const_cast<int_t*>(&mnum_),
250  const_cast<int_t*>(&mtype_),
251  const_cast<int_t*>(&phase),
252  const_cast<int_t*>(&n_),
253  const_cast<solver_scalar_type*>(nzvals_view_.data()),
254  const_cast<int_t*>(rowptr_view_.data()),
255  const_cast<int_t*>(colind_view_.data()),
256  const_cast<int_t*>(perm_.getRawPtr()),
257  &nrhs_,
258  const_cast<int_t*>(iparm_),
259  const_cast<int_t*>(&msglvl_),
260  as<void*>(bvals_.getRawPtr()),
261  as<void*>(xvals_.getRawPtr()), &error );
262  }
263 
264  check_pardiso_mkl_error(Amesos2::SOLVE, error);
265 
266  /* Export X from root to the global space */
267  {
268 #ifdef HAVE_AMESOS2_TIMERS
269  Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
270 #endif
271 
272  if ( is_contiguous_ == true ) {
275  solver_scalar_type>::do_put(X, xvals_(),
276  as<size_t>(ld_rhs),
277  ROOTED);
278  }
279  else {
282  solver_scalar_type>::do_put(X, xvals_(),
283  as<size_t>(ld_rhs),
285  }
286  }
287 
288  return( 0 );
289 }
290 
291 
292  template <class Matrix, class Vector>
293  bool
295  {
296  // PardisoMKL supports square matrices
297  return( this->globalNumRows_ == this->globalNumCols_ );
298  }
299 
300 
301  template <class Matrix, class Vector>
302  void
303  PardisoMKL<Matrix,Vector>::setParameters_impl(const Teuchos::RCP<Teuchos::ParameterList> & parameterList )
304  {
305  using Teuchos::RCP;
306  using Teuchos::getIntegralValue;
307  using Teuchos::ParameterEntryValidator;
308 
309  RCP<const Teuchos::ParameterList> valid_params = getValidParameters_impl();
310 
311  if( parameterList->isParameter("IPARM(2)") )
312  {
313  RCP<const ParameterEntryValidator> fillin_validator = valid_params->getEntry("IPARM(2)").validator();
314  parameterList->getEntry("IPARM(2)").setValidator(fillin_validator);
315  iparm_[1] = getIntegralValue<int>(*parameterList, "IPARM(2)");
316  }
317 
318  if( parameterList->isParameter("IPARM(4)") )
319  {
320  RCP<const ParameterEntryValidator> prec_validator = valid_params->getEntry("IPARM(4)").validator();
321  parameterList->getEntry("IPARM(4)").setValidator(prec_validator);
322  iparm_[3] = getIntegralValue<int>(*parameterList, "IPARM(4)");
323  }
324 
325  if( parameterList->isParameter("IPARM(8)") )
326  {
327  RCP<const ParameterEntryValidator> refine_validator = valid_params->getEntry("IPARM(8)").validator();
328  parameterList->getEntry("IPARM(8)").setValidator(refine_validator);
329  iparm_[7] = getIntegralValue<int>(*parameterList, "IPARM(8)");
330  }
331 
332  if( parameterList->isParameter("IPARM(10)") )
333  {
334  RCP<const ParameterEntryValidator> pivot_perturb_validator = valid_params->getEntry("IPARM(10)").validator();
335  parameterList->getEntry("IPARM(10)").setValidator(pivot_perturb_validator);
336  iparm_[9] = getIntegralValue<int>(*parameterList, "IPARM(10)");
337  }
338 
339  // First check if the control object requests a transpose solve.
340  // Then solver specific options can override this.
341  iparm_[11] = this->control_.useTranspose_ ? 2 : 0;
342 
343  if( parameterList->isParameter("IPARM(12)") )
344  {
345  RCP<const ParameterEntryValidator> trans_validator = valid_params->getEntry("IPARM(12)").validator();
346  parameterList->getEntry("IPARM(12)").setValidator(trans_validator);
347  iparm_[11] = getIntegralValue<int>(*parameterList, "IPARM(12)");
348  }
349 
350  if( parameterList->isParameter("IPARM(18)") )
351  {
352  RCP<const ParameterEntryValidator> report_validator = valid_params->getEntry("IPARM(18)").validator();
353  parameterList->getEntry("IPARM(18)").setValidator(report_validator);
354  iparm_[17] = getIntegralValue<int>(*parameterList, "IPARM(18)");
355  }
356 
357  if( parameterList->isParameter("IPARM(24)") )
358  {
359  RCP<const ParameterEntryValidator> par_fact_validator = valid_params->getEntry("IPARM(24)").validator();
360  parameterList->getEntry("IPARM(24)").setValidator(par_fact_validator);
361  iparm_[23] = getIntegralValue<int>(*parameterList, "IPARM(24)");
362  }
363 
364  if( parameterList->isParameter("IPARM(25)") )
365  {
366  RCP<const ParameterEntryValidator> par_fbsolve_validator = valid_params->getEntry("IPARM(25)").validator();
367  parameterList->getEntry("IPARM(25)").setValidator(par_fbsolve_validator);
368  iparm_[24] = getIntegralValue<int>(*parameterList, "IPARM(25)");
369  }
370 
371  if( parameterList->isParameter("IPARM(60)") )
372  {
373  RCP<const ParameterEntryValidator> ooc_validator = valid_params->getEntry("IPARM(60)").validator();
374  parameterList->getEntry("IPARM(60)").setValidator(ooc_validator);
375  iparm_[59] = getIntegralValue<int>(*parameterList, "IPARM(60)");
376  }
377 
378  if( parameterList->isParameter("IsContiguous") ){
379  is_contiguous_ = parameterList->get<bool>("IsContiguous");
380  }
381  }
382 
383 
384 /*
385  * TODO: It would be nice if the parameters could be expressed as
386  * either all string or as all integers. I see no way of doing this
387  * at present with the standard validators. However, we could create
388  * our own validators or kindly ask the Teuchos team to add some
389  * features for use.
390  *
391  * The issue is that with the current validators we cannot specify
392  * arbitrary sets of numbers that are the only allowed parameters.
393  * For example the IPARM(2) parameter can take only the values 0, 2,
394  * and 3. The EnhancedNumberValidator can take a min value, and max
395  * value, and a step size, but with those options there is no way to
396  * specify the needed set.
397  *
398  * Another missing feature is the ability to give docstrings for such
399  * numbers. For example IPARM(25) can take on the values 0 and 1.
400  * This would be easy enough to accomplish with just a number
401  * validator, but then have no way to document the effect of each
402  * value.
403  */
404 template <class Matrix, class Vector>
405 Teuchos::RCP<const Teuchos::ParameterList>
407 {
408  using std::string;
409  using Teuchos::as;
410  using Teuchos::RCP;
411  using Teuchos::tuple;
412  using Teuchos::toString;
413  using Teuchos::EnhancedNumberValidator;
414  using Teuchos::setStringToIntegralParameter;
415  using Teuchos::anyNumberParameterEntryValidator;
416 
417  static Teuchos::RCP<const Teuchos::ParameterList> valid_params;
418 
419  if( is_null(valid_params) ){
420  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
421 
422  // Use pardisoinit to get some default values;
423  void *pt_dummy[64];
424  PMKL::_INTEGER_t mtype_temp = mtype_;
425  PMKL::_INTEGER_t iparm_temp[64];
426  PMKL::pardisoinit(pt_dummy,
427  const_cast<PMKL::_INTEGER_t*>(&mtype_temp),
428  const_cast<PMKL::_INTEGER_t*>(iparm_temp));
429 
430  setStringToIntegralParameter<int>("IPARM(2)", toString(iparm_temp[1]),
431  "Fill-in reducing ordering for the input matrix",
432  tuple<string>("0", "2", "3"),
433  tuple<string>("The minimum degree algorithm",
434  "Nested dissection algorithm from METIS",
435  "OpenMP parallel nested dissection algorithm"),
436  tuple<int>(0, 2, 3),
437  pl.getRawPtr());
438 
439  Teuchos::RCP<EnhancedNumberValidator<int> > iparm_4_validator
440  = Teuchos::rcp( new EnhancedNumberValidator<int>() );
441  iparm_4_validator->setMin(0);
442  pl->set("IPARM(4)" , as<int>(iparm_temp[3]) , "Preconditioned CGS/CG",
443  iparm_4_validator);
444 
445  setStringToIntegralParameter<int>("IPARM(12)", toString(iparm_temp[11]),
446  "Solve with transposed or conjugate transposed matrix A",
447  tuple<string>("0", "1", "2"),
448  tuple<string>("Non-transposed",
449  "Conjugate-transposed",
450  "Transposed"),
451  tuple<int>(0, 1, 2),
452  pl.getRawPtr());
453 
454  setStringToIntegralParameter<int>("IPARM(24)", toString(iparm_temp[23]),
455  "Parallel factorization control",
456  tuple<string>("0", "1"),
457  tuple<string>("PARDISO uses the previous algorithm for factorization",
458  "PARDISO uses the new two-level factorization algorithm"),
459  tuple<int>(0, 1),
460  pl.getRawPtr());
461 
462  setStringToIntegralParameter<int>("IPARM(25)", toString(iparm_temp[24]),
463  "Parallel forward/backward solve control",
464  tuple<string>("0", "1"),
465  tuple<string>("PARDISO uses the parallel algorithm for the solve step",
466  "PARDISO uses the sequential forward and backward solve"),
467  tuple<int>(0, 1),
468  pl.getRawPtr());
469 
470  setStringToIntegralParameter<int>("IPARM(60)", toString(iparm_temp[59]),
471  "PARDISO mode (OOC mode)",
472  tuple<string>("0", "2"),
473  tuple<string>("In-core PARDISO",
474  "Out-of-core PARDISO. The OOC PARDISO can solve very "
475  "large problems by holding the matrix factors in files "
476  "on the disk. Hence the amount of RAM required by OOC "
477  "PARDISO is significantly reduced."),
478  tuple<int>(0, 2),
479  pl.getRawPtr());
480 
481  Teuchos::AnyNumberParameterEntryValidator::EPreferredType preferred_int =
482  Teuchos::AnyNumberParameterEntryValidator::PREFER_INT;
483 
484  Teuchos::AnyNumberParameterEntryValidator::AcceptedTypes accept_int( false );
485  accept_int.allowInt( true );
486 
487  pl->set("IPARM(8)" , as<int>(iparm_temp[8]) , "Iterative refinement step",
488  anyNumberParameterEntryValidator(preferred_int, accept_int));
489 
490  pl->set("IPARM(10)", as<int>(iparm_temp[9]) , "Pivoting perturbation",
491  anyNumberParameterEntryValidator(preferred_int, accept_int));
492 
493  pl->set("IPARM(18)", as<int>(iparm_temp[17]), "Report the number of non-zero elements in the factors",
494  anyNumberParameterEntryValidator(preferred_int, accept_int));
495 
496  pl->set("IsContiguous", true, "Whether GIDs contiguous");
497 
498  valid_params = pl;
499  }
500 
501  return valid_params;
502 }
503 
504 
505 
506 template <class Matrix, class Vector>
507 bool
509 {
510 #ifdef HAVE_AMESOS2_TIMERS
511  Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
512 #endif
513 
514  // PardisoMKL does not need matrix data in the pre-ordering phase
515  if( current_phase == PREORDERING ) return( false );
516 
517  if( this->root_ ){
518  Kokkos::resize(nzvals_view_, this->globalNumNonZeros_);
519  Kokkos::resize(colind_view_, this->globalNumNonZeros_);
520  Kokkos::resize(rowptr_view_, this->globalNumRows_ + 1);
521  }
522 
523  int_t nnz_ret = 0;
524  {
525 #ifdef HAVE_AMESOS2_TIMERS
526  Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
527 #endif
528 
529  if ( is_contiguous_ == true ) {
532  host_value_type_array, host_ordinal_type_array, host_size_type_array>::do_get(
533  this->matrixA_.ptr(),
534  nzvals_view_, colind_view_, rowptr_view_,
535  nnz_ret, ROOTED, SORTED_INDICES, this->rowIndexBase_);
536  }
537  else {
540  host_value_type_array, host_ordinal_type_array, host_size_type_array>::do_get(
541  this->matrixA_.ptr(),
542  nzvals_view_, colind_view_, rowptr_view_,
543  nnz_ret, CONTIGUOUS_AND_ROOTED, SORTED_INDICES, this->rowIndexBase_);
544  }
545 }
546 
547  return( true );
548 }
549 
550 
551 template <class Matrix, class Vector>
552 void
554  int_t error) const
555 {
556  int error_i = error;
557  Teuchos::broadcast(*(this->getComm()), 0, &error_i); // We only care about root's value
558 
559  if( error == 0 ) return; // No error
560 
561  std::string errmsg = "Other error";
562  switch( error ){
563  case -1:
564  errmsg = "PardisoMKL reported error: 'Input inconsistent'";
565  break;
566  case -2:
567  errmsg = "PardisoMKL reported error: 'Not enough memory'";
568  break;
569  case -3:
570  errmsg = "PardisoMKL reported error: 'Reordering problem'";
571  break;
572  case -4:
573  errmsg =
574  "PardisoMKL reported error: 'Zero pivot, numerical "
575  "factorization or iterative refinement problem'";
576  break;
577  case -5:
578  errmsg = "PardisoMKL reported error: 'Unclassified (internal) error'";
579  break;
580  case -6:
581  errmsg = "PardisoMKL reported error: 'Reordering failed'";
582  break;
583  case -7:
584  errmsg = "PardisoMKL reported error: 'Diagonal matrix is singular'";
585  break;
586  case -8:
587  errmsg = "PardisoMKL reported error: '32-bit integer overflow problem'";
588  break;
589  case -9:
590  errmsg = "PardisoMKL reported error: 'Not enough memory for OOC'";
591  break;
592  case -10:
593  errmsg = "PardisoMKL reported error: 'Problems with opening OOC temporary files'";
594  break;
595  case -11:
596  errmsg = "PardisoMKL reported error: 'Read/write problem with OOC data file'";
597  break;
598  }
599 
600  TEUCHOS_TEST_FOR_EXCEPTION( true, std::runtime_error, errmsg );
601 }
602 
603 
604 template <class Matrix, class Vector>
605 void
607 {
608  if( mtype == 0 ){
609  if( complex_ ){
610  mtype_ = 13; // complex, unsymmetric
611  } else {
612  mtype_ = 11; // real, unsymmetric
613  }
614  } else {
615  switch( mtype ){
616  case 11:
617  TEUCHOS_TEST_FOR_EXCEPTION( complex_,
618  std::invalid_argument,
619  "Cannot set a real Pardiso matrix type with scalar type complex" );
620  mtype_ = 11; break;
621  case 13:
622  TEUCHOS_TEST_FOR_EXCEPTION( !complex_,
623  std::invalid_argument,
624  "Cannot set a complex Pardiso matrix type with non-complex scalars" );
625  mtype_ = 13; break;
626  default:
627  TEUCHOS_TEST_FOR_EXCEPTION( true,
628  std::invalid_argument,
629  "Symmetric matrices are not yet supported by the Amesos2 interface" );
630  }
631  }
632 }
633 
634 
635 template <class Matrix, class Vector>
636 const char* PardisoMKL<Matrix,Vector>::name = "PARDISOMKL";
637 
638 template <class Matrix, class Vector>
639 const typename PardisoMKL<Matrix,Vector>::int_t
641 
642 template <class Matrix, class Vector>
643 const typename PardisoMKL<Matrix,Vector>::int_t
645 
646 template <class Matrix, class Vector>
647 const typename PardisoMKL<Matrix,Vector>::int_t
649 
650 
651 } // end namespace Amesos
652 
653 #endif // AMESOS2_PARDISOMKL_DEF_HPP
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers...
Definition: Amesos2_SolverCore_decl.hpp:105
Definition: Amesos2_TypeDecl.hpp:142
~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 check_pardiso_mkl_error(EPhase phase, int_t error) const
Throws an appropriate runtime error in the event that error < 0 .
Definition: Amesos2_PardisoMKL_def.hpp:553
void set_pardiso_mkl_matrix_type(int_t mtype=0)
Definition: Amesos2_PardisoMKL_def.hpp:606
Helper class for getting 1-D copies of multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:267
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 * pt_[64]
PardisoMKL internal data address pointer.
Definition: Amesos2_PardisoMKL_decl.hpp:289
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:48
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
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition: Amesos2_PardisoMKL_def.hpp:294
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:508
Similar to get_ccs_helper , but used to get a CRS representation of the given matrix.
Definition: Amesos2_Util.hpp:662
Definition: Amesos2_Umfpack_TypeMap.hpp:60
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > &parameterList)
Definition: Amesos2_PardisoMKL_def.hpp:303
Definition: Amesos2_TypeDecl.hpp:127
Helper class for putting 1-D data arrays into multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:373
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition: Amesos2_PardisoMKL_def.hpp:406
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:176
Definition: Amesos2_TypeDecl.hpp:128
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