[petsc-dev] How To: petsc binary to matrix market format

Dave Nystrom dnystrom1 at comcast.net
Sun Jul 1 16:21:51 CDT 2012


Jed Brown writes:
 > On Sat, Jun 30, 2012 at 9:32 PM, Dave Nystrom <dnystrom1 at comcast.net> wrote:
 > 
 > > Thanks.  I don't have access or experience with Matlab so that seems not a
 > > good option.  I'm fairly new to Python and have never done anything with
 > > the
 > > petsc python interface.  But that could be an option.  Once python reads
 > > in a
 > > petsc binary matrix, does it then have a function to write out the matrix
 > > in
 > > matrix market format?  Or would I need to write the python code to do that?
 > >
 > 
 > Scipy has routines to write matrix market files.
 > 
 > PETSc intentionally does not provide this routine because MatrixMarket is
 > such a terrible format. We will give you the gun, but if you want to bolt
 > it to your foot, you have to find your own bolts.

Can't really relate to the last comment.  My interest in MatrixMarket format
is not to shoot myself in the foot.  Rather, it is because of 2 different
reasons.  One is that 2 different vendors have asked for some sample matrices
from the problems I solve and their format preference is MatrixMarket.
Second is that I would like to test some of my matrices with the new version
of cholmod that has gpu support since I have seen good performance with other
matrices and I have not been able to get cholmod to work with cublas in petsc
yet.  Petsc crashes when I try to call cholmod with its cublas support.
However, cholmod has a test program that can read and solve systems which are
input via MatrixMarket format.  I certainly don't want to shoot myself in the
foot or use MatrixMarket format for any sort of production scenario.

Thanks for the suggestions.  I'll look into exploring python for this task.

Dave




More information about the petsc-dev mailing list