[Trilinos-Users] Question about FillComplete for EpetraCRS matrix

Natarajan CS csnataraj at gmail.com
Thu May 20 18:26:05 MDT 2010


Mike,
  thanks again for the quick reply and suggestion. The only explanation I
can come up with at present after a little checking is that
InsertGlobalValues does not do out of bounds checking. I have attached the
code to this e-mail. What I mean is that if I use line 24 then everything is
just dandy, however, with line 25 in use rather than 24 the code crashes
during FillComplete.

For example if one were to run the example using 2 nodes (Finite difference
nodes) each in x, y and z direction and just 1 processor, the neighbors
(columns in the matrix where the values are non -zero) for each node come up
wrongly (eg for node 6 and node 7, counting in the x direction first, y
second and z  third), however this issue does not manifest itself as an
error during InsertGlobalvalues (not sure if I am doing error checking in a
wrong way!). Using line 24 is clearly a mistake (as can be seen from the
output) but just doesn't show up until FillComplete. I am not sure if what I
am saying is correct but in case someone makes the same mistake this might
be a good to know.

Mike and Eric,
       thank you very much again for the helpful suggestions. Will
definitely try out all three methods and get back to the list if I get
stuck.  I have only begun to use Trilinos and am figuring, very fast, how
deep the well goes! Thanks again for the packages and the support through
the mailing list!

Cheers,

C.S.N

P.S :- Is Graph partitioning in isorropia a la' Metis? Sorry if this is
naieve, I havent yet read the documentation for Isorropia!

On Thu, May 20, 2010 at 4:18 PM, Heroux, Mike <MHeroux at csbsju.edu> wrote:

> I am not sure why your code failed as it did.  Each Epetra method returns
> an error code.  You could check to see if any return as nonzero.
>
> Regarding partitioning, the assignment of nodes is completely flexible,
> depending on the Epetra_Map objects you use to construct vectors and
> matrices.  If you want PE 0 to own a portion of the checkerboard, define PE
> 0's global ID list in your Epetra_Map object to own the appropriate global
> IDs for the checkerboard.
>
> Mike
>
>
> On 5/20/10 4:08 PM, "Natarajan CS" <csnataraj at gmail.com> wrote:
>
> Mike,
>    Thanks for the suggestion. This was a mistake on my side, should have
> taken a closer look at the matrix! With help from a colleague we figured It
> was not a memory leak but rather a bad algorithmic issue. i was inserting
> values where there shouldn't have been values. i.e node 4 (in a 2*2*2
> system) for example had a -1 in the first sub-diagonal and that should not
> have been the case! This makes me wonder, how exactly does FillComplete
> function? In essence by goofing up my stencil I would think I am only
> changing the sparsity pattern, so if all Fill complete is doing is changing
> the indexing, why is there a problem?
>
> Also as an aside, the current allocation of nodes to processors seems like
> dividing linearly (i.e n/p nodes to each processor), is there another way to
> do this? i mean distributing nodes in a checker board pattern? i.e
> nx/px,ny/py,nz/pz nodes in each direction to every processor?
>
> Thanks again for the help, much appreciated.
>
>
> On Thu, May 20, 2010 at 11:18 AM, Heroux, Michael A <maherou at sandia.gov>
> wrote:
> Have you tried a memory checking tool on your code?  This looks a bit like
> a memory error.  If you can run something like valgrind (which is freely
> available for Linux systems) on your code, you might see the problem
> quickly.
>
> Mike
>
>
> On 5/19/10 5:25 PM, "Natarajan CS" <csnataraj at gmail.com <http://csnataraj@
> gmail.com> > wrote:
>
> Sorry about the repost, made a quality goof up while typing, so resending
> the code snippet. The matrix also looks correct when I o/p it, so not sure
> where exactly I am messing things up!
>
> for eg for 2*2*2 grid points :
>
>   Processor    Row Index    Col Index           Value
>       0             0             1                      -1
>       0             0             2                      -1
>       0             0             4                      -1
>       0             0             0                       6
>       0             1             0                      -1
>       0             1             3                      -1
>       0             1             5                      -1
>       0             1             1                       6
>       0             2             3                      -1
>       0             2             0                      -1
>       0             2             6                      -1
>       0             2             2                       6
>       0             3             2                      -1
>       0             3             1                      -1
>       0             3             7                      -1
>       0             3             3                       6
>       1             4             5                      -1
>       1             4             2                      -1
>       1             4             6                      -1
>       1             4             0                      -1
>       1             4             4                       6
>       1             5             4                      -1
>       1             5             3                      -1
>       1             5             7                      -1
>       1             5             1                      -1
>       1             5             5                       6
>       1             6             7                      -1
>       1             6             4                      -1
>       1             6             8                      -1
>       1             6             2                      -1
>       1             6             6                       6
>       1             7             6                      -1
>       1             7             5                      -1
>       1             7             9                      -1
>       1             7             3                      -1
>       1             7             7                       6
>
> .
>
> On Wed, May 19, 2010 at 1:54 PM, Natarajan CS <csnataraj at gmail.com <
> http://csnataraj@gmail.com> > wrote:
> Hello All,
>       I came across the following error (attached) when trying to create a
> laplacian stencil for 3D. I appreciate any help in figuring out if this is
> an algorithmic issue or a trilinos issue. The code crashes during
> FillComplete. I am only sending the relevant functions, however, if someone
> would like to reproduce the issue, I will be happy to send them the code. I
> couldn't find anything similar in the archives, so apologies if a similar
> question has been answered before. I have attached the portions of the code
> that give the bug below and the back trace, if any, from gdb. I am using the
> intel compiler with vendor blas and lapack.
>
> Cheers and thanks in advance,
>
> C.S.N
> ************************************************************
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20100520/c0f7e238/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lap.cpp
Type: application/octet-stream
Size: 4176 bytes
Desc: not available
Url : https://software.sandia.gov/pipermail/trilinos-users/attachments/20100520/c0f7e238/attachment-0001.obj 


More information about the Trilinos-Users mailing list