[Trilinos-Users] Create new entries after calling FillComplete()

Heroux, Mike MHeroux at csbsju.edu
Wed Sep 4 16:53:01 MDT 2013


You should not have to insert values after calling FillComplete.  There are more efficient ways to insert values and keep memory costs much lower.

I am guessing from your message  you are inserting contributions multiple times for some of your matrix entries.    In other words, I am guessing that for a given row i, and column entry j, you are calling InsertGlobalValues multiple times for some or all of the j entries.  This behavior happens if you are filling the matrix using a finite element or finite volume discretization and constructing the matrix using local element matrix contributions, or flux contributions across the volume face.

In this case, each separate insertion of the values for j results in a temporary copy of the value.  Only when FillComplete is called are the repeated values for each j summed together as a single value.  Yes, this is memory expensive, but for users who don't insert multiple contributions, it is faster than trying to merge partial contributions as they come (which is the approach used by Epetra_FECrsMatrix, see next sentence).

If this is the case, probably the best remedy is to use the FECrsMatrix class, which is specifically designed to work with this kind of situation, and sums multiple contribution as they are submitted.

Another approach is to pre-construct the Epetra_CrsGraph associated with your matrix (which also combines entries as they are submitted) and use the Epetra_CrsMatrix constructor that accepts a pre-built graph.

I hope this helps.

Mike

From: 홍광우 <yuriprime at kaist.ac.kr<mailto:yuriprime at kaist.ac.kr>>
Date: Monday, September 2, 2013 12:05 AM
To: "trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>" <trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>>
Subject: [Trilinos-Users] Create new entries after calling FillComplete()


Dear developers & users,


I'm using Epetra package, and I have a question about Epetra_CrsMatrix::FillComplete() method.


At the manual, it says that


Note that, even after a matrix is constructed (FillComplete has been called), it is possible to update existing matrix entries. It is not possible to create new entries.


However, I want to create new entires after calling FillComplete(), because it needs too much memory when I just call Epetra_CrsMatrix::InsertGlobalValues() many times. Is there any solution to this problem?


Sincerely,


Kwangwoo


Kwangwoo Hong

Ph.D Candidate

Department of Chemistry, KAIST

+82-42-350-2855






More information about the Trilinos-Users mailing list