[Trilinos-Users] [Trilinos-Help] How to extract existing matrix rows during matrix construction

Williams, Alan B william at sandia.gov
Mon Mar 30 09:05:43 MDT 2009

> I am trying to fill a matrix that has some periodicity
> constraints.  So I start by filling in everything
> in the interior.  Then for guard regions I want to do
> this.
> Row P is related periodically to row R, for which
> the columns have been inserted, so
> Find the columns (indices and values) for row R.
> Put those into row P.
> This works fine in serial, but it fails in parallel,
> I guess because until FillComplete is called, if
> row R and row P are on different processors, then the
> values for row P are not known on the processor holding
> row R.
> I tried calling FillComplete before these "periodicity
> rows" are filled, but then I get
> Epetra ERROR -2, ../../../../packages/epetra/src/Epetra_CrsGraph.cpp, 
> line 1312


It appears as though you are calling the function 'ExtractGlobalRowView', which can only be called before FillComplete has been called. (That's what the above error is complaining about.) After FillComplete has been called, you could instead call ExtractGlobalRowCopy. However, if row R and row P are on different processors, then you will have to do some communication to move values from one processor to the other. The matrix only holds information about local rows.

Take a look at the documentation for Epetra_Import. (See the doxygen-generated documentation on trilinos.sandia.gov.) Perhaps that class can help you move data around.


More information about the Trilinos-Users mailing list