Hi,
I'm looking at an example bundled with source : PI calculation.
--
MPI::COMM_WORLD.Bcast(&n, 1, MPI::INT, 0);
/* ... */
// Combine all the partial results
MPI::COMM_WORLD.Reduce(&mypi, &pi, 1, MPI::DOUBLE, MPI::SUM, 0);
--
A I have a simple question : in this case, results are combined (reduced) on all the computers ? It means that all the computers on the ring are doing the adition of the results, even if the result was queried by the #0 ? How to avoid wasting sutch processor time ?
Thanks
Mathieu
|