[mpich-discuss] Reverse MPI_Scan

Jed Brown jedbrown at mcs.anl.gov
Sun Jan 15 10:41:37 CST 2012


On Sun, Jan 15, 2012 at 08:53, Bharath Pattabiraman <bharath650 at gmail.com>wrote:

> I am wondering what would be the best way to do prefix sum in the reverse
> direction (cumulative sum from n to 1) on a distributed array. I understand
> MPI_Scan does it, but couldnt figure out how to adapt it for my case.


You could make a communicator with the ranks permuted (likely excessive) or
you could do both MPI_Allreduce and MPI_Scan, then subtract (easy).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120115/ff1f0986/attachment.htm>


More information about the mpich-discuss mailing list