← Back to team overview

dolfin team mailing list archive

Re: Fwd: cbc.block with trilinos failing after recent dolfin updates

 

On 18 November 2011 16:43, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
> On 18 November 2011 16:19, Johan Hake <johan.hake@xxxxxxxxx> wrote:
>> This error should have been picked up by a buildbot as:
>>
>>  demo/undomcumented/trilinos/python
>>
>> also fails. I think we need to sort out the PyTrilinos linking bug first as
>> Garth suggested
>
> Fix is on its way.
>

Try it now. The PyTrilinos demo is working again.

Garth

> Garth
>
>> and then look for other sources.
>>
>> Johan
>>
>> On Friday November 18 2011 07:20:23 Martin Sandve Alnæs wrote:
>>> The problem is that dolfin.cpp.EpetraMatrix.mat() returns a
>>> SwigPyObject instead of a PyTrilinos.Epetra.FECrsMatrix.
>>>
>>> With your cbc.block patch, I'm running the following code:
>>>
>>>         print type(Puu)
>>>
>>>         A = dolfin.down_cast(Puu)
>>>         print type(A)
>>>
>>>         B = A.mat()
>>>         print type(B)
>>>
>>>         C = PyTrilinos.ML.MultiLevelPreconditioner(B, 0)
>>>         print type(C)
>>>
>>> With dolfin/1.0.x -r6439 I get:
>>>
>>> <class 'dolfin.cpp.Matrix'>
>>> <class 'dolfin.cpp.EpetraMatrix'>
>>> <class 'PyTrilinos.Epetra.FECrsMatrix'>
>>> <class 'PyTrilinos.ML.MultiLevelPreconditioner'>
>>>
>>> With dolfin/1.0.x -r6447 I get:
>>>
>>> <class 'dolfin.cpp.Matrix'>
>>> <class 'dolfin.cpp.EpetraMatrix'>
>>> <type 'SwigPyObject'>
>>> Traceback (most recent call last):
>>>   File "/home/martinal/dev/cbc/invbench/scripts/invbench", line 5, in
>>> <module> simfra.introrun.run(locals())
>>>   File "/home/martinal/dev/cbc/invbench/src/simfra/introrun.py", line 79,
>>> in run return func(**kwargs)
>>>   File "/home/martinal/dev/cbc/invbench/src/invbench/oneshot.py", line
>>> 160, in case_fruitfly_oneshotblock
>>>     C = PyTrilinos.ML.MultiLevelPreconditioner(B, 0)
>>>   File
>>> "/home/martinal/opt/fenics/dorsal-unstable/lib/python2.7/site-packages/PyT
>>> rilinos/ML.py", line 1442, in __init__
>>>     this = _ML.new_MultiLevelPreconditioner(*args)
>>> NotImplementedError: Wrong number or type of arguments for overloaded
>>> function 'new_MultiLevelPreconditioner'.
>>>   Possible C/C++ prototypes are:
>>>
>>> ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_RowMa
>>> trix const &,bool const)
>>>
>>> ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_RowMa
>>> trix const &,Teuchos::ParameterList const &,bool const)
>>>
>>> ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(ML_Operator
>>> *,Teuchos::ParameterList const &,bool const)
>>>
>>> ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(ML_Operator
>>> *,Teuchos::ParameterList const &,Epetra_RowMatrix
>>> **,Teuchos::ParameterList *,int,bool const)
>>>
>>> ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_RowMa
>>> trix const &,Epetra_RowMatrix const &,Epetra_RowMatrix const
>>> &,Teuchos::ParameterList const &,bool const,bool const)
>>>
>>> ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_RowMa
>>> trix const &,Epetra_RowMatrix const &,Epetra_RowMatrix const
>>> &,Epetra_RowMatrix const &,Teuchos::ParameterList const &,bool const)
>>>
>>> ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_MsrMa
>>> trix const &,ML_Operator *,AZ_MATRIX *,int *,Teuchos::ParameterList const
>>> &,bool const)
>>>
>>>
>>> Martin
>>>
>>> On 18 November 2011 16:03, Joachim Berdal Haga <jobh@xxxxxxxxx> wrote:
>>> >>   self.ml_prec = MultiLevelPreconditioner(A.down_cast().mat(), 0)
>>> >
>>> > I assume Puu is a dolfin.GenericMatrix, so this should be equivalent to
>>> >   PyTrilinos.ML.MultiLevelPreconditioner(dolfin.down_cast(Puu).mat(), 0)
>>> > and the only reason I can see for that to fail is if the returned matrix
>>> > from dolfin isn't (recognised as) an Epetra matrix.
>>> > Does the explicit call above give the same error? If so, what is the type
>>> > of the down_cast(Puu).mat()?
>>> > -j.
>>> >
>>> > On 18 November 2011 15:47, Martin Sandve Alnæs <martinal@xxxxxxxxx> wrote:
>>> >> On 18 November 2011 13:52, Joachim Berdal Haga <jobh@xxxxxxxxx> wrote:
>>> >> > Yep, sorry, forgot the list. Here's a patch for cbc.block which
>>> >> > removes the
>>> >> > workaround, can you see if it helps?
>>> >> > -j.
>>> >>
>>> >> Now I get:
>>> >>
>>> >> Traceback (most recent call last):
>>> >>  File "/home/martinal/dev/cbc/invbench/scripts/invbench", line 5, in
>>> >> <module>
>>> >>    simfra.introrun.run(locals())
>>> >>  File "/home/martinal/dev/cbc/invbench/src/simfra/introrun.py", line 79,
>>> >> in run
>>> >>    return func(**kwargs)
>>> >>  File "/home/martinal/dev/cbc/invbench/src/invbench/oneshot.py", line
>>> >> 168, in case_fruitfly_oneshotblock
>>> >>    P = block_mat([[ML(Puu), 0, 0],
>>> >>  File
>>> >> "/home/martinal/opt/fenics/dorsal-unstable/lib/python2.7/site-packages/b
>>> >> lock/algebraic/trilinos/MLPrec.py", line 25, in __init__
>>> >>    self.ml_prec = MultiLevelPreconditioner(A.down_cast().mat(), 0)
>>> >>  File
>>> >> "/home/martinal/opt/fenics/dorsal-unstable/lib/python2.7/site-packages/P
>>> >> yTrilinos/ML.py", line 1442, in __init__
>>> >>    this = _ML.new_MultiLevelPreconditioner(*args)
>>> >> NotImplementedError: Wrong number or type of arguments for overloaded
>>> >> function 'new_MultiLevelPreconditioner'.
>>> >>  Possible C/C++ prototypes are:
>>> >>
>>> >>  ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_Ro
>>> >> wMatrix const &,bool const)
>>> >>
>>> >>  ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_Ro
>>> >> wMatrix const &,Teuchos::ParameterList const &,bool const)
>>> >>
>>> >>  ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(ML_Operat
>>> >> or *,Teuchos::ParameterList const &,bool const)
>>> >>
>>> >>  ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(ML_Operat
>>> >> or *,Teuchos::ParameterList const &,Epetra_RowMatrix
>>> >> **,Teuchos::ParameterList *,int,bool const)
>>> >>
>>> >>  ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_Ro
>>> >> wMatrix const &,Epetra_RowMatrix const &,Epetra_RowMatrix const
>>> >> &,Teuchos::ParameterList const &,bool const,bool const)
>>> >>
>>> >>  ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_Ro
>>> >> wMatrix const &,Epetra_RowMatrix const &,Epetra_RowMatrix const
>>> >> &,Epetra_RowMatrix const &,Teuchos::ParameterList const &,bool const)
>>> >>
>>> >>  ML_Epetra::MultiLevelPreconditioner::MultiLevelPreconditioner(Epetra_Ms
>>> >> rMatrix const &,ML_Operator *,AZ_MATRIX *,int *,Teuchos::ParameterList
>>> >> const &,bool const)
>>> >>
>>> >>
>>> >> --
>>> >> Martin
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dolfin
>>> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dolfin
>>> More help   : https://help.launchpad.net/ListHelp
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dolfin
>> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dolfin
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>
>


Follow ups

References