On Thu, 31 Mar 2011, Jonathan Guyer wrote:

>
>
> On Mar 31, 2011, at 1:47 PM, Jacek Hoffman wrote:
>
> > You were right, it was lack of the mpi4py module.
>
> I don't think it's this simple. PyTrilinos doesn't need mpi4py.
>
>
> > Now everything works.
> > There are no errors provided mpi4py is imported prior to fipy or
> > trilinos, e.g in the script:
> >
> > from mpi4py import *
> > import fipy
> >
> > or in ipython:
> >
> > In [1]: from mpi4py import *
> >
> > In [2]: from PyTrilinos import Epetra
> >
> > In [3]: comm = Epetra.PyComm()
> >
> > In [4]: comm.MyPID()
> > Out[4]: 0
>
> Even with mpi4py installed, you still have to import it before you can 
> `import fipy`?
>
> Certainly PyTrilinos doesn't care whether mpi4py is installed or not.
>
> I would guess that libopenmpi-dev is the key missing component. You probably 
> need to rebuild (or have the package manager reinstall) PyTrilinos to use 
> this libopenmpi-dev and/or you still do need to set LD_LIBRARY_PATH. Probably 
> importing mpi4py gets the MPI library loaded so that PyTrilinos can then use 
> it, but it's not installed such that PyTrilinos can find it on its own, and 
> it should be.
>
>

Package manager installs binary packages but lib*-dev libraries are
development libraries used only by compiler. libopenmpi-dev was installed
for compiling mpi4py.

Lets take the error messages verbatim:

*** The MPI_comm_size() function was called before MPI_INIT was invoked.
*** This is disallowed by the MPI standard.
*** Your MPI job will now abort.

from some hidden reasons THE ORDER of MPI calls in fipy is not
appropriate for Debian python install.
Perhaps wild card import from mpi4py invokes __init__ and things work.
I know nothing about trilinos.

Some time ago python on Debian appeared to became more pedantic. I produce
lots of small throw-away scripts with wildcard imports like from scipy
import *, from pylab import *. Some day after an upgrade many of them
ceased to work. For some submodules there is now necessary explicit import.
For example "from scipy import *" is not enough for access of function
from scipy.special.
I don't know whether it is Debian policy or general Python tendency.


Package python-mpi4py  ver. 1.2.2-1 is sent to Daniel

Reply via email to