MPI Assignment

DUE Next Saturday, Dec 7, 1159pm
Please email your solutions to hanjunk@cs.princeton.eduaugust@cs.princeton.edu, and dpw@cs.princeton.edu

Put "COS597C:" in the subject line

Implementation:


Implement sum reduction, which calculates sum from 0 to a specific number from arguments. A structure is given. Implement the sum reduction part. 

 

#include "mpi.h"

#include <stdio.h>

#include <stdlib.h>

 

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:
 

Changing the number of threads, measure its speedups on different amount of calculation, 1000, 10000, and 100000. 
 

You can execute your program with the following command.

$ mpicc -np <# of threads> a.out <number to calculate>

=================================================================== 
Report:
The report should include 
1) The speedup results for the experiments you did
2) A discussion of how you parallelized the code and any
unexpected problems you encountered / unusual things you tried
3) A copy of your code, including any scripts you used, and hardware information.
===================================================================