Question: MPI Programming. Calculate sum from 0 to a specific number from arguments. A structure is given. Implement the sum reduction part. #include mpi.h #include

MPI Programming.
Calculate sum from 0 to a specific number from arguments. A structure is given. Implement the
sum reduction part.
#include "mpi.h"
#include
#include
int main( int argc, char *argv[])
{
int errs =0;
int rank, size;
MPI_Init( &argc, &argv );
MPI_Comm_rank( MPI_COMM_WORLD , &rank );
MPI_Comm_size( MPI_COMM_WORLD , &size );
// Implement me
MPI_Finalize();
return errs;
}
Experiments:
2
Changing the number of threads, measure its speedups on different amount of calculation, 2000,
20000, and 200000.
You can execute your program with the following command.
$ mpicc -np <# of threads> a.out
Report the following:
1) The speedup results from the experiments.
2) An explanation of how you parallelize the code, including any unexpected issues encountered
or strategies attempted.
3) A copy of your code, any scripts used, and hardware information.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!