Combining Worker Results in a Reduction Tree

A reduction tree combines independent partial results in levels, potentially shortening the sequential chain of combination steps.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace four partial totals
  2. Choose a lawful combine rule
  3. Show how pairwise reduction exposes parallel levels
  4. Confirm whether grouping the operation changes its meaning

Trace four partial totals

Combine 2 and 4 to get 6 and 5 and 7 to get 12. Then combine 6 and 12 to get 18. There are three additions across two levels. Work and critical paths distinguish those counts.

Choose a lawful combine rule

Changing grouping can change a nonassociative calculation. Keep the required order or choose suitable state. Associative operations explain the property used.[1]

Show how pairwise reduction exposes parallel levels

Values three, seven, two and six can be added as pairs giving ten and eight, then combined to eighteen. Two additions at the first level can execute independently. A balanced tree can reduce depth even while total additions remain three here. See divide and combine.

Level 0: 3,7,2,6
Level 1: 10,8
Level 2: 18
Work: 3 additions, depth: 2 stages

Confirm whether grouping the operation changes its meaning

Exact addition is associative. Subtraction differs with grouping, and finite-precision addition can give different rounding. Test an odd element count and define how the unmatched item advances.

References

  1. OpenMP Architecture Review Board, OpenMP API Specifications ↩