<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Jed,<br>
<br>
It works fine with the patch. Thanks for your help!<br>
<br>
Regarding my question about having the DMShell object default to
using DMShellGlobalToLocalBegin()/End() if a scatter context has
been specified with DMShellSetGlobalToLocalVecScatter(), does that
sound appropriate? I think the thing to do is to set
dm->ops->globaltolocalbegin to point to
DMShellDefaultGlobalToLocalBegin when the DMShell is created, and
make DMShellDefaultGlobalToLocalBegin check to see if a global to
local VecScatter has been set and then complain (with a helpful
error message) if not.<br>
<br>
--Richard<br>
<br>
On 3/3/13 11:14 AM, Jed Brown wrote:<br>
</div>
<blockquote
cite="mid:CAM9tzSnniyB+tSJAQHFoOBrLjjOP1QRZFe6VON6Gg7aStRppPQ@mail.gmail.com"
type="cite">
<div dir="ltr">Please squash the attached into your previous patch
and test.<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Sat, Mar 2, 2013 at 11:39 PM,
Richard Tran Mills <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:rtm@eecs.utk.edu"
target="_blank">rtm@eecs.utk.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jed
(cc: petsc-dev, in case anyone else cares),<br>
<br>
As we discussed on gchat, if you will grab<br>
<br>
<a moz-do-not-send="true"
href="https://bitbucket.org/rmills/petsc-dev"
target="_blank">https://bitbucket.org/rmills/petsc-dev</a><br>
<a moz-do-not-send="true"
href="https://bitbucket.org/rmills/pflotran-dev"
target="_blank">https://bitbucket.org/rmills/pflotran-dev</a><br>
<br>
you can see what I have been trying to do to get DMShell
usable for wrapping our PFLOTRAN unstructured grids in a
DMs. All of the relevant PFLOTRAN changes are in
discretization.F90. As a first step, I'm only trying to get
the global-to-local operations working using DMs. I'm
seeing the errors when I try to run a very simple
unstructured grid problem in 'example_problems/umesh/usg_5x4x3'.
If I just run PFLOTRAN in there (one process, with no
command-line arguments) it crashes with lots of complaints
along the lines of<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
[0]PETSC ERROR: PetscObjectGetFortranCallback() line 254
in /Users/rmills/proj/petsc-dev_rmills/src/sys/objects/inherit.c<br>
[0]PETSC ERROR: ourglobaltolocalend() line 80 in
/Users/rmills/proj/petsc-dev_rmills/src/dm/impls/shell/ftn-custom/zdmshellf.c<br>
[0]PETSC ERROR: DMGlobalToLocalEnd() line 1668 in
/Users/rmills/proj/petsc-dev_rmills/src/dm/interface/dm.c<br>
</blockquote>
<br>
So it appears that I am doing something wrong. I will admit
that so far I've just blindly emulated the examples you
already had in zdmshellf.c and I haven't taken the time to
digest how the new Fortran callback mechanism works, so
maybe I'm just doing something dumb with that.<br>
<br>
On a somewhat related note, I've added a means to set a
GlobalToLocal scatter context for the DMShell, which I do in
the PFLOTRAN code, and the DMShellDefaultGlobalToLocalBegin/End,
which just performs the scatter using that 'gtol' context
that is stashed. I am setting the 'gtol' scatter and then
specifying that the DMShellDefaultGlobalToLocalBegin/End be
used. I suppose it makes more sense for the user to not
have to set this if the 'gtol' has been given. Should I
make the dm->ops->globaltolocalbegin point to
DMShellDefaultGlobalToLocalBegin when the DMShell is
created, and have that function check to see if the 'gtol'
pointer is indeed set to something?<span class="HOEnZb"><font
color="#888888"><br>
<br>
--Richard<br>
<br>
-- <br>
Richard Tran Mills, Ph.D.<br>
Computational Earth Scientist | Joint Assistant
Professor<br>
Hydrogeochemical Dynamics Team | EECS and Earth
& Planetary Sciences<br>
Oak Ridge National Laboratory | University of
Tennessee, Knoxville<br>
E-mail: <a moz-do-not-send="true"
href="mailto:rmills@ornl.gov" target="_blank">rmills@ornl.gov</a>
V: <a moz-do-not-send="true" href="tel:865-241-3198"
value="+18652413198" target="_blank">865-241-3198</a>
<a moz-do-not-send="true"
href="http://climate.ornl.gov/%7Ermills"
target="_blank">http://climate.ornl.gov/~rmills</a><br>
<br>
</font></span></blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
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: <a class="moz-txt-link-abbreviated" href="mailto:rmills@ornl.gov">rmills@ornl.gov</a> V: 865-241-3198 <a class="moz-txt-link-freetext" href="http://climate.ornl.gov/~rmills">http://climate.ornl.gov/~rmills</a>
</pre>
</body>
</html>