Page 1 of 1

Write a complete MPI program that computes the sum 1 + 2 + … + p, where p is the number of processes. The program should

Posted: Wed Apr 27, 2022 3:46 pm
by answerhappygod
Write a complete MPI program that computes the sum 1 + 2 + …
+ p, where p is the number of
processes. The program should use MPI collective communication
functions calls in the following way. Each
process i assigns the value
( i + 1 ) to an integer, and then the processes
perform a sum reduction of these values. Process 0 should print the
result of the reduction. As a way to double-check the result,
process 0 should also compute and print the
value p(p + 1)/2.