Installation issue

Issue #29 resolved
akshaykri created an issue

I used pip to install install petsc, petsc4py, slepc and slepc4py from bitbucket. The installation seems ok because pip show works and gives me the following output:

[user1@node1 ~]$ pip show petsc
Name: petsc
Version: 3.7.2
Summary: PETSc: Portable, Extensible Toolkit for Scientific Computation
Home-page: http://www.mcs.anl.gov/petsc/
Author: Lisandro Dalcin
Author-email: dalcinl@gmail.com
License: PETSc
Location: /home/user1/.local/lib/python2.7/site-packages
Requires: 
[user1@node1 ~]$ pip show petsc4py
Name: petsc4py
Version: 3.7.0
Summary: PETSc for Python
Home-page: https://bitbucket.org/petsc/petsc4py/
Author: Lisandro Dalcin
Author-email: dalcinl@gmail.com
License: BSD
Location: /home/user1/.local/lib/python2.7/site-packages
Requires: numpy, petsc
[user1@node1 ~]$ pip show slepc   
Name: slepc
Version: 3.8.0.dev0
Summary: SLEPc: Scalable Library for Eigenvalue Problem Computations
Home-page: http://slepc.upv.es/
Author: Lisandro Dalcin
Author-email: dalcinl@gmail.com
License: LGPL
Location: /home/user1/.local/lib/python2.7/site-packages
Requires: petsc
[user1@node1 ~]$ pip show slepc4py
Name: slepc4py
Version: 3.7.0
Summary: SLEPc for Python
Home-page: https://bitbucket.org/slepc/slepc4py/
Author: Lisandro Dalcin
Author-email: dalcinl@gmail.com
License: BSD
Location: /home/user1/.local/lib/python2.7/site-packages
Requires: petsc4py, slepc

However, when I try running the basic tutorial in my python interpreter, it fails as shown below:

In [1]: import petsc, petsc4py, slepc, slepc4py

In [2]: import sys

In [3]: slepc4py.init(sys.argv)
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-9a838b97e9f5> in <module>()
----> 1 slepc4py.init(sys.argv)

