[petsc-users] Multivector Object

Barry Smith bsmith at mcs.anl.gov
Thu Mar 18 21:15:54 CDT 2010


    Henc,

      PETSc has no concept of "multivectors" nor an infrastructure for  
solving linear systems with multiple right hand sides.

      Though there are important subclasses of problems where multiple  
right hand sides do come up, we have chosen not to invest resources  
needed to make PETSc general enough to handle them cleanly and  
efficiently. We have had a small number of requests for such support,  
it seems the vast majority of users have never expressed any need for  
it.

      To truly support "multivectors" I would replace the Vec object  
in PETSc with an object that represents one or more vectors and  
propagate this change throughout PETSc; that is I won't have a Vec  
version of solvers and a multivector version, I would only have a  
multivector version.  The difficulties to truly do this right are
1) multiple right hand size Krylov methods are actually pretty tricky  
to code robustly since one must properly deal with the various  
multivectors in the Krylov space becoming linearly dependent and thus  
one needs to "remove" one of the vectors in the multivector for later  
iterations and then later remove another etc.
2) to get the best performance it is likely one wants to interlace the  
vectors in the multivector. Thus suddenly iterating with one fewer  
vectors is not as simple as simply discarding a pointer, one must  
uninterlace the vectors by one vector.

    In an ideal world with unlimited time and money, we would rewrite  
PETSc around a "multivector" but frankly we have so many other cool  
things that we want to do that this is unlikely to happen.

    Barry


On Mar 18, 2010, at 8:51 PM, Henc Bouwmeester wrote:

> Hello all,
>
> In section 4.2 of the manual, it is stated that the only option for  
> solving linear systems having the same preconditioner is to call  
> KSPSolve() multiple times.  However, when dealing with such a  
> system, one can take advantage of DGEMM when updating the vectors as  
> a 'multivector'.  Has anyone attempted to create a multivector  
> object in PETSc?  If so, what is the interface and where can I find  
> the code?  If not, can anyone speak to the difficulties?
>
> Thank you,
> Henc
>



More information about the petsc-users mailing list