Homework 3

Deadline: see web page
Assignments: All parts are to be solved individually (turned in electronically, written parts in ASCII text, NO Word, postscript, etc. permitted unless explicitly stated).

All programs have to be written in C, translated with mpicc/gcc and turned in with a corresponding Makefile.

  1. (50 points) Analyze MPI call statistics and desive a method through PMPI instrumentation to generate a communication matrix.

    Turn in pmpi.c, matrix.data, README

  2. (10 points) Modify the pi program from HW1 (see lecture slides) to parallelize for OpenMP (when called with option "o") and MPI+OpenMP (default). Obtain runtimes on henry2 for the Intel compiler for 100,000,000 intervals using gettimeofday() for OpenMP with 8 threads and OpenMP+MPI with 8 threads and 2 MPI tasks. Report results in README2. Sample runs:
    ./pi o
    Process 0 on localhost with 8 threads
    Enter the number of intervals: (0 quits) 1000000
    pi is approximately 3.1415926535898708, Error is 0.0000000000000777
    wall clock time = 0.  6964 sec.usecs
    
    mpirun -np 2 pi
    Process 0 on login01 with 8 threads
    Enter the number of intervals: (0 quits) 100000
    pi is approximately 3.1415926535981256, Error is 0.0000000000083324
    wall clock time = 0.  2846 sec.usecs
    Process 1 on login01 with 8 threads
    

    Turn in pi.c, README2

  3. (0 points) Learn how to compile and execute a CELL BE program on our Sony PS3 Cluster

  4. (40 points) Modify the pi program from HW1 (see lecture slides) to parallelize for 6 Cell SPEs. Follow the steps below.

    Sample output:

    ./pi
    Enter the number of intervals: (0 quits) 2000000
    pi is approximately 3.1415926535898016, Error is 0.0000000000000084
    elapsed wall time 0.035496 sec.usec
    Enter the number of intervals: (0 quits) 0
    
    ./pi s
    Enter the number of intervals: (0 quits) 2000000
    pi is approximately 3.1415926535899938, Error is 0.0000000000002007
    elapsed wall time 0.108270 sec.usec
    

    Turn in ppu_pi.c, Makefile, spu_pi.c, spu_Makefile, any local header files (if applicable)

What to turn in for programming assignments: