[Trilinos-Users] Problems with crashing with the ML's MatrixFreePreconditioner

Heroux, Michael A maherou at sandia.gov
Wed Jul 3 11:47:45 MDT 2013


Jim,

Although not directly related to this issue, I want to make sure you are
aware of a flaw in the Epetra_VbrMatrix design.  Although Epetra_VbrMatrix
inherits from Epetra_RowMatrix, there are irreconcilable issues when using
an Epetra_VbrMatrix object directly as an Epetra_RowMatrix.  The fix for
this is to wrap your Epetra_VbrMatrix in an Epetra_VbrRowMatrix.  This is
a light-weight wrapper class that correctly interprets your
Epetra_VbrMatrix object as an Epetra_RowMatrix object.

This wrapping process is just a few lines of code, but important.  Here is
a link to the documentation:

http://trilinos.sandia.gov/packages/docs/r11.2/packages/epetra/browser/doc/
html/classEpetra__VbrRowMatrix.html

Mike

On 7/3/13 11:20 AM, "Ramsey, James J CIV (US)"
<james.j.ramsey14.civ at mail.mil> wrote:

>I have an Epetra_Operator that I can use for a matrix-free solve with
>AztecOO without a preconditioner, and it gets me the same results as
>corresponding solves with both an Epetra_CrsMatrix and an
>Epetra_FEVbrMatrix assembled from the same element stiffness matrices
>used in the Epetra_Operator. ML's MultiLevelPreconditioner also works
>fine with the Epetra_CrsMatrix and Epetra_FEVbrMatrix. Using this
>Epetra_Operator with the MatrixFreePreconditioner, though, has been a
>problem. I've tried two different types of Epetra_CrsGraph with the
>MatrixFreePreconditioner: one like that used to construct the
>Epetra_CrsMatrix, and one like that used to construct the
>Epetra_FEVbrMatrix (with a block size of 3).
>
>If I use the defaults (i.e., an empty parameter list argument), then my
>test program dies with a std::bad_alloc error. This seems traceable to
>lines 511-515 in ml_MatrixFreePreconditioner.cpp:
>
>  std::vector< std::vector<int> > NodesOfAggregate(NumAggregates);
>
>  for (int i = 0; i < Graph.NumMyBlockRows(); ++i)
>  {
>    int AID = BlockAggr_ML->aggr_info[0][i];
>    NodesOfAggregate[AID].push_back(i);
>  }
>
>The variable AID gets set to a value equal to the value of NumAggregates,
>leading to the crash. (If I replace "NodesOfAggregate[AID]" with
>"NodesOfAggregate.at(AID)", I get a std::out_of_range error instead.)
>
>If I change the aggregation method to "METIS", then I get a different
>error, traceable to line 863 in ml_MatrixFreePreconditioner.cpp, with
>ML_Operator_Getrow returning 1 and NumEntries equal to zero.
>
>I've tried different a couple different nullspaces, a single vector of
>zeros, and six vectors corresponding to rigid body modes. It doesn't make
>a difference.
>
>Any idea of what kinds of things could be going wrong?
>_______________________________________________
>Trilinos-Users mailing list
>Trilinos-Users at software.sandia.gov
>http://software.sandia.gov/mailman/listinfo/trilinos-users




More information about the Trilinos-Users mailing list