[petsc-users] Scatter context for MatMult

Barry Smith bsmith at mcs.anl.gov
Fri Aug 17 16:03:44 CDT 2012


On Aug 17, 2012, at 1:48 PM, John Fettig <john.fettig at gmail.com> wrote:

> On Fri, Aug 17, 2012 at 2:33 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>> Why do you want raw access?
> 
> I'm trying to write my own RAP operator for AMG.

   Why? Our's is not fast enough and you think you can make it better?  You want to support an R that is not the transpose of P?  Regardless why not start with the current source code we have and fork your own routine instead of starting from scratch? Doing a full efficient RAP from scratch is a major project.

   Barry

> 
>> If you really need, you can either use MatMPIAIJGetSeqAIJ() or just include
>> the private header.
> 
> I presume you mean MatMPIAIJGetLocalMat.  This isn't quite what I
> want.  I don't want the local matrix, I want to scatter a vector
> according to the ghost values defined by the sparsity pattern of the
> parallel matrix.
> 
> Could you give me a little more help with using the latter?  I see
> 
> VecScatterBegin(a->Mvctx,xx,a->lvec,INSERT_VALUES,SCATTER_FORWARD);
> (*a->A->ops->mult)(a->A,xx,yy);
> VecScatterEnd(a->Mvctx,xx,a->lvec,INSERT_VALUES,SCATTER_FORWARD);
> (*a->B->ops->multadd)(a->B,a->lvec,yy,yy);
> 
> So I guess a->Mvctx is what I want.  How do I figure out the mapping
> of indices in a->lvec?
> 
> John



More information about the petsc-users mailing list