On Feb 21, 2013, at 3:31 PM, Richard Tran Mills <rtm at eecs.utk.edu> wrote:
> I will add DMShellSetGlobalToLocal (and DMShellSetLocalToGlobal).
>
> One other thing: We also need to be do LocalToLocal operations. For the
> structured grid case, we call DMDALocalToLocalBegin/End, and for the
> unstructured grid case we construct our own VecScatter context essentially
> just how it is done in daltol.c for DMDA. Is there a good reason that there
> is no DMLocalToLocalBegin/End?
I don't think so. Just laziness in not moving them over when DM was created
from DA. You can add them.
Barry
>
> --Richard
>
> On 2/21/13 2:42 PM, Barry Smith wrote:
>> On Feb 21, 2013, at 1:39 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>>
>>> 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));
>> Ok, Richard should add this and then end of conversation.
>>
>> Barry
>>
>
>
> --
> Richard Tran Mills, Ph.D.
> Computational Earth Scientist | Joint Assistant Professor
> Hydrogeochemical Dynamics Team | EECS and Earth & Planetary Sciences
> Oak Ridge National Laboratory | University of Tennessee, Knoxville
> E-mail: rmills at ornl.gov V: 865-241-3198 http://climate.ornl.gov/~rmills
>