[Trilinos-Users] Problem inserting non-local data in Epetra_FECrsMatrix

erhan turan turane at gmail.com
Wed Feb 15 11:28:35 MST 2012


I had a similar problem before. My colleague Cyril Flaig found a
workaround. For non-local entries, you can try SumIntoGlobalValues rather
than InsertGlobalValues. I mean, If A.LRID()== -1 , use SumIntoGlobalValues
with global row index and use InsertGlobalValues otherwise. That might

For that purpose, what is defined was two pointers say AF and A using
Epetra_FECrsMatrix and Epetra_CrsMatrix, respectively. Here, we first
declared AF using the map and later just saying A=AF. Later all methods are
used for A: A->InsertGlobalValues() and A->SumIntoGlobalValues() . Fill is
completed using AF->GlobalAssemble(). If you try, A->FillComplete() it wont
fill non-local entries. That might be not the best solution. Maybe there is
a simpler way. But it will probably work.

Since you mentioned this issue, I want to make a reference to
Epetra_FECrsMatrix documentation. There it reads:

values into the matrix only if the graph has not yet been finalized (
not yet been called). For non-local values, the call to
 *may succeed *but
*may then fail* because the non-local data is not actually inserted in the
underlying matrix until

This might be the reason that FillComplete() alone does not work but those
overloaded SumInto methods over GlobalAssemble() work. However I still
believe that this sentence *may be* vague :)

Erhan Turan
Department of Computer Science
ETH Zurich

On Wed, Feb 15, 2012 at 4:19 PM, Eric Marttila <
eric.marttila at thermoanalytics.com> wrote:

> Dear all,
> I've been using Epetra_CrsMatrix to store a linear system, but recently
> encountered a situation where I need to fill the entire matrix from the
> master
> process.  From reading the Epetra documentation I believe I need to switch
> to
> a EpetraFECrs_Matrix to do this.
> I changed my code to use the EpetraFECrs_Matrix, but my call to
> InsertGlobalValues() fails on the first row of the matrix that is
> non-local to
> the master process.
> I've attached a small section of code that reproduces the behavior.  It
> runs
> fine with 1 process, but fails when inserting row index 2 when run with 2
> processors.
> I would appreciate any thoughts on what I'm missing with my usage of
> EpetraFECrs_Matrix.
> Thanks.
> --Eric
> p.s. I'm running Trilinos 10.8.5 on linux x86_64, using mpich2.
> --
> Eric A. Marttila
> ThermoAnalytics, Inc.
> 23440 Airpark Blvd.
> Calumet, MI 49913
> email: Eric.Marttila at ThermoAnalytics.com
> phone: 810-636-2443
> fax:   906-482-9755
> web: http://www.thermoanalytics.com
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20120215/5c0d6ba8/attachment.html 

More information about the Trilinos-Users mailing list