On 1/27/07, <b class="gmail_sendername">Aron Ahmadia</b> &lt;<a href="mailto:aja2111@columbia.edu">aja2111@columbia.edu</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sounds like a documentation bug to me, are you referring to this?<br><a href="http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/DA/DARestoreGlobalVector.html#DARestoreGlobalVector">http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/DA/DARestoreGlobalVector.html#DARestoreGlobalVector
</a><br><br>Perhaps I&#39;m misunderstanding how Get/Restore are being used.&nbsp;&nbsp;I&#39;ll let<br>one of the developers chime in on this when they&#39;ve got a moment.</blockquote><div><br>This is a cut&amp;paste error from GetLocalVector().
<br>&nbsp;<br>&nbsp; Matt <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">~A<br><br>On 1/27/07, Brian Grierson &lt;<a href="mailto:bag2107@columbia.edu">
bag2107@columbia.edu</a>&gt; wrote:<br>&gt; Another quick question.&nbsp;&nbsp;PETSc online help says DAGetGlobal/DARestoreGlobal<br>&gt; is a Seq vector operation, while<br>&gt; DACreateGlobal/VecDesroy is parallel.<br>&gt;<br>&gt; I don&#39;t understand how you could create a global vector in a Seq manner on a
<br>&gt; DA???<br>&gt;<br>&gt;<br>&gt;<br>&gt; Brian A. Grierson<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; Department of Applied Physics<br>&gt;<br>&gt; Columbia University<br>&gt;<br>&gt; Mobile: 646.259.1038<br>&gt;<br>&gt; Work:&nbsp;&nbsp;&nbsp;&nbsp;212-854-4839
<br>&gt;<br>&gt; <a href="mailto:bag2107@columbia.edu">bag2107@columbia.edu</a><br>&gt;<br>&gt; <a href="mailto:bgrierson21@gmail.com">bgrierson21@gmail.com</a><br>&gt;<br>&gt; <a href="http://www.columbia.edu/~bag2107/http://www.apam.columbia.edu/ctx/ctx.html">
http://www.columbia.edu/~bag2107/http://www.apam.columbia.edu/ctx/ctx.html</a><br>&gt;<br>&gt;<br>&gt; On Jan 27, 2007, at 6:41 PM, Aron Ahmadia wrote:<br>&gt;<br>&gt; Hi Brian,<br>&gt;<br>&gt; I took a quick peek at the source for DAGetGlobalVector in the current
<br>&gt; release:<br>&gt;<br>&gt; &quot;<br>&gt;&nbsp;&nbsp;for (i=0; i&lt;DA_MAX_WORK_VECTORS; i++) {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;if (da-&gt;globalin[i]) {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*g&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = da-&gt;globalin[i];<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;da-&gt;globalin[i] = PETSC_NULL;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto alldone;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;ierr = DACreateGlobalVector(da,g);CHKERRQ(ierr);<br>&gt;<br>&gt;&nbsp;&nbsp;alldone:<br>&gt;&nbsp;&nbsp;for (i=0; i&lt;DA_MAX_WORK_VECTORS; i++) {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;if (!da-&gt;globalout[i]) {
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;da-&gt;globalout[i] = *g;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt; &quot;<br>&gt;<br>&gt; The two appear to be very similar, with this exception.&nbsp;&nbsp;Get/Restore<br>&gt; work with one copy of the DA&#39;s global vector, but will make a copy if
<br>&gt; one has already been checked out or none exist.<br>&gt;<br>&gt; DACreateGlobalVector will always make a copy of the global vector,<br>&gt; regardless of the circumstances.&nbsp;&nbsp; I think you&#39;re better off using Get
<br>&gt; and Restore (less data copying) unless you&#39;d like to work with<br>&gt; multiple copies for some reason.<br>&gt;<br>&gt; ~A<br>&gt;<br>&gt; On 1/27/07, Brian Grierson &lt;<a href="mailto:bag2107@columbia.edu">
bag2107@columbia.edu</a>&gt; wrote:<br>&gt;<br>&gt; Could you please tell me the difference between<br>&gt;<br>&gt; DACreateGlobalVector / VecDestroy<br>&gt; and<br>&gt; DAGetGlobalVector / DARestoreGlobalVector<br>&gt;<br>
&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; Brian A. Grierson<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; Department of Applied Physics<br>&gt;<br>&gt; Columbia University<br>&gt;<br>&gt; Mobile: 
646.259.1038<br>&gt;<br>&gt; Work:&nbsp;&nbsp;&nbsp;&nbsp;212-854-4839<br>&gt;<br>&gt; <a href="mailto:bag2107@columbia.edu">bag2107@columbia.edu</a><br>&gt;<br>&gt; <a href="mailto:bgrierson21@gmail.com">bgrierson21@gmail.com</a><br>&gt;<br>
&gt; <a href="http://www.columbia.edu/~bag2107/http://www.apam.columbia.edu/ctx/ctx.html">http://www.columbia.edu/~bag2107/http://www.apam.columbia.edu/ctx/ctx.html</a><br>&gt;<br>&gt;<br>&gt;<br>&gt;<br><br></blockquote>
</div><br><br clear="all"><br>-- <br>One trouble is that despite this system, anyone who reads journals widely<br>and critically is forced to realize that there are scarcely any bars to eventual<br>publication. There seems to be no study too fragmented, no hypothesis too
<br>trivial, no literature citation too biased or too egotistical, no design too<br>warped, no methodology too bungled, no presentation of results too<br>inaccurate, too obscure, and too contradictory, no analysis too self-serving,
<br>no argument too circular, no conclusions too trifling or too unjustified, and<br>no grammar and syntax too offensive for a paper to end up in print. -- Drummond Rennie