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 viewtopic.php?f=8&t=465 for book info and to download the examples. Post your feedback about the book and examples to this forum

Parallel Reduction

Postby jayshenoy » Fri Mar 16, 2012 12:25 pm

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
jayshenoy
 
Posts: 1
Joined: Fri Mar 16, 2012 12:21 pm

Re: Parallel Reduction

Postby MarkB » Tue Mar 20, 2012 4:06 am

OpenMP only supports array reductions in Fortran.

There is some discussion about segmented scan algorithms here which might help: http://ocw.mit.edu/courses/mathematics/ ... 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.
MarkB
 
Posts: 481
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh


Return to Using OpenMP - The Book and Examples

Who is online

Users browsing this forum: No registered users and 2 guests