PETSc for Python

Simon Burton simon at arrowtheory.com
Fri Sep 16 04:57:30 CDT 2005


On Thu, 15 Sep 2005 20:14:02 -0300
Lisandro Dalcin <dalcinl at gmail.com> wrote:

> 
> 
> Simon, some time ago I wrote to Matt Knepley to propose him the
> development of a Python interface to PETSc. He agreed, but I have not
> received any answer yet, I suppose he is busy.
> 
> My bindings are rather mature, I am actually runing nontrivial FEM
> problems in parallel with them.
> 
> I understand you are a "Python guru" in your team. So I really want to
> know if you are interested in something like that. It would be really
> nice to have a 'official' interface for accesing PETSc from Python,
> this will help a lot in comparing differente implementations (Matt
> uses SIDL, I am using SWIG, Matt told me you use pyrex, perhaps other
> guys can try boost libraries).

Hi Lisandro!

Happy to hear from you again :)
(I'm a keen tango dancer, and i know you live in the land of tango).

Not sure what to say here; it seems we have three competing python
wrappers. I started work on pypetsc because we also needed a *complete* wrapper to
PETSc. The pypetsc API is similar to the C API, and to Matt's sidl wrapper (and petsc4py).
So as you say, hopefully we can all converge to the same interface then it won't matter which wrapper is used.

Our wrapper is also complete in that we can access the whole C API, although it's
a little rough to use at the moment. 

It has other advantages:
 -- autogenerated from the (.h) headers, so can track the source
 -- generates pyrex code: array operations (for-loops) can be written in pyrex (==easy) and then compiled to c (==fast code).

We plan to release the tool itself (pyxelator) soon, as it can be used to wrap other c libraries.

There is also the whole python numeric/numarray community to consider: can we expose a matrix API
that looks anything like what they use ? And: we are working with academic institutions who
are migrating from Matlab to python/PETSc, so they have their preferences too.

A much more profound issue is how to employ python to express parallel programming (with all these
different matrix types). That really excites me, but i guess it's beside the point right now.

I'm cc'ing the petsc-dev list, hope thats OK.

ciao!

Simon.


-- 
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com 




More information about the petsc-dev mailing list