<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 4, 2015 at 10:00 PM, Gideon Simpson <span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Suppose I have a function f at sample points x, with x and f both stored as Vec distributed structures.  What I would like to do is compute an estimate of the anti derivative of f,<div><br></div><div>\int_a^x f(s)ds</div><div><br></div><div>for a<= x <=b.<br><div><br></div><div>One way I can see how to compute this efficiently is to do the numerical quadrature on each node, and then use standard MPI to send the successive cumulative quantity from processor 0 to 1 to 2, and so on.  I am wondering if there is a “PETSc” way to do this kind of calculation, as opposed to relying on MPI code.</div></div></div></blockquote><div><br></div><div>I would use MPI, but I would use</div><div><br></div><div>  <a href="http://www.mpich.org/static/docs/v3.1/www3/MPI_Scan.html">http://www.mpich.org/static/docs/v3.1/www3/MPI_Scan.html</a></div><div><br></div><div>which will give you all the partial sums at once.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><font color="#888888"><div><div>
<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">-gideon</span>

</div>
<br></div></font></span></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>