[SciPy-dev] petsc - UMFPACK and scipy

Robert Cimrman cimrman3 at ntc.zcu.cz
Fri Apr 13 08:24:04 EDT 2007


Ondrej Certik wrote:
> On 4/13/07, Robert Cimrman <cimrman3 at ntc.zcu.cz> wrote:
>> Nils Wagner wrote:
>>> Please can you show me an example where petsc solvers are "better" than
>>> UMFPACK.
>> Petsc is really a superpackage providing many parallel linear solvers
>> (iterative, direct, preconditioners, ...) together with nonlinear
>> solvers, time steppers, etc. The solvers can be both petsc-native or
>> external packages, nevertheless all are accessed via a uniform
>> interface. IMHO UMFPACK is one of the optional external solvers petsc
>> can use, so to answer your question, petsc can do anything that UMFPACK
>> does and much more.
> 
> Yes, it's exactly like this. Thus, there is a question whether SciPy
> should support sparse solvers (my answer is yes) and if so, then it
> should support petsc, otherwise, for example me, I am not going to use
> it, as I want to try several solvers according to the problem.

My problems tend to be such that only a direct solvers work :)

> What I am trying to say is that I don't want to write two versions of
> my code - one for petsc and second one for SciPy. And from the zen of
> python:
> 
> There should be one-- and preferably only one --obvious way to do it.

Well, you can use very well both petsc and scipy/numpy together. afaik
petsc4py depends on numpy, so this you need in any case, and scipy is a
set of very useful modules built on top of numpy (particularly its
multidimensional array data type), addressing different fields of
(scientific) computation, not just solving linear systems. It is true
that the sparse matrix support in scipy is not as mature as some users
need, but this can change :). So for now, you can use petsc (or <put
your favourite sparse matrix package here>) for sparse stuff if you
like, and scipy for other things that are not in petsc.
There is no contradiction, imho.

Just my 2kc,

r.



More information about the SciPy-Dev mailing list