[Trilinos-Users] Comparing ML to BoomerAMG

Heroux, Michael A maherou at sandia.gov
Thu Jan 3 16:02:27 MST 2013


Yes, this class is supposed to allow you to use hypre with Trilinos iterative solvers.  It implements the Epetra_BasicRowMatrix interface (which "isa" Epetra_RowMatrix and "isa" Epetra_Operator), so a fully-constructed EpetraExt_HypreIJMatrix can be passed in as both the UserMatrix and the PrecOperator (using SetUserMatrix and SetPrecOperator, resp).

The Apply method is the hypre SpMV and the ApplyInverse method is the hypre preconditioner "solve" function, which will behave differently depending on which hypre parameters you select.

I don't know if this class is used much.  It was written a number of years ago by a grad student.  It worked at the time, but may be fragile.  If you run into issues, let me know.


From: Travis Austin <austin at txcorp.com<mailto:austin at txcorp.com>>
Date: Thursday, January 3, 2013 4:36 PM
To: Trilinos Users <Trilinos-Users at software.sandia.gov<mailto:Trilinos-Users at software.sandia.gov>>
Subject: [EXTERNAL] [Trilinos-Users] Comparing ML to BoomerAMG

I'm looking through EpetraExt, in particular the subdirectory, hypre, and it states that the EpetraExt_HypreIJMatrix is
meant to give Hypre users access to Trilinos solvers.  Is this also meant to give access to hypre preconditioners to
AztecOO?  I'd assume so but I'm not quite sure how to do it and was hoping for some hints before jumping right into it.

Here are my thoughts so far.  I have the following code below for using ML as a preconditioner with gmres.  I need a
SetPrecOperator that takes something like MLPrec which appears to be an EpetraOperator.   However, I do not see
an EpetraOperator in EpetraExt_HypreIJMatrix but I do see the following:

int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y);  (**)

This can be used to apply the preconditioner so perhaps this would be what I want to use ti apply a preconditioner from
hypre?  Not sure.  Upon looking some more it seems that you need to write a class that extends Epetra_Operator and
has an apply of the same form as (**) above.

======================= My current code ===========================
  // ---------------------------------------
  //  Solve the system using Krylov solvers
  // ---------------------------------------
  Epetra_LinearProblem problem(&A,&uh,&f);

  AztecOO solver(problem);

  MLList.set("smoother: type", "Gauss-Seidel");
  MLList.set("ML output", 10);

  ML_Epetra::MultiLevelPreconditioner * MLPrec = NULL;
  MLPrec = new ML_Epetra::MultiLevelPreconditioner(A, MLList, true);

  // tell AztecOO to use this preconditioner, then solve
  solver.SetAztecOption(AZ_solver, AZ_gmres);

  int MaxIters = 1000;
  solver.Iterate(MaxIters, 1e-12);

Travis Austin, Ph.D
VP, Computational Mathematics
Tech-X Corporation
5621 Arapahoe Ave
Boulder, CO 80303
austin at txcorp.com<mailto:austin at txcorp.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130103/c5294e1f/attachment.html 

More information about the Trilinos-Users mailing list