← Back to team overview

dolfin team mailing list archive

Re: Revive PETScKrylovMatrix and PETSUserPreconditioner

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Implemented the changes the way I described below:
* introduces abstract base class PETScBaseMatrix for PETScMatrix and
PETScKrylovMatrix
* change operator for PETScKrylovSolver to be of type PETScBaseMatrix
* PETScKrylovSolver supports solving for PETScMatrix and
PETScKrylovMatrix operators with a transparent interface
* adapted PETScMatrix, PETScKrylovMatrix, PETScKrylovLocalMatrix for
inheritance from PETScBaseMatrix

If you're interested, have a look at my branch and tell me what you think.

Another note about parameters:

In the current implementation user parameters seem not to be respected
since in the constructors of KrylovSolver and its descendants the static
default_parameters are retrieved. I think that should be changed to
actually get dolfin::parameters("krylov_solver") to get the current set
of parameters. Or do I have a misconception here?

Setting parameters in GlobalParameters.h: To my understanding this is
the only possibility to set default parameters before main is invoked;
i.e. if you want to set parameters from the command line using
dolfin::parameters.parse (and not define them in your main, which is
certainly not the right place for default parameters) you have to set
them there, right?

(maybe it is worth starting another thread for the parameter discussion)

Florian

On 20.07.2010 10:38, Garth N. Wells wrote:
> 
> 
> On 20/07/10 09:06, Florian Rathgeber wrote:
> I published my branch here:
> https://code.launchpad.net/~florian-rathgeber/dolfin/gpu-wrappers
> 
> 
>> I'll take a look.
> 
>> One thing from a first glance - don't put specific parameters into
>> GlobalParameters.h. Set specific parameters in the relevant class.
> 
>> Garth
> 
> On 20.07.2010 09:28, Florian Rathgeber wrote:
>>>> Garth,
>>>>
>>>> I recently played around with and revived PETScKrylovMatrix and
>>>> PETSUserPreconditioner (which are not used in the current tip as far as
>>>> I can see). Now I'm thinking what is the best way to merge your latest
>>>> changes to la.
>>>>
>>>> My changes are basically:
>>>> - PETScKrylovMatrix can store and return PETSUserPreconditioner
>>>> - PETScKrylovSolver can also solve for a PETScKrylovMatrix
>>>> - PETScKrylovSolver respects a PETSUserPreconditioner if set (pc_dolfin)
>>>>
>>>> Your changes would provide for a cleaner interface to achieve this, but
>>>> there are some obstacles:
>>>>
>>>> 1) the operator is a GenericMatrix, but PETScKrylovMatrix is not
>>>>
>>>> ->  it makes no sense to derive PETScKrylovMatrix from GenericMatrix,
>>>> since it is only used for the spmv. I thought an option might be to
>>>> introduce a common base class for PETScKrylovMatrix and PETScMatrix and
>>>> have the operator be of that type. Might get a bit messy in setting the
>>>> operator then (tentative dynamic_cast to get object type?)
>>>>
>>>> 2) how to deal with user preconditioners in General?
>>>>
>>>> ->  for PETScKrylovMatrix the user needs to implement a preconditioner
>>>> herself if desired, PETSUserPreconditioner could be used for that (as I
>>>> did it), but it needs to be set by the shell matrix, since it depends on
>>>> its data
>>>> ->  for PETScMatrix, the user preconditioner could be set from outside
>>>> (interface for that is still there, but it's not used! might be
>>>> confusing anyway!)
>>>>
>>>> Curious about any thoughts and ideas.
>>>>
>>>> Florian
>>
>>
>>
>>
_______________________________________________
Mailing list: https://launchpad.net/~dolfin
Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)

iEYEARECAAYFAkxF5bsACgkQ8Z6llsctAxZGDwCfZ3DJx+MaIGNr5VYFnpbcBlRX
ooQAniooodnsIxME0RDImiVJlXeq2RpG
=1Xiz
-----END PGP SIGNATURE-----

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


References