Parallel graph coloring heuristics to color large-scale general jacobian matrices

Rafael Santos Coelho rafaelsantoscoelho at
Thu Sep 24 11:53:47 CDT 2009

Hello, Hong,

thank you very much for the help. Well, I'm not positive wether I really
understood what that code snippet does, but I'll definitely take a closer
look at it later. For now, I have some doubts I'd like to clear out. As far
as I'm concerned, the following line

> ierr = MatGetColoring(Jac,MATCOLORING_SL,&iscoloring);CHKERRQ(ierr);

gives me the coloring, right? But what if I want to test my own parallel
coloring routine, instead of just using PETSc's? Please, correct me if I'm
wrong: the way I see it, the MatFDColoring context in PETSc is always built
on top of 1) the coloring (ISColoring) *and* 2) the sparsity pattern of the
underlying matrix, right?

The thing is that I've developed my code completely separate from the PETSc
API, I mean, it's written in "pure" ANSI C language/MPI. My goal now is to
link it to the PETSc framework, so that I can benefit from all the other
things already implemented within PETSc. As I'm not quite the expert in the
"inner workings" of the PETSc library, my first guess was that I would have
to provide a special routine to create the MatFDColoring context on each
processor based on the coloring I found and on how my code "represents" the
sparsity pattern of the jacobian matrix.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list