Hi PF,(adsbygoogle = window.adsbygoogle || []).push({});

I am working on a parallel reduction code to sum up approximately 1 million 32-bit floating point numbers. The serial part running on each processor uses Kahan summation, no problems there. My problem is that this produces several sum/compensation pairs that now need to be added together. How should this be handled, as I am unable to find helpful literature in the databases my library subscribes to? At the moment I am just adding the two compensation values and treating that as the new compensation value for one of the two numbers to be added.

Secondly, what is the correct way to handle a situation where the two sums must be weighted before summing them? At the moment if I have two Kahan summation results (sum1,compensation1) and (sum2,compensation2) I would proceed as follows: (sum,compensation) = kahan((sum1*w1,compensation1*w1), (sum2*w2,compensation2*w2)) where w1 and w2 are the weights and kahan() is the kahan summation from the paragraph above.

Any advice would be greatly appreciated.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Parallel Kahan summation

Loading...

Similar Threads - Parallel Kahan summation | Date |
---|---|

What should I know before taking Parallel Programming? | Sunday at 12:51 PM |

Porting Python Code to Fortran for Parallel Computing | Dec 15, 2017 |

C/++/# Should I start using a parallel foreach everywhere possible? | Nov 5, 2016 |

Parallel Fortran | Mar 30, 2016 |

Summation function to minimize rounding issues | Apr 29, 2013 |

**Physics Forums - The Fusion of Science and Community**