/home/user1/.local/lib/python2.7/site-packages/slepc4py/__init__.pyc in init(args, arch)
     39     """
     40     import slepc4py.lib
---> 41     SLEPc = slepc4py.lib.ImportSLEPc(arch)
     42     PETSc = slepc4py.lib.ImportPETSc(arch)
     43     args  = slepc4py.lib.getInitArgs(args)

/home/user1/.local/lib/python2.7/site-packages/slepc4py/lib/__init__.pyc in ImportSLEPc(arch)
     32     path, arch = getPathArchSLEPc(arch)
     33     PETSc = ImportPETSc(arch)
---> 34     return Import('slepc4py', 'SLEPc', path, arch)
     35 
     36 def getPathArchSLEPc(arch=None):

/home/user1/.local/lib/python2.7/site-packages/petsc4py/lib/__init__.pyc in Import(pkg, name, path, arch)
     62     pathlist = [os.path.join(path, arch)]
     63     fo, fn, stuff = imp.find_module(name, pathlist)
---> 64     module = imp.load_module(fullname, fo, fn, stuff)
     65     module.__arch__ = arch # save arch value
     66     setattr(sys.modules[pkg], name, module)

ImportError: libpetsc.so.3.07: cannot open shared object file: No such file or directory

I believe it is trying to look for libpetsc.so.3.07, but the file it should look for is libpetsc.so.3.7. An ls in the relevant directory gives me this:

[user1@node1 ~]$ ls /home/user1/.local/lib/python2.7/site-packages/petsc/lib
libpetsc.so  libpetsc.so.3.7  libpetsc.so.3.7.2  petsc  pkgconfig

Is this the issue, or could it be something else?

Comments (6)

  1. Jose E. Roman

    I think the problem is that SLEPc is set to a development version, while all other three are stable versions. Set SLEPC_DIR to a release version (or checkout the maint branch if it is a repository). Then rebuild SLEPc and slepc4py.

    See also Issue #27 which had a similar problem.

  2. akshaykri reporter

    Thanks a lot for your quick response! I uninstalled petsc, petsc4py, slepc and slepc4py, and made a fresh start with the maint branches (pip install --user --no-deps git+https://bitbucket.org/petsc/petsc@maint and so on). The install seems successful with the following output from pip show:

    [user1@node1 ~]$ pip show petsc
    Name: petsc
    Version: 3.7.6
    Summary: PETSc: Portable, Extensible Toolkit for Scientific Computation
    Home-page: http://www.mcs.anl.gov/petsc/
    Author: Lisandro Dalcin
    Author-email: dalcinl@gmail.com
    License: PETSc
    Location: /home/user1/.local/lib/python2.7/site-packages
    Requires: 
    [user1@node1 ~]$ pip show petsc4py
    Name: petsc4py
    Version: 3.7.0
    Summary: PETSc for Python
    Home-page: https://bitbucket.org/petsc/petsc4py/
    Author: Lisandro Dalcin
    Author-email: dalcinl@gmail.com
    License: BSD
    Location: /home/user1/.local/lib/python2.7/site-packages
    Requires: numpy, petsc
    [user1@node1 ~]$ pip show slepc   
    Name: slepc
    Version: 3.7.4
    Summary: SLEPc: Scalable Library for Eigenvalue Problem Computations
    Home-page: http://slepc.upv.es/
    Author: Lisandro Dalcin
    Author-email: dalcinl@gmail.com
    License: LGPL
    Location: /home/user1/.local/lib/python2.7/site-packages
    Requires: petsc
    [user1@node1 ~]$ pip show slepc4py
    Name: slepc4py
    Version: 3.7.0
    Summary: SLEPc for Python
    Home-page: https://bitbucket.org/slepc/slepc4py/
    Author: Lisandro Dalcin
    Author-email: dalcinl@gmail.com
    License: BSD
    Location: /home/user1/.local/lib/python2.7/site-packages
    Requires: petsc4py
    

    However, the basic example crashes my python interpreter, this time with a different error message:

    In [1]: import sys
    
    In [2]: import petsc, petsc4py, slepc, slepc4py
    
    In [3]: slepc4py.init(sys.argv)
    --------------------------------------------------------------------------
    It looks like orte_init failed for some reason; your parallel process is
    likely to abort.  There are many reasons that a parallel process can
    fail during orte_init; some of which are due to configuration or
    environment problems.  This failure appears to be an internal failure;
    here's some additional information (which may only be relevant to an
    Open MPI developer):
    
      PMI2_Job_GetId failed failed
      --> Returned value (null) (14) instead of ORTE_SUCCESS
    --------------------------------------------------------------------------
    --------------------------------------------------------------------------
    It looks like orte_init failed for some reason; your parallel process is
    likely to abort.  There are many reasons that a parallel process can
    fail during orte_init; some of which are due to configuration or
    environment problems.  This failure appears to be an internal failure;
    here's some additional information (which may only be relevant to an
    Open MPI developer):
    
      orte_ess_init failed
      --> Returned value (null) (14) instead of ORTE_SUCCESS
    --------------------------------------------------------------------------
    --------------------------------------------------------------------------
    It looks like MPI_INIT failed for some reason; your parallel process is
    likely to abort.  There are many reasons that a parallel process can
    fail during MPI_INIT; some of which are due to configuration or environment
    problems.  This failure appears to be an internal failure; here's some
    additional information (which may only be relevant to an Open MPI
    developer):
    
      ompi_mpi_init: ompi_rte_init failed
      --> Returned "(null)" (14) instead of "Success" (0)
    --------------------------------------------------------------------------
    *** An error occurred in MPI_Init_thread
    *** on a NULL communicator
    *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
    ***    and potentially your MPI job)
    [node1:36473] Local abort before MPI_INIT completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!
    [user1@node1 ~]$
    

    However, it seems that mpi / mpi4py is installed and working well:

    [user1@node1 ~]$ pip show mpi4py
    Name: mpi4py
    Version: 2.0.0
    Summary: Python bindings for MPI
    Home-page: https://bitbucket.org/mpi4py/mpi4py/
    Author: Lisandro Dalcin
    Author-email: dalcinl@gmail.com
    License: BSD
    Location: /home/user1/.local/lib/python2.7/site-packages
    Requires: 
    [user1@node1 ~]$ mpiexec -n 5 python -m mpi4py helloworld
    Hello, World! I am process 0 of 5 on node1.
    Hello, World! I am process 1 of 5 on node1.
    Hello, World! I am process 2 of 5 on node1.
    Hello, World! I am process 3 of 5 on node1.
    Hello, World! I am process 4 of 5 on node1.
    

    I'm not familiar with mpi / mpi4py would greatly appreciate any advice. Thanks!

  3. Lisandro Dalcin

    Does it work if you execute a script using petsc4py/slepc4py with mpiexec? Maybe you are using an MPI build simply does not work if you don't use mpiexec.

  4. akshaykri reporter

    Thanks for the suggestion. Yes, it works if I execute a script as mpiexec -n 1 python -m ex1, where ex1.py is the example script in the demo folder.

    However, it does not work in interactive mode. Even typing python ex1.py into my command prompt fails with the error above.

    Do you think I can continue to work with using mpiexec -n 1 python -m mypetscprogram in the future, or would you suggest a fix to make it work the normal way?

    Thanks!

  5. Lisandro Dalcin

    The lack of interactive support is most likely a limitation of your MPI (or the way it was configured). There is probably nothing to do about it, some MPIs just require mpiexec to run properly, specially if you are running this in a cluster/supercomputer rather than your personal laptop/desktop.

  6. Log in to comment