Sparse Matrix Inversion using PETSc

Barry Smith bsmith at mcs.anl.gov
Wed Aug 15 16:01:12 CDT 2007


  Tim,

    A dense matrix with 100,000 rows and columns requires 80 gigabytes to store
the result. 1,000,000 rows and columns requires 8,000 gigabytes. 

   With this range of sizes I wouldn't even consider iterative solvers and
would only use direct solvers. I would divide MPI_COMM_WORLD into N 
subcommunicators of size n each and have each subcommunicator work on a 
collection of columns of the inverse. For matrix sizes of 5,000 to say 20,000?
I'd make n be 1 and just use PETSc's native LU solver and use MatMatSolve()
and not use KSP at all. For larger matrices you may be able to use an n of 2
to possibly as large as 8?

   Now my numerical analysis training :-) requires me to state the following.
It is completely insane to compute the EXPLICIT inverse of large sparse matrices
since they are dense. Please tell me what the inverses are used for and perhaps
we can come up with an approach the does not require computing them.

   Barry



On Wed, 15 Aug 2007, Dr. Timothy Stitt wrote:

> Firstly, many thanks to everyone who has replied with information. It has been
> very useful indeed. Much appreciated.
> 
> Barry, in this case the sparse matrices would be of ~ order 5000x5000. They
> could grow in size but this is the sample matrices I am working with right
> now. We would love a scalable approach so we can deal with more interesting
> problems and hence larger sparse matrices. Hope that helps.
> 
> Many thanks again.
> 
> Tim.
> 
> Barry Smith wrote:
> >   Tim,
> > 
> >     How large are you matrices?
> > 
> >    Barry
> > 
> > 
> > On Wed, 15 Aug 2007, Dr. Timothy Stitt wrote:
> > 
> >   
> > > Hi all,
> > > 
> > > I am currently investigating the best way to perform the inversion of a
> > > large
> > > sparse matrix and came upon the idea of using PETSc as a framework for
> > > testing
> > > various strategies from direct to iterative methods on my sample matrices.
> > > In
> > > this setup for an NxN sparse matrix A I would have N rhs's representing
> > > the
> > > Identity matrix and then solve for X. I wanted to experiment with both
> > > parallel and serial strategies ranging from LU Decomposition using
> > > SuperLU,
> > > MUMPS etc. to iterative methods using GMRES etc. Am I right in thinking
> > > that
> > > all this can be done in PETSc by setting up a core framework and then
> > > varying
> > > the solver methods etc?
> > > 
> > > I have looked over the sample KSP Solver codes although they only seem to
> > > suggest single vectors for x and b. Can this be changed to accept multiple
> > > vectors? Can anyone suggest a sample code that maybe demonstrates the sort
> > > of
> > > thing I want to achieve...if it is in fact possible.
> > > 
> > > Thanks in advance for any assistance given,
> > > 
> > > Regards,
> > > 
> > > Tim.
> > > 
> > > 
> > >     
> > 
> >   
> 
> 




More information about the petsc-users mailing list