martinjrobins / parallel_programming_experiments

This repository sets out a few distributed computing test problems to be solved with HPX and compared with MPI
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Calculate the mean and variance of a distributed vector #2

Open martinjrobins opened 7 years ago

martinjrobins commented 7 years ago

See #1 for distributed vector

martinjrobins commented 7 years ago

What is the best parallel algorithm for sum of distributed vector? My first thought was a divide-and-conquer approach, using recursion. i.e

sum(1:n) - > sum(1:n/2) + sum(n/2:n) -> sum(1:n/4) + sum(n/4:n/2) + sun(n/2:3n/4) + sum(3n/4:n)

You could build up this tree of relationships using chained hpx::future objects and then rely on the library to execute the lot (this sort of thing seems to be hpx's selling point, that you don't have to explicitly schedule everything).

but parallel algorithms are pretty new for me. Is there a good textbook for this sort of thing?