Parallel Reduction

Use this forum to discuss the book: Using OpenMP - Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas Read the for book info and to download the examples. Post your feedback about the book and examples to this forum
Post Reply

Parallel Reduction

Post by jayshenoy »

I recently learnt that OpenMP doesn't support array reduction (correct me if I'm wrong.). How can I implement segmented scan instead for
the array using OpenMP, I'm sorry I couldn't find much literature on segmented scan.

Thank in advance

Posts: 803
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Parallel Reduction

Post by MarkB »

OpenMP only supports array reductions in Fortran.

There is some discussion about segmented scan algorithms here which might help: ... pter_3.pdf

If you have enough segments such that load balancing is not a problem, then using a parallel loop over segments with a suitable schedule clause might work OK.

Post Reply