On Wed, Feb 4, 2015 at 10:00 PM, Gideon Simpson <[email protected]> wrote:
> 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, > > \int_a^x f(s)ds > > for a<= x <=b. > > 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. > I would use MPI, but I would use http://www.mpich.org/static/docs/v3.1/www3/MPI_Scan.html which will give you all the partial sums at once. Matt > -gideon > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
