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

Florian Rathgeber florian.rathgeber at gmail.com
Mon Oct 29 13:29:24 CDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29/10/12 15:40, Matthew Knepley wrote:
> On Mon, Oct 29, 2012 at 11:15 AM, Lisandro Dalcin
> <dalcinl at gmail.com <mailto:dalcinl at gmail.com>> wrote:
> 
> On 29 October 2012 09:46, Florian Rathgeber 
> <florian.rathgeber at gmail.com <mailto:florian.rathgeber at gmail.com>> 
> wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>> 
>> [Apologies if this should have gone to petsc-users instead]
>> 
> 
> I think this list is perfectly fine for the subject of your
> request.
> 
>> I'd like to extend petsc4py's Mat extension type to expose 
>> MatCreateSeqAIJWithArrays and MatGetArray/MatRestoreArray to
>> python, ideally via attributes/methods directly on the extension
>> type.
>> 
> 
> A minor issue with MatGetArray/MatRestoreArray is to properly
> support AIJ and DENSE matrices.
> 
> 
> Don't do this. We have changed the interface so that it is specific
> to the subtypes:
> 
> http://www.mcs.anl.gov/petsc/documentation/changes/dev.html

This change hasn't landed in the public repository yet, has it?

> Matt
> 
> 
>> I know these shouldn't normally be used and reading this thread
>> [1] I'm assuming Lisandro doesn't currently have any plans for
>> adding either of those to petsc4py?
>> 
> 
> I would love to add them, the only issue is that I'm not sure
> about how to support all the various sparse matrix formats.
> 
> We could start by only supporting AIJ matrices. If you can help
> with an initial patch, I can continue to refine it.
> 
> Are you using petsc-3.3? We can add the required support in branch 
> release-3.3 of petsc4py, then make a new patch release.

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.

Lisandro, do you prefer patches to this list, to your personal email
or do you have some other platform for code review?

Florian

> -- Lisandro Dalcin --------------- CIMEC (INTEC/CONICET-UNL) Predio
> CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo 3000 Santa
> Fe, Argentina Tel: +54-342-4511594 <tel:%2B54-342-4511594> (ext
> 1011) Tel/Fax: +54-342-4511169 <tel:%2B54-342-4511169>
> 
> -- What most experimenters take for granted before they begin
> their experiments is infinitely more interesting than any results
> to which their experiments lead. -- Norbert Wiener
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCOywQACgkQ8Z6llsctAxYpKwCgl/KU/+vzGAPuzrOao9wwStzg
PBUAoOSaZ5+uhcH3kagcw/nuISnDMqJa
=MoWO
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2913 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20121029/25d40f2f/attachment.p7s>


More information about the petsc-dev mailing list