29 #include "Amesos_config.h"
32 #ifdef HAVE_AMESOS_LAPACK
35 #if defined(HAVE_AMESOS_MUMPS) && defined(HAVE_MPI)
38 #ifdef HAVE_AMESOS_SCALAPACK
41 #ifdef HAVE_AMESOS_UMFPACK
44 #ifdef HAVE_AMESOS_SUPERLUDIST
47 #ifdef HAVE_AMESOS_SUPERLU
50 #ifdef HAVE_AMESOS_DSCPACK
53 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
56 #ifdef HAVE_AMESOS_TAUCS
59 #ifdef HAVE_AMESOS_CSS_MKL
62 #ifdef HAVE_AMESOS_PARAKLETE
65 #ifdef HAVE_AMESOS_CSPARSE
75 std::string CT = ClassType;
76 return(
Create(CT,LinearProblem));
83 if ((CT ==
"Amesos_Lapack") || (CT ==
"Lapack")) {
84 #ifdef HAVE_AMESOS_LAPACK
87 if (
verbose) std::cerr <<
"Amesos_Lapack is not implemented" << std::endl ;
92 if ((CT ==
"Amesos_Klu") || (CT ==
"Klu")) {
93 #ifdef HAVE_AMESOS_KLU
96 if (
verbose) std::cerr <<
"Amesos_Klu is not implemented" << std::endl ;
101 if ((CT ==
"Amesos_Umfpack") || (CT ==
"Umfpack")) {
102 #ifdef HAVE_AMESOS_UMFPACK
105 if (
verbose) std::cerr <<
"Amesos_Umfpack is not implemented" << std::endl ;
110 if ((CT ==
"Amesos_Superlu") || (CT ==
"Superlu")) {
111 #ifdef HAVE_AMESOS_SUPERLU
114 if (
verbose) std::cerr <<
"Amesos_Superlu is not implemented" << std::endl ;
119 if ((CT ==
"Amesos_Superludist") || (CT ==
"Superludist")) {
120 #ifdef HAVE_AMESOS_SUPERLUDIST
123 if (
verbose) std::cerr <<
"Amesos_Superludist is not implemented" << std::endl ;
128 if ((CT ==
"Amesos_Mumps") || (CT ==
"Mumps")) {
129 #if defined(HAVE_AMESOS_MUMPS) && defined(HAVE_MPI)
132 if (
verbose) std::cerr <<
"Amesos_Mumps is not implemented" << std::endl ;
137 if ((CT ==
"Amesos_Scalapack") || (CT ==
"Scalapack")) {
138 #ifdef HAVE_AMESOS_SCALAPACK
141 if (
verbose) std::cerr <<
"Amesos_Scalapack is not implemented" << std::endl ;
146 if ((CT ==
"Amesos_Dscpack") || (CT ==
"Dscpack")) {
147 #ifdef HAVE_AMESOS_DSCPACK
150 if (
verbose) std::cerr <<
"Amesos_Dscpack is not implemented" << std::endl ;
155 if ((CT ==
"Amesos_Pardiso") || (CT ==
"Pardiso")) {
156 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
159 if (
verbose) std::cerr <<
"Amesos_Pardiso is not implemented" << std::endl ;
164 if ((CT ==
"Amesos_CssMKL") || (CT ==
"CssMKL")) {
165 #ifdef HAVE_AMESOS_CSS_MKL
168 if (
verbose) std::cerr <<
"Amesos_CssMKL is not implemented" << std::endl ;
173 if ((CT ==
"Amesos_Paraklete") || (CT ==
"Paraklete")) {
174 #ifdef HAVE_AMESOS_PARAKLETE
177 if (
verbose) std::cerr <<
"Amesos_Paraklete is not implemented" << std::endl ;
182 if ((CT ==
"Amesos_Taucs") || (CT ==
"Taucs")) {
183 #ifdef HAVE_AMESOS_TAUCS
186 if (
verbose) std::cerr <<
"Amesos_Taucs is not implemented" << std::endl ;
191 if ((CT ==
"Amesos_CSparse") || (CT ==
"CSparse")) {
192 #ifdef HAVE_AMESOS_CSPARSE
193 return new Amesos_CSparse(LinearProblem);
195 if (
verbose) std::cerr <<
"Amesos_CSparse is not implemented" << std::endl ;
200 if (
verbose) std::cerr <<
"Unknown class type:" << CT << std::endl ;
207 std::string CT = ClassType;
215 if ((CT ==
"Amesos_Lapack") || (CT ==
"Lapack")) {
216 #ifdef HAVE_AMESOS_LAPACK
223 if ((CT ==
"Amesos_Klu") || (CT ==
"Klu")) {
224 #ifdef HAVE_AMESOS_KLU
231 if ((CT ==
"Amesos_Umfpack") || (CT ==
"Umfpack")) {
232 #ifdef HAVE_AMESOS_UMFPACK
239 if ((CT ==
"Amesos_Superlu") || ( CT ==
"Superlu")) {
240 #ifdef HAVE_AMESOS_SUPERLU
247 if ((CT ==
"Amesos_Superludist") || (CT ==
"Superludist")) {
248 #ifdef HAVE_AMESOS_SUPERLUDIST
255 if ((CT ==
"Amesos_Mumps") || (CT ==
"Mumps")) {
256 #ifdef HAVE_AMESOS_MUMPS
263 if ((CT ==
"Amesos_Scalapack") || (CT ==
"Scalapack")) {
264 #ifdef HAVE_AMESOS_SCALAPACK
271 if ((CT ==
"Amesos_Dscpack") || (CT ==
"Dscpack")) {
272 #ifdef HAVE_AMESOS_DSCPACK
279 if ((CT ==
"Amesos_Pardiso") || (CT ==
"Pardiso")) {
280 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
287 if ((CT ==
"Amesos_CssMKL") || (CT ==
"Css_MKL")) {
288 #ifdef HAVE_AMESOS_CSS_MKL
295 if ((CT ==
"Amesos_Taucs") || (CT ==
"Taucs")) {
296 #ifdef HAVE_AMESOS_TAUCS
303 if ((CT ==
"Amesos_Paraklete") || (CT ==
"Paraklete")) {
304 #ifdef HAVE_AMESOS_PARAKLETE
311 if ((CT ==
"Amesos_CSparse") || (CT ==
"CSparse")) {
312 #ifdef HAVE_AMESOS_CSPARSE
328 ParamList.
set(
"OutputLevel",1 ) ;
329 ParamList.
set(
"DebugLevel", 0 ) ;
330 ParamList.
set(
"PrintTiming",
false ) ;
331 ParamList.
set(
"ComputeVectorNorms",
false ) ;
332 ParamList.
set(
"ComputeTrueResidual",
false ) ;
336 ParamList.
set(
"AddZeroToDiag",
false ) ;
337 ParamList.
set(
"AddToDiag", 0.0 ) ;
338 ParamList.
set(
"Refactorize",
false ) ;
339 ParamList.
set(
"RcondThreshold", 1e-12 ) ;
340 ParamList.
set(
"MaxProcs", -1 ) ;
341 ParamList.
set(
"MatrixProperty",
"general" ) ;
342 ParamList.
set(
"ScaleMethod", 0 ) ;
343 ParamList.
set(
"Reindex",
false ) ;
347 ParamList.
set(
"TrustMe",
false ) ;
354 ParamList.
set(
"Redistribute",
false ) ;
357 SuperludistParams.
set(
"ReuseSymbolic",
false);
358 SuperludistParams.
set(
"Fact",
"SamePattern");
359 SuperludistParams.
set(
"Equil",
false);
360 SuperludistParams.
set(
"ColPerm",
"NOT SET");
361 SuperludistParams.
set(
"RowPerm",
"NOT SET");
362 SuperludistParams.
set(
"perm_c",(
int*) 0);
363 SuperludistParams.
set(
"perm_r",(
int*) 0);
364 SuperludistParams.
set(
"IterRefine",
"NOT SET");
365 SuperludistParams.
set(
"ReplaceTinyPivot",
true);
366 SuperludistParams.
set(
"PrintNonzeros",
false);
368 ParamList.
set(
"Superludist", SuperludistParams ) ;
374 LapackParams.
set(
"Equilibrate",
true);
376 ParamList.
set(
"Lapack", LapackParams ) ;
378 ParamList.
set(
"NoDestroy",
false);
381 MumpsParams.
set(
"Equilibrate",
true);
383 for (
int i = 1 ; i <= 40 ; ++i)
386 sprintf(what,
"ICNTL(%d)", i);
388 MumpsParams.
set(what,0);
392 for (
int i = 1 ; i <= 5 ; ++i)
395 sprintf(what,
"CNTL(%d)", i);
397 MumpsParams.
set(what,0.0);
399 MumpsParams.
set(
"RowScaling",(
double *) 0);
400 MumpsParams.
set(
"ColScaling",(
double *) 0);
403 ParamList.
set(
"Mumps", MumpsParams ) ;
410 PardisoParams.
set(
"MSGLVL",0);
411 PardisoParams.
set(
"IPARM(1)",0);
412 PardisoParams.
set(
"IPARM(2)",0);
413 PardisoParams.
set(
"IPARM(3)",0);
414 PardisoParams.
set(
"IPARM(4)",0);
415 PardisoParams.
set(
"IPARM(8)",0);
416 PardisoParams.
set(
"IPARM(10)",0);
417 PardisoParams.
set(
"IPARM(11)",0);
418 PardisoParams.
set(
"IPARM(18)",0);
419 PardisoParams.
set(
"IPARM(19)",0);
420 PardisoParams.
set(
"IPARM(21)",0);
423 ParamList.
set(
"Pardiso", PardisoParams ) ;
428 ScalapackParams.
set(
"2D distribution",
true);
429 ScalapackParams.
set(
"grid_nb",32);
431 ParamList.
set(
"Scalapack", ScalapackParams ) ;
Amesos_Klu: A serial, unblocked code ideal for getting started and for very sparse matrices...
Amesos_Paraklete: A serial, unblocked code ideal for getting started and for very sparse matrices...
Amesos_Superludist: An object-oriented wrapper for Superludist.
Amesos_Mumps: An object-oriented wrapper for the double precision version of MUMPS.
Amesos_Dscpack: An object-oriented wrapper for Dscpack.
static Teuchos::ParameterList GetValidParameters()
Get the list of valid parameters.
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Amesos_Pardiso: Interface to the PARDISO package.
Amesos_Superlu: Amesos interface to Xioye Li's SuperLU 3.0 serial code.
bool isParameter(const std::string &name) const
Amesos_Lapack: an interface to LAPACK.
Amesos_BaseSolver * Create(const char *ClassType, const Epetra_LinearProblem &LinearProblem)
Amesos Create method.
Amesos_CssMKL: Interface to the CSSMKL package.
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
Class Amesos_Umfpack: An object-oriented wrapper for UMFPACK.
Amesos_Scalapack: A serial and parallel dense solver. For now, we implement only the unsymmetric ScaL...
Amesos_Taucs: An interface to the TAUCS package.
bool Query(const char *ClassType)
Queries whether a given interface is available or not.