MPI Online Quiz, 3rd quarter Answer Form

Write a parallel application for factorial(n)

  1. Enter a number in process 0, for example 8
  2. Each process finds the partial product of the factorial(n) - Example (for four processes), process 0 finds 1*2; process 1 finds 3*4; process 2 finds 5*6; and process 3 finds 7*8.
  3. Use MPI_Reduce and MPI_PROD to find the product of all of these partial products - Example, process 0 finds 2 * 12 * 30 * 56 = 40320
  4. Process 0 prints the result (40320).
  5. Initial test verification.

  6. Other tests

  7. If you wrote the extra version in which the number of processes does not necessarily divide evenly into n, verify these outputs:

  8. Paste in your code that reads in the value of n and sends this value to all of the processes.
    
    
    
    
    
    

  9. Paste in your code for Process 0, the root process. Show the calculations that the root process does.
    
    
    
    
    

  10. Paste in your code for the processes other than Process 0. Show these calculations.
    
    
    
    
    
    
  11. If you used MPI_Reduce and MPI_PROD, show your code for this.
    
    
    
    

  12. If you used another algorithm rather than MPI_Reduce, show your code for this alternative version