[Trilinos-Users] Beginner's problems with PyTrilinos and Anasazi

Thornquist, Heidi K hkthorn at sandia.gov
Tue Dec 16 11:09:10 MST 2008

Hi Marko,

Thanks for sending a copy of your code.  Upon inspection of the attached code snippet, it looks like you
are creating a matrix with 25 rows and columns and then only filling the primary 5x5 block.  This gives
the matrix a nullspace of dimension 20.  Is this the matrix you meant to generate, or did you omit some
of the matrix population for brevity?  If so, could you include all the matrix population code.


Heidi K. Thornquist
Senior Member of Technical Staff
Electrical & Microsystem Modeling
Sandia National Laboratories
P.O. Box 5800, MS 0316
Albuquerque, NM  87185-0316
Phone: (505)284-8426
Fax:   (505)284-5451

On 12/15/08 9:47 PM, "Marko Budisic" <mbudisic at engineering.ucsb.edu> wrote:

Dear Trilinos list,

I would like to use PyTrilinos with Anasazi to compute eigenvectors of
large non-symmetric sparse matrices. In order to familiarize myself with
both packages, I tried to build a small example for computing
1-eigenvector of a probability transition matrix for a random walk on a
graph. The solver I tried to use was BlockKrylovSchur.

I managed to successfuly build the matrix in question and even perform
some basic operations on it (I checked by printing the matrix). I also
managed to pass the setProblem() sanity test with the Eigenproblem
object. However, when I try to invoke the solver, the GEES subroutine
fails which causes the entire code to fail.

This is the traceback from Python:
Traceback (most recent call last):
  File "src/anasazitest.py", line 56, in <module>
    info = mngr.solve()
  File "/usr/lib/python2.5/site-packages/PyTrilinos/Anasazi.py", line
6456, in solve
    return _Anasazi.BlockKrylovSchurSolMgrEpetra_solve(*args)
SystemError: /home/mbudisic/downloads/trilinos-9.0.1/packages/anasazi/src/AnasaziBlockKrylovSchur.hpp:1432:

Throw number = 1

Throw test that evaluated to true: info != 0

Anasazi::BlockKrylovSchur::computeSchurForm(): GEES returned info != 0.

I am guessing that I am mismatching some options, possibly related to
block size and sizes of auxiliary vectors but I don't know how to
correct the problem. Below is the relevant source code.

If anyone could direct me in correcting this problem, I would be very
thankful. Also, if you have any other suggestions, based on my code,
those would also be very much appreciated.

Marko Budisic

# epetra
nx = 5
numglobals = nx*nx
mycomm = Epetra.SerialComm()
mymap = Epetra.Map( numglobals, 0, mycomm )
W = Epetra.CrsMatrix(Epetra.Copy, mymap, 4)

# populate matrix
W.InsertGlobalValues( 0, [1.,2.,3.,2.], [0,1,2,4] )
W.InsertGlobalValues( 1, [1.,2.], [1,2] )
W.InsertGlobalValues( 2, [1.,2.], [2,3] )
W.InsertGlobalValues( 3, [3.,1.], [0,3] )
W.InsertGlobalValues( 4, [2.,1.], [3,4] )

# normalize the matrix
d = Epetra.Vector( W.RowMap() )

print W

eigs = Anasazi.BasicEigenproblem()
eigs.setA( W )

Nev = 1
eigs.setNEV( Nev )

blocksize = 1
storage = Epetra.MultiVector( W.RowMap() , blocksize)

print "Problem set:", eigs.setProblem()

myPL = Teuchos.ParameterList()
myPL.set("Which", "LM")
myPL.set("Block Size",blocksize)
myPL.set("Verbosity", Anasazi.Errors | Anasazi.Warnings | \
             Anasazi.FinalSummary )

mngr = Anasazi.BlockKrylovSchurSolMgr( eigs, myPL )
info = mngr.solve()
print "Problem solved:", info

x = eigs.getSolution()
print x.Evecs()


Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://software.sandia.gov/mailman/private/trilinos-users/attachments/20081216/0070fd15/attachment.html 

More information about the Trilinos-Users mailing list