/[escript]/trunk/trilinoswrap/src/Amesos2Wrapper.cpp
ViewVC logotype

Diff of /trunk/trilinoswrap/src/Amesos2Wrapper.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6798 by jfenwick, Wed May 17 00:53:31 2017 UTC revision 6799 by aellery, Mon Mar 25 05:53:58 2019 UTC
# Line 55  RCP<DirectSolverType<Matrix,Vector> > cr Line 55  RCP<DirectSolverType<Matrix,Vector> > cr
55          solver = Amesos2::create<Matrix, Vector>("klu2", A, X, B);          solver = Amesos2::create<Matrix, Vector>("klu2", A, X, B);
56          Teuchos::ParameterList solverParams(solver->name());          Teuchos::ParameterList solverParams(solver->name());
57          // the doco says these params exist but clearly they don't :-(          // the doco says these params exist but clearly they don't :-(
         //solverParams.set("DiagPivotThresh", sb.getDiagonalDominanceThreshold());  
         //solverParams.set("SymmetricMode", sb.isSymmetric());  
58          extractParamIfSet<std::string>("Trans", pyParams, solverParams);          extractParamIfSet<std::string>("Trans", pyParams, solverParams);
59          extractParamIfSet<bool>("Equil", pyParams, solverParams);          extractParamIfSet<bool>("Equil", pyParams, solverParams);
60          extractParamIfSet<std::string>("IterRefine", pyParams, solverParams);          extractParamIfSet<std::string>("IterRefine", pyParams, solverParams);
# Line 68  RCP<DirectSolverType<Matrix,Vector> > cr Line 66  RCP<DirectSolverType<Matrix,Vector> > cr
66              Amesos2::query("MUMPS")) {              Amesos2::query("MUMPS")) {
67          solver = Amesos2::create<Matrix, Vector>("MUMPS", A, X, B);          solver = Amesos2::create<Matrix, Vector>("MUMPS", A, X, B);
68          Teuchos::ParameterList solverParams(solver->name());          Teuchos::ParameterList solverParams(solver->name());
69          if (sb.isVerbose()) {          // solverParams.set("MatrixType", (sb.isSymmetric() || sb.isHermitian()) ? "symmetric" : "general");
70            if (sb.isVerbose()) {
71              solverParams.set("ICNTL(4)", 4);              solverParams.set("ICNTL(4)", 4);
72          }          }
73          extractParamIfSet<int>("ICNTL(1)", pyParams, solverParams);          extractParamIfSet<int>("ICNTL(1)", pyParams, solverParams);
# Line 82  RCP<DirectSolverType<Matrix,Vector> > cr Line 81  RCP<DirectSolverType<Matrix,Vector> > cr
81      } else if ((dontcare || method == escript::SO_METHOD_DIRECT_TRILINOS) &&      } else if ((dontcare || method == escript::SO_METHOD_DIRECT_TRILINOS) &&
82              Amesos2::query("Basker")) {              Amesos2::query("Basker")) {
83          solver = Amesos2::create<Matrix, Vector>("Basker", A, X, B);          solver = Amesos2::create<Matrix, Vector>("Basker", A, X, B);
84            Teuchos::ParameterList solverParams(solver->name());
85            solverParams.set("MatrixType", (sb.isSymmetric() || sb.isHermitian()) ? "symmetric" : "general");
86      } else if ((dontcare || method == escript::SO_METHOD_DIRECT_SUPERLU) &&      } else if ((dontcare || method == escript::SO_METHOD_DIRECT_SUPERLU) &&
87              Amesos2::query("superludist")) {              Amesos2::query("superludist")) {
88          solver = Amesos2::create<Matrix, Vector>("superludist", A, X, B);          solver = Amesos2::create<Matrix, Vector>("superludist", A, X, B);
89          Teuchos::ParameterList solverParams(solver->name());          Teuchos::ParameterList solverParams(solver->name());  
90            solverParams.set("MatrixType", (sb.isSymmetric() || sb.isHermitian()) ? "symmetric" : "general");
91          extractParamIfSet<int>("npcol", pyParams, solverParams);          extractParamIfSet<int>("npcol", pyParams, solverParams);
92          extractParamIfSet<int>("nprow", pyParams, solverParams);          extractParamIfSet<int>("nprow", pyParams, solverParams);
93          extractParamIfSet<std::string>("ColPerm", pyParams, solverParams);          extractParamIfSet<std::string>("ColPerm", pyParams, solverParams);
# Line 95  RCP<DirectSolverType<Matrix,Vector> > cr Line 97  RCP<DirectSolverType<Matrix,Vector> > cr
97              Amesos2::query("superlu")) {              Amesos2::query("superlu")) {
98          solver = Amesos2::create<Matrix, Vector>("superlu", A, X, B);          solver = Amesos2::create<Matrix, Vector>("superlu", A, X, B);
99          Teuchos::ParameterList solverParams(solver->name());          Teuchos::ParameterList solverParams(solver->name());
         solverParams.set("DiagPivotThresh", sb.getDiagonalDominanceThreshold());  
         solverParams.set("ILU_DropTol", sb.getDropTolerance());  
100          solverParams.set("SymmetricMode", sb.isSymmetric());          solverParams.set("SymmetricMode", sb.isSymmetric());
101          extractParamIfSet<std::string>("Trans", pyParams, solverParams);          extractParamIfSet<std::string>("Trans", pyParams, solverParams);
102          extractParamIfSet<bool>("Equil", pyParams, solverParams);          extractParamIfSet<bool>("Equil", pyParams, solverParams);
# Line 120  RCP<DirectSolverType<Matrix,Vector> > cr Line 120  RCP<DirectSolverType<Matrix,Vector> > cr
120  #else  #else
121          solverParams.set("nprocs", 1);          solverParams.set("nprocs", 1);
122  #endif  #endif
         solverParams.set("DiagPivotThresh", sb.getDiagonalDominanceThreshold());  
123          solverParams.set("SymmetricMode", sb.isSymmetric());          solverParams.set("SymmetricMode", sb.isSymmetric());
124          extractParamIfSet<int>("nprocs", pyParams, solverParams);          extractParamIfSet<int>("nprocs", pyParams, solverParams);
125          extractParamIfSet<std::string>("trans", pyParams, solverParams);          extractParamIfSet<std::string>("trans", pyParams, solverParams);
# Line 147  RCP<DirectSolverType<Matrix,Vector> > cr Line 146  RCP<DirectSolverType<Matrix,Vector> > cr
146      } else if (Amesos2::query("amesos2_cholmod")) {      } else if (Amesos2::query("amesos2_cholmod")) {
147          solver = Amesos2::create<Matrix, Vector>("amesos2_cholmod", A, X, B);          solver = Amesos2::create<Matrix, Vector>("amesos2_cholmod", A, X, B);
148          Teuchos::ParameterList solverParams(solver->name());          Teuchos::ParameterList solverParams(solver->name());
149          solverParams.set("DiagPivotThresh", sb.getDiagonalDominanceThreshold());  
150          solverParams.set("SymmetricMode", sb.isSymmetric());          solverParams.set("SymmetricMode", sb.isSymmetric());
151          extractParamIfSet<std::string>("Trans", pyParams, solverParams);          extractParamIfSet<std::string>("Trans", pyParams, solverParams);
152          extractParamIfSet<bool>("Equil", pyParams, solverParams);          extractParamIfSet<bool>("Equil", pyParams, solverParams);
# Line 158  RCP<DirectSolverType<Matrix,Vector> > cr Line 157  RCP<DirectSolverType<Matrix,Vector> > cr
157          amesosParams->set(solver->name(), solverParams);          amesosParams->set(solver->name(), solverParams);
158      } else if (Amesos2::query("lapack")) {      } else if (Amesos2::query("lapack")) {
159          solver = Amesos2::create<Matrix, Vector>("lapack", A, X, B);          solver = Amesos2::create<Matrix, Vector>("lapack", A, X, B);
160            Teuchos::ParameterList solverParams(solver->name());
161            solverParams.set("MatrixType", (sb.isSymmetric() || sb.isHermitian()) ? "symmetric" : "general");
162      } else {      } else {
163          if (dontcare) {          if (dontcare) {
164              throw TrilinosAdapterException("Could not find an Amesos2 direct solver!");              throw TrilinosAdapterException("Could not find an Amesos2 direct solver!");

Legend:
Removed from v.6798  
changed lines
  Added in v.6799

  ViewVC Help
Powered by ViewVC 1.1.26