Supercomputing Applications
Lab 08 Report Form - MPI Programming #4
Calculating PI with arctan and parallel processes

  1. Your name: __________________________________, Period: _____, Date __________

  2. Paste in your code for process 0 (rank 0). Outline/specify exactly what you have process 0 doing. What is sent out to the other processes, what is collected from the other processes, and how and where is the total sum calculated?
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  3. Paste in your code for the other processes other than 0. Outline/specify exactly what you have these other processes doing. What is received from 0, how are the partial sums calculated based on rank, and what is returned to process 0?
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  4. Print results of running your program with various values of n (the length of the loop), for example n=100, n=1000, n=10000, and n=100000.
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  5. Print timing results of running your program with various numbers of processes, for example n=4, n=8, n=12, and n=16.
            time mpirun -np 4 a.out
    
    
    
    
    
    
    
    
    
    
    
    
    
  6. Collect and graph statistics on the effect of the length of the loop on percent error for abs(yourPI-actualPI)/actualPI. (Find an actual value for PI that is accurate to 8 places or more). Create a text file with 3 columns of data: #of processes, calculated PI, %error:
    
        100       3.12876...      .004
    
             . . .
    
        100000      3.14155...      .000013
    
    In order to graph this data, start gnuplot and type:
           plot 'data.txt' using 1:3 with lines
    
    This plots the data in the file data.txt using the 1st and 3rd columns of data.
    
    
    
    
    
    
    
    
    
    

  7. Collect and graph statistics on the effect of the number of processes on the time for calculating PI. Create a text file with 3 columns of data: #of processes, calculated PI, %error:
    
        2       .05
    
             . . .
    
        16      .001     
    
    In order to graph this data, start gnuplot and type:
           plot 'data.txt' using 1:2 with lines
    
    This plots the data in the file data.txt using the 1st and 2nd columns of data.