[petsc-dev] [petsc4py] Extending the Mat extension type

Jed Brown jedbrown at mcs.anl.gov
Mon Oct 29 13:39:16 CDT 2012


On Mon, Oct 29, 2012 at 11:29 AM, Florian Rathgeber <
florian.rathgeber at gmail.com> wrote:

> > http://www.mcs.anl.gov/petsc/documentation/changes/dev.html
>
> This change hasn't landed in the public repository yet, has it?
>

Yes, there is no MatGetArray() in petsc-dev. It's MatSeqAIJGetArray(), etc.


>
> I'm using petsc-dev. In light of Matt's comment, we could initially
> support SeqAIJ matrices and when the interface change lands both
> SeqAIJ and dense. We could call the respective implementation
> depending on the matrix types and die for non-supported types. I'm
> happy to work on an initial patch.
>
> I'll also try to come up with a MatCreateAnyAIJWithArrays in the
> spirit of the existing MatCreateAnyAIJ that petsc4py supports.
>

The upstream MatCreateMPIAIJ() was renamed MatCreateAIJ() because that's
what it always did.

You should be aware that MatCreateMPIAIJWithArrays() just does a loop over
rows calling MatSetValues(). This copy is required because the internal
format is different from the arrays. It's really much better to call
MatSetValues() in your assembly so that there is no intermediate storage.
The arrays that get passed to MatCreateMPIAIJWithArrays() are useless for
computing with directly.


> Lisandro, do you prefer patches to this list, to your personal email
> or do you have some other platform for code review?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20121029/13e3a3bc/attachment.html>


More information about the petsc-dev mailing list