← Back to team overview

dolfin team mailing list archive

Re: [Bug 706406] [NEW] Failure creating PyTrilinos object when imported after dolfin

 

The trick using sys.meta_path should be nice to add. I am working on cleaning 
up the main __init__.py file. I can add suggested trick after that.

Johan

On Saturday January 22 2011 12:52:34 Joachim Haga wrote:
> Public bug reported:
> 
> The following test program fails unless the import order is switched.
> The raw_input at the end is to confirm that the crash happens before
> exit.
> 
> -------
> from dolfin import *
> from PyTrilinos import ML
> dolfin.parameters["linear_algebra_backend"] = "Epetra"
> mesh = UnitSquare(8,8)
> V = FunctionSpace(mesh, "CG", 1)
> u,v = TrialFunction(V), TestFunction(V)
> a = u*v*dx
> A = assemble(a)
> MLList = { "aggregation: type"         : "Uncoupled"  }
> ml_prec = ML.MultiLevelPreconditioner(down_cast(A).mat(), 0)
> ml_prec.SetParameterList(MLList)
> ml_agg = ml_prec.GetML_Aggregate()
> ml_prec.ComputePreconditioner()
> raw_input('Finished, press enter to continue')
> ----------
> 
> See bug 705401 (https://bugs.launchpad.net/dolfin/+bug/705401) which is
> about another failure when PyTrilinos is imported after DOLFIN.
> 
> It works fine when PyTrilinos is imported before DOLFIN, so the
> workaround is simple. The problem is that the reported error messages do
> not point obviously to the solution. Some suggestions for dealing with
> the problem are given in the original bug report.
> 
> ** 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/706406

Title:
  Failure creating PyTrilinos object when imported after dolfin

Status in DOLFIN:
  New

Bug description:
  The following test program fails unless the import order is switched.
  The raw_input at the end is to confirm that the crash happens before
  exit.

  -------
  from dolfin import *
  from PyTrilinos import ML
  dolfin.parameters["linear_algebra_backend"] = "Epetra"
  mesh = UnitSquare(8,8)
  V = FunctionSpace(mesh, "CG", 1)
  u,v = TrialFunction(V), TestFunction(V)
  a = u*v*dx
  A = assemble(a)
  MLList = { "aggregation: type"         : "Uncoupled"  }
  ml_prec = ML.MultiLevelPreconditioner(down_cast(A).mat(), 0)
  ml_prec.SetParameterList(MLList)
  ml_agg = ml_prec.GetML_Aggregate()
  ml_prec.ComputePreconditioner()
  raw_input('Finished, press enter to continue')
  ----------

  See bug 705401 (https://bugs.launchpad.net/dolfin/+bug/705401) which
  is about another failure when PyTrilinos is imported after DOLFIN.

  It works fine when PyTrilinos is imported before DOLFIN, so the
  workaround is simple. The problem is that the reported error messages
  do not point obviously to the solution. Some suggestions for dealing
  with the problem are given in the original bug report.





References