[petsc-dev] Need mechanism to set LocalToGlobal mapping in a DMShell

Jed Brown jedbrown at mcs.anl.gov
Thu Feb 21 13:39:32 CST 2013


On Thu, Feb 21, 2013 at 1:31 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

> I don't understand.  There is a DMGlobalToLocalBegin/End() which includes
>
>   } else {
>     ierr = (*dm->ops->globaltolocalbegin)(dm,g,mode == INSERT_ALL_VALUES ?
> INSERT_VALUES : (mode == ADD_ALL_VALUES ? ADD_VALUES :
> mode),l);CHKERRQ(ierr);
>   }
>
>  For Shell, Richard should be able to provide his own begin/end functions.
> Which in his case he is already calling the VecScatterBegin/End() directly
> in his code so he should just be able to keep the scatter context he is
> already creating and use it in shell.  No reason to mess with sections or
> SF, he already has the scatter and just needs to get it into the DMShell
> and shell should have it as a matter of course. Just because everyone was
> to lazy to add DMSetGlobalToLocalBegin/End() doesn't mean it should exist.
> Rich can add it himself trivially and then use (even from Fortran).
>

Yes, if he has VecScatters already that he wants to reuse, this is a fine
option. I proposed this interface earlier in this thread.

DMShellSetGlobalToLocal(DM dm,PetscErrorCode (*begin)(DM,Vec,InsertMode,
Vec),PetscErrorCode (*end)(DM,Vec,InsertMode,Vec));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130221/6fe675cb/attachment.html>


More information about the petsc-dev mailing list