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  , nzvals_()
79  , colind_()
80  , rowptr_()
81  , n_(Teuchos::as<int_t>(this->globalNumRows_))
82  , perm_(this->globalNumRows_)
83  , nrhs_(0)
84  {
85  // set the default matrix type
87 
88  PMKL::_INTEGER_t iparm_temp[64];
89  PMKL::_INTEGER_t mtype_temp = mtype_;
90  PMKL::pardisoinit(pt_, &mtype_temp, iparm_temp);
91 
92  for( int i = 0; i < 64; ++i ){
93  iparm_[i] = iparm_temp[i];
94  }
95 
96  // set single or double precision
97  if( Meta::is_same<solver_magnitude_type, PMKL::_REAL_t>::value ){
98  iparm_[27] = 1; // single-precision
99  } else {
100  iparm_[27] = 0; // double-precision
101  }
102 
103  // Reset some of the default parameters
104  iparm_[34] = 1; // Use zero-based indexing
105 #ifdef HAVE_AMESOS2_DEBUG
106  iparm_[26] = 1; // turn the Pardiso matrix checker on
107 #endif
108  }
109 
110 
111  template <class Matrix, class Vector>
113  {
114  /*
115  * Free any memory allocated by the PardisoMKL library functions
116  */
117  int_t error = 0;
118  void *bdummy, *xdummy;
119 
120  if( this->root_ ){
121  int_t phase = -1; // release all internal solver memory
122  function_map::pardiso( pt_, const_cast<int_t*>(&maxfct_),
123  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
124  nzvals_.getRawPtr(), rowptr_.getRawPtr(),
125  colind_.getRawPtr(), perm_.getRawPtr(), &nrhs_, iparm_,
126  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &error );
127  }
128 
129  check_pardiso_mkl_error(Amesos2::CLEAN, error);
130  }
131 
132 
133  template<class Matrix, class Vector>
134  int
136  {
137  // preOrdering done in PardisoMKL during "Analysis" (aka symbolic
138  // factorization) phase
139 
140  return(0);
141  }
142 
143 
144  template <class Matrix, class Vector>
145  int
147  {
148  int_t error = 0;
149 
150  if( this->root_ ){
151 #ifdef HAVE_AMESOS2_TIMERS
152  Teuchos::TimeMonitor symbFactTimer( this->timers_.symFactTime_ );
153 #endif
154 
155  int_t phase = 11;
156  void *bdummy, *xdummy;
157 
158  function_map::pardiso( pt_, const_cast<int_t*>(&maxfct_),
159  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
160  nzvals_.getRawPtr(), rowptr_.getRawPtr(),
161  colind_.getRawPtr(), perm_.getRawPtr(), &nrhs_, iparm_,
162  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &error );
163  }
164 
165  check_pardiso_mkl_error(Amesos2::SYMBFACT, error);
166 
167  // Pardiso only lets you retrieve the total number of factor
168  // non-zeros, not for each individually. We should document how
169  // such a situation is reported.
170  this->setNnzLU(iparm_[17]);
171 
172  return(0);
173  }
174 
175 
176  template <class Matrix, class Vector>
177  int
179  {
180  int_t error = 0;
181 
182  if( this->root_ ){
183 #ifdef HAVE_AMESOS2_TIMERS
184  Teuchos::TimeMonitor numFactTimer( this->timers_.numFactTime_ );
185 #endif
186 
187  int_t phase = 22;
188  void *bdummy, *xdummy;
189 
190  function_map::pardiso( pt_, const_cast<int_t*>(&maxfct_),
191  const_cast<int_t*>(&mnum_), &mtype_, &phase, &n_,
192  nzvals_.getRawPtr(), rowptr_.getRawPtr(),
193  colind_.getRawPtr(), perm_.getRawPtr(), &nrhs_, iparm_,
194  const_cast<int_t*>(&msglvl_), &bdummy, &xdummy, &error );
195  }
196 
197  check_pardiso_mkl_error(Amesos2::NUMFACT, error);
198 
199  return( 0 );
200  }
201 
202 
203  template <class Matrix, class Vector>
204  int
206  const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const
207  {
208  using Teuchos::as;
209 
210  int_t error = 0;
211 
212  // Get B data
213  const global_size_type ld_rhs = this->root_ ? X->getGlobalLength() : 0;
214  nrhs_ = as<int_t>(X->getGlobalNumVectors());
215 
216  const size_t val_store_size = as<size_t>(ld_rhs * nrhs_);
217  xvals_.resize(val_store_size);
218  bvals_.resize(val_store_size);
219 
220  { // Get values from RHS B
221 #ifdef HAVE_AMESOS2_TIMERS
222  Teuchos::TimeMonitor mvConvTimer( this->timers_.vecConvTime_ );
223  Teuchos::TimeMonitor redistTimer( this->timers_.vecRedistTime_ );
224 #endif
227  solver_scalar_type>::do_get(B, bvals_(),
228  as<size_t>(ld_rhs),
229  ROOTED);
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_.getRawPtr()),
246  const_cast<int_t*>(rowptr_.getRawPtr()),
247  const_cast<int_t*>(colind_.getRawPtr()),
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  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  iparm_[1] = validators[2]->getIntegralValue(*parameterList, "IPARM(2)",
289  validators[2]->getDefaultParameterName());
290  iparm_[3] = parameterList->get<int>("IPARM(4)" , (int)iparm_[3]);
291  iparm_[7] = parameterList->get<int>("IPARM(8)" , (int)iparm_[7]);
292  iparm_[9] = parameterList->get<int>("IPARM(10)", (int)iparm_[9]);
293  iparm_[17] = parameterList->get<int>("IPARM(18)", (int)iparm_[17]);
294  iparm_[23] = validators[24]->getIntegralValue(*parameterList, "IPARM(24)",
295  validators[24]->getDefaultParameterName());
296  iparm_[24] = validators[25]->getIntegralValue(*parameterList, "IPARM(25)",
297  validators[25]->getDefaultParameterName());
298  iparm_[59] = validators[60]->getIntegralValue(*parameterList, "IPARM(60)",
299  validators[60]->getDefaultParameterName());
300 }
301 
302 
303 /*
304  * TODO: It would be nice if the parameters could be expressed as
305  * either all string or as all integers. I see no way of doing this
306  * at present with the standard validators. However, we could create
307  * our own validators or kindly ask the Teuchos team to add some
308  * features for use.
309  *
310  * The issue is that with the current validators we cannot specify
311  * arbitrary sets of numbers that are the only allowed parameters.
312  * For example the IPARM(2) parameter can take only the values 0, 2,
313  * and 3. The EnhancedNumberValidator can take a min value, and max
314  * value, and a step size, but with those options there is no way to
315  * specify the needed set.
316  *
317  * Another missing feature is the ability to give docstrings for such
318  * numbers. For example IPARM(25) can take on the values 0 and 1.
319  * This would be easy enough to accomplish with just a number
320  * validator, but then have no way to document the effect of each
321  * value.
322  */
323 template <class Matrix, class Vector>
324 Teuchos::RCP<const Teuchos::ParameterList>
326 {
327  using std::string;
328  using Teuchos::as;
329  using Teuchos::RCP;
330  using Teuchos::tuple;
331  using Teuchos::toString;
332  using Teuchos::EnhancedNumberValidator;
333  using Teuchos::setStringToIntegralParameter;
334  using Teuchos::anyNumberParameterEntryValidator;
335  using Teuchos::stringToIntegralParameterEntryValidator;
336  typedef Teuchos::StringToIntegralParameterEntryValidator<int> STIPEV;
337  Teuchos::AnyNumberParameterEntryValidator::EPreferredType preferred_int =
338  Teuchos::AnyNumberParameterEntryValidator::PREFER_INT;
339 
340  static Teuchos::RCP<const Teuchos::ParameterList> valid_params;
341 
342  if( is_null(valid_params) ){
343  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
344 
345  // Use pardisoinit to get some default values;
346  void *pt_dummy[64];
347  PMKL::_INTEGER_t mtype_temp = mtype_;
348  PMKL::_INTEGER_t iparm_temp[64];
349  PMKL::pardisoinit(pt_dummy,
350  const_cast<PMKL::_INTEGER_t*>(&mtype_temp),
351  const_cast<PMKL::_INTEGER_t*>(iparm_temp));
352 
353  // Initialize our parameter validators, saving the string to int validators for later
354  RCP<STIPEV> iparm_2_validator
355  = stringToIntegralParameterEntryValidator<int>(tuple<string>("0", "2", "3"),
356  tuple<string>("The minimum degree algorithm",
357  "Nested dissection algorithm from METIS",
358  "OpenMP parallel nested dissection algorithm"),
359  tuple<int>(0, 2, 3),
360  toString(iparm_temp[1]));
361  validators.insert( std::pair<int,RCP<STIPEV> >(2, iparm_2_validator) );
362 
363  Teuchos::RCP<EnhancedNumberValidator<int> > iparm_4_validator
364  = Teuchos::rcp( new EnhancedNumberValidator<int>() );
365  iparm_4_validator->setMin(0);
366 
367  RCP<STIPEV> iparm_24_validator
368  = stringToIntegralParameterEntryValidator<int>(tuple<string>("0", "1"),
369  tuple<string>("PARDISO uses the previous algorithm for factorization",
370  "PARDISO uses the new two-level factorization algorithm"),
371  tuple<int>(0, 1),
372  toString(iparm_temp[23]));
373  validators.insert( std::pair<int,RCP<STIPEV> >(24, iparm_24_validator) );
374 
375  RCP<STIPEV> iparm_25_validator
376  = stringToIntegralParameterEntryValidator<int>(tuple<string>("0", "1"),
377  tuple<string>("PARDISO uses the parallel algorithm for the solve step",
378  "PARDISO uses the sequential forward and backward solve"),
379  tuple<int>(0, 1),
380  toString(iparm_temp[24]));
381  validators.insert( std::pair<int,RCP<STIPEV> >(25, iparm_25_validator) );
382 
383  RCP<STIPEV> iparm_60_validator
384  = stringToIntegralParameterEntryValidator<int>(tuple<string>("0", "2"),
385  tuple<string>("In-core PARDISO",
386  "Out-of-core PARDISO. The OOC PARDISO can solve very "
387  "large problems by holding the matrix factors in files "
388  "on the disk. Hence the amount of RAM required by OOC "
389  "PARDISO is significantly reduced."),
390  tuple<int>(0, 2),
391  toString(iparm_temp[59]));
392  validators.insert( std::pair<int,RCP<STIPEV> >(60, iparm_60_validator) );
393 
394  Teuchos::AnyNumberParameterEntryValidator::AcceptedTypes accept_int( false );
395  accept_int.allowInt( true );
396 
397  pl->set("IPARM(2)" , validators[2]->getDefaultParameterName(),
398  "Fill-in reducing ordering for the input matrix", validators[2]);
399 
400  pl->set("IPARM(4)" , as<int>(iparm_temp[3]) , "Preconditioned CGS/CG",
401  iparm_4_validator);
402 
403  pl->set("IPARM(8)" , as<int>(iparm_temp[8]) , "Iterative refinement step",
404  anyNumberParameterEntryValidator(preferred_int, accept_int));
405 
406  pl->set("IPARM(10)", as<int>(iparm_temp[9]) , "Pivoting perturbation",
407  anyNumberParameterEntryValidator(preferred_int, accept_int));
408 
409  pl->set("IPARM(18)", as<int>(iparm_temp[17]), "Report the number of non-zero elements in the factors",
410  anyNumberParameterEntryValidator(preferred_int, accept_int));
411 
412  pl->set("IPARM(24)", validators[24]->getDefaultParameterName(),
413  "Parallel factorization control", validators[24]);
414 
415  pl->set("IPARM(25)", validators[25]->getDefaultParameterName(),
416  "Parallel forward/backward solve control", validators[25]);
417 
418  pl->set("IPARM(60)", validators[60]->getDefaultParameterName(),
419  "PARDISO mode (OOC mode)", validators[60]);
420 
421  valid_params = pl;
422  }
423 
424  return valid_params;
425 }
426 
427 
428 
429 template <class Matrix, class Vector>
430 bool
432 {
433 #ifdef HAVE_AMESOS2_TIMERS
434  Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
435 #endif
436 
437  // PardisoMKL does not need matrix data in the pre-ordering phase
438  if( current_phase == PREORDERING ) return( false );
439 
440  if( this->root_ ){
441  nzvals_.resize(this->globalNumNonZeros_);
442  colind_.resize(this->globalNumNonZeros_);
443  rowptr_.resize(this->globalNumRows_ + 1);
444  }
445 
446  int_t nnz_ret = 0;
447  {
448 #ifdef HAVE_AMESOS2_TIMERS
449  Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
450 #endif
451 
454  solver_scalar_type,
455  int_t,int_t>::do_get(this->matrixA_.ptr(),
456  nzvals_(), colind_(), rowptr_(),
457  nnz_ret, ROOTED, SORTED_INDICES);
458 }
459 
460  return( true );
461 }
462 
463 
464 template <class Matrix, class Vector>
465 void
467  int_t error) const
468 {
469  int error_i = error;
470  Teuchos::broadcast(*(this->getComm()), 0, &error_i); // We only care about root's value
471 
472  if( error == 0 ) return; // No error
473 
474  std::string errmsg = "Other error";
475  switch( error ){
476  case -1:
477  errmsg = "PardisoMKL reported error: 'Input inconsistent'";
478  break;
479  case -2:
480  errmsg = "PardisoMKL reported error: 'Not enough memory'";
481  break;
482  case -3:
483  errmsg = "PardisoMKL reported error: 'Reordering problem'";
484  break;
485  case -4:
486  errmsg =
487  "PardisoMKL reported error: 'Zero pivot, numerical "
488  "factorization or iterative refinement problem'";
489  break;
490  case -5:
491  errmsg = "PardisoMKL reported error: 'Unclassified (internal) error'";
492  break;
493  case -6:
494  errmsg = "PardisoMKL reported error: 'Reordering failed'";
495  break;
496  case -7:
497  errmsg = "PardisoMKL reported error: 'Diagonal matrix is singular'";
498  break;
499  case -8:
500  errmsg = "PardisoMKL reported error: '32-bit integer overflow problem'";
501  break;
502  case -9:
503  errmsg = "PardisoMKL reported error: 'Not enough memory for OOC'";
504  break;
505  case -10:
506  errmsg = "PardisoMKL reported error: 'Problems with opening OOC temporary files'";
507  break;
508  case -11:
509  errmsg = "PardisoMKL reported error: 'Read/write problem with OOC data file'";
510  break;
511  }
512 
513  TEUCHOS_TEST_FOR_EXCEPTION( true, std::runtime_error, errmsg );
514 }
515 
516 
517 template <class Matrix, class Vector>
518 void
520 {
521  if( mtype == 0 ){
522  if( complex_ ){
523  mtype_ = 13; // complex, unsymmetric
524  } else {
525  mtype_ = 11; // real, unsymmetric
526  }
527  } else {
528  switch( mtype ){
529  case 11:
530  TEUCHOS_TEST_FOR_EXCEPTION( complex_,
531  std::invalid_argument,
532  "Cannot set a real Pardiso matrix type with scalar type complex" );
533  mtype_ = 11; break;
534  case 13:
535  TEUCHOS_TEST_FOR_EXCEPTION( !complex_,
536  std::invalid_argument,
537  "Cannot set a complex Pardiso matrix type with non-complex scalars" );
538  mtype_ = 13; break;
539  default:
540  TEUCHOS_TEST_FOR_EXCEPTION( true,
541  std::invalid_argument,
542  "Symmetric matrices are not yet supported by the Amesos2 interface" );
543  }
544  }
545 }
546 
547 
548 template <class Matrix, class Vector>
549 const char* PardisoMKL<Matrix,Vector>::name = "PARDISOMKL";
550 
551 template <class Matrix, class Vector>
552 const typename PardisoMKL<Matrix,Vector>::int_t
554 
555 template <class Matrix, class Vector>
556 const typename PardisoMKL<Matrix,Vector>::int_t
558 
559 template <class Matrix, class Vector>
560 const typename PardisoMKL<Matrix,Vector>::int_t
562 
563 
564 } // end namespace Amesos
565 
566 #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:141
~PardisoMKL()
Destructor.
Definition: Amesos2_PardisoMKL_def.hpp:112
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
Teuchos::Array< solver_scalar_type > nzvals_
Stores the values of the nonzero entries for PardisoMKL.
Definition: Amesos2_PardisoMKL_decl.hpp:273
Similar to get_ccs_helper , but used to get a CRS representation of the given matrix.
Definition: Amesos2_Util.hpp:591
global_size_type globalNumCols_
Number of global columns in matrixA_.
Definition: Amesos2_SolverCore_decl.hpp:479
int_t n_
Number of equations in the sparse linear system.
Definition: Amesos2_PardisoMKL_decl.hpp:288
bool root_
If true, then this is the root processor.
Definition: Amesos2_SolverCore_decl.hpp:507
global_size_type globalNumRows_
Number of global rows in matrixA_.
Definition: Amesos2_SolverCore_decl.hpp:476
int_t nrhs_
number of righthand-side vectors
Definition: Amesos2_PardisoMKL_decl.hpp:292
void set_pardiso_mkl_matrix_type(int_t mtype=0)
Definition: Amesos2_PardisoMKL_def.hpp:519
Helper class for getting 1-D copies of multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:243
static const int_t msglvl_
The messaging level. Set to 1 if you wish for Pardiso MKL to print statistical info.
Definition: Amesos2_PardisoMKL_decl.hpp:299
Teuchos::Array< solver_scalar_type > bvals_
Persisting, contiguous, 1D store for B.
Definition: Amesos2_PardisoMKL_decl.hpp:281
void * pt_[64]
PardisoMKL internal data address pointer.
Definition: Amesos2_PardisoMKL_decl.hpp:284
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:48
Teuchos::Array< int_t > perm_
Permutation vector.
Definition: Amesos2_PardisoMKL_decl.hpp:290
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:178
Teuchos::Array< int_t > rowptr_
Stores the row indices of the nonzero entries.
Definition: Amesos2_PardisoMKL_decl.hpp:277
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns a pointer to the Teuchos::Comm communicator with this operator.
Definition: Amesos2_SolverCore_decl.hpp:363
int symbolicFactorization_impl()
Perform symbolic factorization of the matrix using PardisoMKL.
Definition: Amesos2_PardisoMKL_def.hpp:146
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:431
Definition: Amesos2_Cholmod_TypeMap.hpp:92
Teuchos::Array< solver_scalar_type > xvals_
Persisting, contiguous, 1D store for X.
Definition: Amesos2_PardisoMKL_decl.hpp:279
void setParameters_impl(const Teuchos::RCP< Teuchos::ParameterList > &parameterList)
Definition: Amesos2_PardisoMKL_def.hpp:286
global_size_type globalNumNonZeros_
Number of global non-zero values in matrixA_.
Definition: Amesos2_SolverCore_decl.hpp:482
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:205
void setNnzLU(size_t nnz)
Set the number of non-zero values in the and factors.
Definition: Amesos2_SolverCore_decl.hpp:452
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:466
Teuchos::Array< int_t > colind_
Stores the location in Ai_ and Aval_ that starts row j.
Definition: Amesos2_PardisoMKL_decl.hpp:275
Definition: Amesos2_TypeDecl.hpp:127
Timers timers_
Various timing statistics.
Definition: Amesos2_SolverCore_decl.hpp:498
Helper class for putting 1-D data arrays into multivectors.
Definition: Amesos2_MultiVecAdapter_decl.hpp:296
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:175
Teuchos::RCP< const MatrixAdapter< Matrix > > matrixA_
The LHS operator.
Definition: Amesos2_SolverCore_decl.hpp:455
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition: Amesos2_PardisoMKL_def.hpp:325
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:286
int_t iparm_[64]
Definition: Amesos2_PardisoMKL_decl.hpp:296
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition: Amesos2_PardisoMKL_def.hpp:135