trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.2k stars 564 forks source link

MueLu: How to set user nullspace/coordinates with deprecated off, easy list interface #6129

Closed brian-kelley closed 4 years ago

brian-kelley commented 4 years ago

Question

@trilinos/muelu

The versions of MueLu::Create?PetraPreconditioner that take nullspace and/or coordinates as RCP<MultiVector> arguments have been deprecated (#4868). If deprecated is off, and using the easy parameter list interface, what is the right way to set user nullspace? I've tried just setting them in the param list to the RCP<MultiVector> but I get an exception saying "Nullspace" isn't in the valid list. I'm trying to replace this code in shylu_dd/bddc/src/shylu_SolverMueLu.hpp:

141     m_mueLuPreconditioner =
142       MueLu::CreateTpetraPreconditioner((RCP<Operator>)A, *paramList,
143                                         m_inCoords, m_inNullspace);
brian-kelley commented 4 years ago

What I tried:

141     paramList->set("Nullspace", m_inNullspace);
142     paramList->set("Coordinates", m_inCoords);
143     m_mueLuPreconditioner = 
144       MueLu::CreateTpetraPreconditioner((RCP<Operator>)A, *paramList);

But:

C++ exception with description "/ascldap/users/bmkelle/DeprecatedTpetra/Trilinos/packages/muelu/src/Interface/MueLu_ParameterListInterpreter_def.hpp:1798:

Throw number = 2

Throw test that evaluated to true: true

Error, the parameter {name="Nullspace",type="Teuchos::RCP<Tpetra::MultiVector<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial, Kokkos::HostSpace> > >",value="Teuchos::RCP<Tpetra::MultiVector<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial, Kokkos::HostSpace> > >{ptr=0x1040fb0,node=0x103f2c0,strong_count=6,weak_count=0}"}
in the parameter (sub)list "ANONYMOUS"
was not found in the list of valid parameters!

The valid parameters and types are:
  {
    "problem: type" : string = unknown
    "verbosity" : string = high
    "number of equations" : int = 1
    "max levels" : int = 10
    "cycle type" : string = V
    "coarse grid correction scaling factor" : double = 1
    "fuse prolongation and update" : bool = 0
    "problem: symmetric" : bool = 1
    "xml parameter file" : string = 
    "parameterlist: syntax" : string = muelu
    "hierarchy label" : string = 
    "matvec params" : ParameterList = ...
    "smoother: pre or post" : string = both
    "smoother: type" : string = RELAXATION
    "smoother: pre type" : string = RELAXATION
    "smoother: post type" : string = RELAXATION
    "smoother: params" : ParameterList = ...
    "smoother: pre params" : ParameterList = ...
    "smoother: post params" : ParameterList = ...
    "smoother: overlap" : int = 0
    "smoother: pre overlap" : int = 0
    "smoother: post overlap" : int = 0
    "coarse: max size" : int = 2000
    "coarse: type" : string = SuperLU
    "coarse: params" : ParameterList = ...
    "coarse: overlap" : int = 0
    "aggregation: type" : string = uncoupled
    "aggregation: mode" : string = uncoupled
    "aggregation: ordering" : string = natural
    "aggregation: drop scheme" : string = classical
    "aggregation: drop tol" : double = 0
    "aggregation: min agg size" : int = 2
    "aggregation: max agg size" : int = -1
    "aggregation: brick x size" : int = 2
    "aggregation: brick y size" : int = 2
    "aggregation: brick z size" : int = 2
    "aggregation: max selected neighbors" : int = 0
    "aggregation: Dirichlet threshold" : double = 0
    "aggregation: deterministic" : bool = 0
    "aggregation: phase 1 algorithm" : string = Serial
    "aggregation: enable phase 1" : bool = 1
    "aggregation: enable phase 2a" : bool = 1
    "aggregation: enable phase 2b" : bool = 1
    "aggregation: enable phase 3" : bool = 1
    "aggregation: error on nodes with no on-rank neighbors" : bool = 0
    "aggregation: phase3 avoid singletons" : bool = 0
    "aggregation: allow empty prolongator columns" : bool = 0
    "aggregation: preserve Dirichlet points" : bool = 0
    "aggregation: allow user-specified singletons" : bool = 0
    "aggregation: use interface aggregation" : bool = 0
    "aggregation: export visualization data" : bool = 0
    "aggregation: output filename" : string = 
    "aggregation: output file: time step" : int = 0
    "aggregation: output file: iter" : int = 0
    "aggregation: output file: agg style" : string = Point Cloud
    "aggregation: output file: fine graph edges" : bool = 0
    "aggregation: output file: coarse graph edges" : bool = 0
    "aggregation: output file: build colormap" : bool = 0
    "aggregation: params" : ParameterList = ...
    "strength-of-connection: params" : ParameterList = ...
    "aggregation: mesh layout" : string = Global Lexicographic
    "aggregation: output type" : string = Aggregates
    "aggregation: coarsening rate" : string = {3}
    "aggregation: number of spatial dimensions" : int = 3
    "aggregation: coarsening order" : int = 0
    "export data" : ParameterList = ...
    "print initial parameters" : bool = 1
    "print unused parameters" : bool = 1
    "transpose: use implicit" : bool = 0
    "restriction: scale nullspace" : bool = 0
    "use kokkos refactor" : bool = 0
    "synchronize factory timers" : bool = 0
    "rap: triple product" : bool = 0
    "multigrid algorithm" : string = sa
    "toggle: mode" : string = semicoarsen
    "semicoarsen: coarsen rate" : int = 3
    "semicoarsen: number of levels" : int = 3
    "linedetection: orientation" : string = vertical
    "linedetection: num layers" : int = -1
    "sa: damping factor" : double = 1.33
    "sa: use filtered matrix" : bool = 1
    "sa: calculate eigenvalue estimate" : bool = 0
    "sa: eigenvalue estimate num iterations" : int = 10
    "interp: interpolation order" : int = 1
    "interp: build coarse coordinates" : bool = 1
    "transfer: params" : ParameterList = ...
    "pcoarsen: element" : string = 
    "pcoarsen: schedule" : string = 
    "pcoarsen: hi basis" : string = 
    "pcoarsen: lo basis" : string = 
    "smoother: neighborhood type" : string = 
    "filtered matrix: use lumping" : bool = 1
    "filtered matrix: reuse eigenvalue" : bool = 1
    "filtered matrix: reuse graph" : bool = 1
    "emin: iterative method" : string = cg
    "emin: num iterations" : int = 2
    "emin: num reuse iterations" : int = 1
    "emin: pattern" : string = AkPtent
    "emin: pattern order" : int = 1
    "tentative: calculate qr" : bool = 1
    "tentative: build coarse coordinates" : bool = 1
    "repartition: enable" : bool = 0
    "repartition: partitioner" : string = zoltan2
    "repartition: params" : ParameterList = ...
    "repartition: start level" : int = 2
    "repartition: node repartition level" : int = -1
    "repartition: node id" : int = -1
    "repartition: min rows per proc" : int = 800
    "repartition: target rows per proc" : int = 0
    "repartition: min rows per thread" : int = 0
    "repartition: target rows per thread" : int = 0
    "repartition: max imbalance" : double = 1.2
    "repartition: remap parts" : bool = 1
    "repartition: remap num values" : int = 4
    "repartition: remap accept partition" : bool = 1
    "repartition: print partition distribution" : bool = 0
    "repartition: rebalance P and R" : bool = 0
    "repartition: rebalance Nullspace" : bool = 1
    "repartition: use subcommunicators" : bool = 1
    "rap: relative diagonal floor" : Array(double) = {}
    "rap: fix zero diagonals" : bool = 0
    "rap: fix zero diagonals threshold" : double = 0
    "rap: shift" : double = 0
    "rap: shift diagonal M" : bool = 0
    "rap: shift low storage" : bool = 0
    "rap: shift array" : Array(double) = {}
    "rap: cfl array" : Array(double) = {}
    "rap: algorithm" : string = galerkin
    "matrixmatrix: kernel params" : ParameterList = ...
    "matrixmatrix: kernel params:MM_TAFC_OptimizationCoreCount " : int = 3000
    "isMatrixMatrix_TransferAndFillComplete " : bool = 0
    "reuse: type" : string = none
    "use external multigrid package" : string = none
    "amgx:params" : ParameterList = ...
    "debug: graph level" : int = -1
    "refmaxwell: mode" : string = additive
    "refmaxwell: disable addon" : bool = 1
    "refmaxwell: 11list" : ParameterList = ...
    "refmaxwell: 22list" : ParameterList = ...
    "refmaxwell: use as preconditioner" : bool = 0
    "refmaxwell: dump matrices" : bool = 0
    "refmaxwell: subsolves on subcommunicators" : bool = 0
    "refmaxwell: ratio AH / A22 subcommunicators" : double = 1
  }
lucbv commented 4 years ago

@brian-kelley I can look at this since I instigated the deprecation of the other methods. I will do a quick test in the bddc folder and post an update once I'm sure of the proper path forward. Is this very urgent or can it wait a day or two?

brian-kelley commented 4 years ago

@lucbv Thanks! It's not that urgent. It's for the branch that Tpetra's working on to remove deprecated, which is a work in progress anyway.

brian-kelley commented 4 years ago

The solution was to set "Nullspace" and "Coordinates" inside a sublist "user data". Thanks @lucbv!