[Trilinos-Users] AztecOO as smoother for ML from Stratimikos

Jonathan Hu jhu at sandia.gov
Thu Jul 7 12:16:47 MDT 2011


Hi Alberto,

    Try replacing

<Parameter name="smoother: type" type="string" value="IFPACK" />
<Parameter name="smoother: ifpack type" type="string" value="IC" />
<Parameter name="smoother: ifpack level-of-fill" type="double" 
value="0.0" />
<Parameter name="smoother: ifpack overlap" type="int" value="1" />

with

<Parameter name="smoother: type" type="string" value="IC">;
<Parameter name="smoother: ifpack overlap" type="int" value="1" />

Please let us know if this helps.

Regards,
Jonathan Hu

trilinos-users-request at software.sandia.gov wrote on 07/07/2011 11:00 AM:
> Subject:
> Re: [Trilinos-Users] AztecOO as smoother for ML from Stratimikos
> From:
> Alberto F. Martín-Huertas <amartin at cimne.upc.edu>
> Date:
> Thu, 7 Jul 2011 19:41:39 +0200
>
> To:
> <trilinos-users at software.sandia.gov>
>
>
> Dear Chris, Dear Mike,
>
> I am now trying to use IFPACK preconditioners instead
> of AztecOO ones as smoothers (in particular, IC(0) factorization as 
> inexact
> solver for an Additive Schwarz with overlap=1). Although Ifpack 
> support is not
> documented in ML 5.0 smoothed aggregations user's guide, I was aware 
> of this support
> from the ParameterListValidator implemented in ML, Trilinos-10.6.4.
>
> However, when running my Stratimikos driver with the following XML 
> parameter file
>
> <ParameterList>
> <Parameter name="Linear Solver Type" type="string" value="AztecOO"/>
> <Parameter name="Preconditioner Type" type="string" value="ML"/>
> <ParameterList name="Linear Solver Types">
> <ParameterList name="AztecOO">
> <ParameterList name="Forward Solve">
> <ParameterList name="AztecOO Settings">
> <Parameter name="Aztec Solver" type="string" value="CG"/>
> <Parameter name="Convergence Test" type="string" value="r0"/>
> <Parameter name="Output Frequency" type="int" value="25"/>
> <Parameter name="Aztec Preconditioner" type="string" value="none"/>
> </ParameterList>
> <Parameter name="Max Iterations" type="int" value="500"/>
> <Parameter name="Tolerance" type="double" value="1e-08"/>
> </ParameterList>
> </ParameterList>
> </ParameterList>
> <ParameterList name="Preconditioner Types">
> <ParameterList name="ML">
> <Parameter name="Base Method Defaults" type="string" value="DD-ML"/>
> <ParameterList name="ML Settings">
> <Parameter name="ML output" type="int" value="10"/>
> <Parameter name="aggregation: nodes per aggregate" type="int" 
> value="64" />
> <Parameter name="smoother: type" type="string" value="IFPACK" />
> <Parameter name="smoother: ifpack type" type="string" value="IC" />
> <Parameter name="smoother: ifpack level-of-fill" type="double" 
> value="0.0" />
> <Parameter name="smoother: ifpack overlap" type="int" value="1" />
> <Parameter name="eigen-analysis: iterations" type="int" value="10"/>
> <Parameter name="eigen-analysis: type" type="string" value="cg"/>
> </ParameterList>
> </ParameterList>
> </ParameterList>
> </ParameterList>
>
> the program catched the following exception:
>
>> *********************************************************
>> ML failed to compute the multigrid preconditioner. The
>> most common problem is an incorrect  data type in ML's
>> parameter list (e.g. 'int' instead of 'bool').
>
>> Note: List.set("ML print initial list",X) might help
>> figure out the bad one on pid X.
>> *********************************************************
>> ML::ERROR:: -1, 
>> /home/amartin/trilinos-10.6.4-Source/packages/ml/src/Utils/ml_MultiLevelPreconditioner.cpp, 
>> line 1694
>> p=0: *** Caught standard std::exception of type 'std::logic_error' :
>>
>> /home/amartin/trilinos-10.6.4-Source/packages/stratimikos/adapters/ml/src/Thyra_MLPreconditionerFactory.cpp:262: 
>>
>>  Throw number = 1
>>  Throw test that evaluated to true: 
>> 0!=ml_precOp->ComputePreconditioner()
>>  Error!
>
> For the moment, I can only get rid of this exception by eliminating 
> the following line in my
> XML file:
>
> <Parameter name="smoother: ifpack type" type="string" value="IC" />
>
> which seems to be correctly spelled. Any other ifpack type 
> preconditioner, such as
> ICT or ILU did not throw the exception. I attach to the message the 
> (very verbose)
> output generated by the driver program. There you will see that ML 
> correctly recognizes the smoother
> options for AMG level 0 (except for level-of-fill, which is -1 in the 
> output instead of 1 as
> in the XML), but seems to generate the exception right after it enters
> level 1.
>
> Apologizes is this is not the appropiate mailing list for ML 
> problems/discussions.
> If not, let me know, I'll re-address the issue over there.
>
> Thanks in advance.
>
> Best regards,
>  Alberto.
>
> On Tue, 5 Jul 2011 19:30:14 +0000, Heroux, Michael A wrote:
>> There is an adapter in AztecOO called AztecOO_Operator.  It wraps and
>> AztecOO instance as an Epetra_Operator.  Might this be a good starting
>> point?
>>
>> Mike
>>
>>
>> On 7/5/11 2:19 PM, "Chris Siefert" <csiefer at sandia.gov> wrote:
>>
>>> Alberto,
>>
>> ML has no problem with using AztecOO as a smoother.  However, there
>>> is
>> no Stratimikos wrapper for this functionality.
>>
>> -Chris
>>
>> On 07/05/2011
>>> 01:15 PM, Bartlett, Roscoe A wrote:
>>> Alberto,
>>>
>>> This sounds like a more
>>> advanced use-case that would require more hooks into ML at the 
>>> Stratimikos
>>> level and is very ML-specific.  Could you use to
>>> Stratimikos::DefaultLinearSolver builder objects and some of your 
>>> own wrapper
>>> code to construct this?  Does ML already have built-in support to 
>>> use AztecOO
>>> internally?  This might be more of question for the ML developers.
>>>
>>>
>>> -Ross
>>>
>>>> -----Original Message-----
>>>> From:
>>> trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
>>>>
>>> users-bounces at software.sandia.gov] On Behalf Of Alberto F. Martín-
>>>>
>>> Huertas
>>>> Sent: Tuesday, July 05, 2011 2:31 AM
>>>> To:
>>> trilinos-users at software.sandia.gov
>>>> Subject: [Trilinos-Users] AztecOO as
>>> smoother for ML from Stratimikos
>>>>
>>>>   Dear all,
>>>>
>>>>   AztecOO solvers can
>>> be used as smoothers for
>>>>   the ML hierarchy. The AztecOO params and
>>> options
>>>>   arrays are passed to the MultilevelPreconditioner class
>>>>
>>> wrapped around RCP objects via the "smoother: Aztec options" and
>>>>
>>> "smoother: Aztec params"
>>>>   keys of a Teuchos::paramList.
>>>>
>>>>   I would
>>> like to know whether there exist any means
>>>>   from a XML file to be read by
>>> a Stratimikos
>>>>   driver to set the particular parameters for
>>>>   AztecOO
>>> solvers when they are used as smoothers
>>>>   for ML.
>>>>
>>>>   Thanks in
>>> advance.
>>>>
>>>>   Best regards,
>>>>    Alberto.
>>>>
>>>> -- 
>>>>   Alberto F.
>>> Martín-Huertas
>>>>   Centre Internacional de Mètodes Numèrics a l'Enginyeria
>>> (CIMNE)
>>>>   Parc Mediterrani de la Tecnologia, UPC
>>>>   Esteve Terrades 5,
>>> Building C3, Office 207,
>>>>   08860 Castelldefels (Barcelona, Spain)
>>>>
>>> e-mail: amartin at cimne.upc.edu
>>>>
>>>>   ________________
>>>>   IMPORTANT
>>> NOTICE
>>>>   All personal data contained on this mail will be processed
>>>>
>>> confidentially and registered in a file property of CIMNE in
>>>>   order to
>>> manage corporate communications. You may exercise the rights
>>>>   of access,
>>> rectification, erasure and object by
>>>>   letter sent to Ed. C1 Campus Norte
>>> UPC. Gran Capitán s/n Barcelona.
>>>>
>>>>
>>>>
>>>>
>>> _______________________________________________
>>>> Trilinos-Users mailing
>>> list
>>>> Trilinos-Users at software.sandia.gov
>>>>
>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>>
>>> _______________________________________________
>>> Trilinos-Users mailing
>>> list
>>> Trilinos-Users at software.sandia.gov
>>>
>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>
>> __________________
>>> _____________________________
>> Trilinos-Users mailing
>>> list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/lis
>>> tinfo/trilinos-users
>>
>>
>>
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>
> -- 
> Alberto F. Martín-Huertas
> Centre Internacional de Mètodes Numèrics a l'Enginyeria (CIMNE)
> Parc Mediterrani de la Tecnologia, UPC
> Esteve Terrades 5, Building C3, Office 207,
> 08860 Castelldefels (Barcelona, Spain)
> e-mail: amartin at cimne.upc.edu
>
> ________________
> IMPORTANT NOTICE
> All personal data contained on this mail will be processed 
> confidentially and registered in a file property of CIMNE in
> order to manage corporate communications. You may exercise the rights 
> of access, rectification, erasure and object by
> letter sent to Ed. C1 Campus Norte UPC. Gran Capitán s/n Barcelona.
> _aztecoo.ml.dd-ml_spd_ndagg_64_stdout
>
>
> mpirun --mca btl self,tcp -np 1/home/amartin/Trilinos-Monolithic-Driver/test_monolithic_driver_rel.exe  --matrix-file=/home/amartin/poisson_equation_mm_matrices/matrix_test1_n8.mtx --rhs-file=/home/amartin/poisson_equation_mm_matrices/rhsid_test1_n8.mtx --params-file=/home/amartin/Trilinos-Monolithic-Driver/example_xml_files/poisson_equation_xml_files/_aztecoo.ml.dd-ml_spd_ndagg_64.xml --lhs-file-out=/home/amartin/poisson_equation_mm_matrices_results/bca_tcp/no-par-redist/matrix_test1_n8.mtx%1/_aztecoo.ml.dd-ml_spd_ndagg_64.xml/lhsid_test1_n8.mtx
> Teuchos::GlobalMPISession::GlobalMPISession(): started processor with name taylor and rank 0!
>
> Reading the monolithic linear system coefficient matrix from Matrix Market file '/home/amartin/poisson_equation_mm_matrices/matrix_test1_n8.mtx' ...
>
> Reading the RHS b from Matrix Market file '/home/amartin/poisson_equation_mm_matrices/rhsid_test1_n8.mtx' ...
>
> The LHS x was not provided so generating a zero vector ...
>
> Printing statistics of the monolithic linear system using Epetra Tools ...
>
>    Epetra_CrsMatrix A of dimension 66049 x 66049
>    Nnzs     = 591361
>    ||A||inf = 5.33333
>    ||b||2 = 0.00389099
>    ||x||2 = 0
>
> Printing statistics of the INITIAL partitioning/distribution of the monolithic linear system using Zoltan GP Tools ...
> Number of cuts 0 Cut weight 0
> Balance 1 cutN 0 cutL 0
>
> Printing statistics of the monolithic coefficient matrix using Thyra Tools ...
>   Thyra::EpetraLinearOp{rangeDim=66049,domainDim=66049}
>
>
> Flushing parameter list in XML format as parsed by Teuchos::getParametersFromXmlFile (Please CHECK whether it matches the one provided by --params-file):
>
> <ParameterList>
>    <Parameter name="Linear Solver Type" type="string" value="AztecOO"/>
>    <ParameterList name="Linear Solver Types">
>      <ParameterList name="AztecOO">
>        <ParameterList name="Forward Solve">
>          <ParameterList name="AztecOO Settings">
>            <Parameter name="Aztec Preconditioner" type="string" value="none"/>
>            <Parameter name="Aztec Solver" type="string" value="CG"/>
>            <Parameter name="Convergence Test" type="string" value="r0"/>
>            <Parameter name="Output Frequency" type="int" value="25"/>
>          </ParameterList>
>          <Parameter name="Max Iterations" type="int" value="500"/>
>          <Parameter name="Tolerance" type="double" value="1e-08"/>
>        </ParameterList>
>      </ParameterList>
>    </ParameterList>
>    <Parameter name="Preconditioner Type" type="string" value="ML"/>
>    <ParameterList name="Preconditioner Types">
>      <ParameterList name="ML">
>        <Parameter name="Base Method Defaults" type="string" value="DD-ML"/>
>        <ParameterList name="ML Settings">
>          <Parameter name="ML output" type="int" value="10"/>
>          <Parameter name="aggregation: nodes per aggregate" type="int" value="64"/>
>          <Parameter name="eigen-analysis: iterations" type="int" value="10"/>
>          <Parameter name="eigen-analysis: type" type="string" value="cg"/>
>          <Parameter name="smoother: ifpack level-of-fill" type="double" value="0"/>
>          <Parameter name="smoother: ifpack overlap" type="int" value="1"/>
>          <Parameter name="smoother: ifpack type" type="string" value="IC"/>
>          <Parameter name="smoother: type" type="string" value="IFPACK"/>
>        </ParameterList>
>      </ParameterList>
>    </ParameterList>
> </ParameterList>
>
>
> Computing the preconditioner ...
>
>   Entering Thyra::MLPreconditionerFactory::initializePrec(...) ...
>
>   Creating the initial ML_Epetra::MultiLevelPreconditioner object...
>    >  Creation time = 6.41346e-05 sec
>
>   Computing the factorization of the preconditioner ...
> ------------------------------------------------------------------------------
> USing ParMETIS 3.x
> Using `cg' for eigen-computations
> ***
> *** ML_Epetra::MultiLevelPreconditioner
> ***
> Matrix has 66049 rows and 591361 nonzeros, distributed over 1 process(es)
> The linear system matrix is an Epetra_CrsMatrix
> ** Leaving column map of Main linear system matrix unchanged
> Default values for `DD-ML'
> Maximum number of levels = 3
> Using increasing levels. Finest level  = 0, coarsest level = 2
> Number of applications of the ML cycle = 1
> Number of PDE equations = 1
> Aggregation threshold = 0
> Max coarse size = 128
> R and P smoothing : P = (I-\omega A) P_t, R = P^T
> R and P smoothing : \omega = 1.333/lambda_max
> Null space type      = default (constants)
> Null space dimension = 1
> ML_Gen_MultiLevelHierarchy (level 0) : Gen Restriction and Prolongator
> ML_Aggregate_Coarsen (level 0) begins
> METIS (level 0) : num PDE eqns = 1
> METIS (level 0) : current eps = 0.000000e+00
> METIS (level 0) : Objective : 64 nodes per aggregate
> METIS (level 0) : avg 1032.000000 (block) aggr/process
> METIS (level 0) : # bdry (block) nodes = 1024, # (block) nodes = 66049
> METIS (level 0) : Estimated required mem for METIS = 25861 Kb
> METIS (level 0) : Max estimated mem for METIS = 25861 Kb
> METIS (level 0) : Time to partition graph = 5.390120e-01 (s)
> METIS (level 0) : Using 1032 (block) aggregates (globally)
> METIS (level 0) : # (block) aggre/ # (block) rows =  1.56248 % ( = 1032 / 66049)
> METIS (level 0) : 1032 (block) aggregates (globally)
> METIS (level 0) : Total (block) nnz = 582169 ( =  8.81/(block)row)
> Calling ML_Operator_UnAmalgamateAndDropWeak
> Gen_Prolongator (level 0) : Max eigenvalue = 1.4786e+00
>
> Prolongator/Restriction smoother (level 0) : damping factor #1 = 9.0153e-01
> Prolongator/Restriction smoother (level 0) : ( = 1.3330e+00 / 1.4786e+00)
>
> ML_Gen_MultiLevelHierarchy (level 1) : Gen Restriction and Prolongator
> ML_Aggregate_Coarsen (level 1) begins
> METIS (level 1) : num PDE eqns = 1
> METIS (level 1) : current eps = 0.000000e+00
> METIS (level 1) : Objective : 64 nodes per aggregate
> METIS (level 1) : avg 16.000000 (block) aggr/process
> METIS (level 1) : # bdry (block) nodes = 0, # (block) nodes = 1032
> METIS (level 1) : Estimated required mem for METIS = 386 Kb
> METIS (level 1) : Max estimated mem for METIS = 386 Kb
> METIS (level 1) : Time to partition graph = 4.730940e-03 (s)
> METIS (level 1) : Using 16 (block) aggregates (globally)
> METIS (level 1) : # (block) aggre/ # (block) rows =  1.55039 % ( = 16 / 1032)
> METIS (level 1) : 16 (block) aggregates (globally)
> METIS (level 1) : Total (block) nnz = 7868 ( =  7.62/(block)row)
> Calling ML_Operator_UnAmalgamateAndDropWeak
> Gen_Prolongator (level 1) : Max eigenvalue = 1.5837e+00
>
> Prolongator/Restriction smoother (level 1) : damping factor #1 = 8.4171e-01
> Prolongator/Restriction smoother (level 1) : ( = 1.3330e+00 / 1.5837e+00)
>
> Smoothed Aggregation : operator complexity = 1.013659e+00.
> Time to build the hierarchy = 0.717256 (s)
> Number of actual levels : 3
>
> Smoother (level 0) : # global rows = 66049, # estim. global nnz = 591361
> Smoother (level 0) : IFPACK, type=`IC',
> Smoother (level 0) : both,overlap=1
> Smoother (level 0) : level-of-fill=-1,rel. threshold=1,abs. threshold=0
> =====================================================================================
>
>                                   TimeMonitor Results
>
> Timer Name                                                 Local time (num calls)
> -------------------------------------------------------------------------------------
> test_monolithic_driver.cpp::A. Read coeff. matrix          0.7487 (0)
> test_monolithic_driver.cpp::B. Read.or.generate LHS        0.0002851 (0)
> test_monolithic_driver.cpp::C. Read.or.generate RHS        0.06015 (0)
> test_monolithic_driver.cpp::D. Partition coeff. mat.       0 (0)
> test_monolithic_driver.cpp::E. Redistribute coeff. mat.    0 (0)
> test_monolithic_driver.cpp::F. Redistribute LHS            0 (0)
> test_monolithic_driver.cpp::G. Redistribute RHS            0 (0)
> test_monolithic_driver.cpp::H. Comput. Precond.            0 (0)
> test_monolithic_driver.cpp::I. Sol. Precond. System        0 (0)
> test_monolithic_driver.cpp::J. Redistribute-Reverse LHS    0 (0)
> -------------------------------------------------------------------------------------
> test_monolithic_driver.cpp::K. Write RHS                   0 (0)
> test_monolithic_driver.cpp::L. Total Execution Time        1.772 (0)
> IfpackPF                                                   0 (0)
> IfpackPF:Creation                                          0 (0)
> IfpackPF:Factorization                                     0 (0)
> =====================================================================================



More information about the Trilinos-Users mailing list