← Back to team overview

dolfin team mailing list archive

Re: [Bug 705401] [NEW] When PyTrilinos is imported after dolfin, bad things happen

 

We've discussed this before (but I can't find the bug report that I
thought I filed).

The problem is with PyTrilinos, and I discussed it with the PyTrilinos
developer. The problem is that PyTrilinos does not check if it is
responsible for MPI. From memory, it finalises MPI in the function
at_exit(), which is called before the destructor of linear algebra objects.

I'm a bit reluctant to import a third-party module into the core library
to avoid a bug in the 3rd party library.

Garth

On 20/01/11 13:18, Joachim Haga wrote:
> Public bug reported:
> 
> When using PyTrilinos (ML in particular), the order of imports is
> important. If dolfin is imported first, it crashes at exit, and there
> are problems also with constructing preconditioners etc.
> 
> It looks like it has to do with MPI initialisation, but I haven't looked
> at it closely.
> 
> A simple workaround may be to try an import ML in dolfin/__init__.py
> (just import, not expose) so that it gets initialised. I don't know if
> the performance hit is worth it. It would of course be better to find a
> proper fix.
> 
> Otherwise, it's nice to have it documented here. For google::
>>>> import dolfin
>>>> from PyTrilinos import ML
>>>> exit()
> *** An error occurred in MPI_Finalize
> *** after MPI was finalized
> *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
> [rodin:17864] Abort after MPI_FINALIZE completed successfully; not able to guarantee that all other processes were killed!
> 
> ** Affects: dolfin
>      Importance: Undecided
>          Status: New
>

-- 
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/705401

Title:
  When PyTrilinos is imported after dolfin, bad things happen

Status in DOLFIN:
  New

Bug description:
  When using PyTrilinos (ML in particular), the order of imports is
  important. If dolfin is imported first, it crashes at exit, and there
  are problems also with constructing preconditioners etc.

  It looks like it has to do with MPI initialisation, but I haven't
  looked at it closely.

  A simple workaround may be to try an import ML in dolfin/__init__.py
  (just import, not expose) so that it gets initialised. I don't know if
  the performance hit is worth it. It would of course be better to find
  a proper fix.

  Otherwise, it's nice to have it documented here. For google::
  >>> import dolfin
  >>> from PyTrilinos import ML
  >>> exit()
  *** An error occurred in MPI_Finalize
  *** after MPI was finalized
  *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
  [rodin:17864] Abort after MPI_FINALIZE completed successfully; not able to guarantee that all other processes were killed!





References