Your submission must include one report (PDF file only) with results and analysis, and four programs. In the programs, document the build procedure and the system you ran the programs on as comments.
1. OpenMP pi summation
The integral of 4/(1+x^2) from 0 to 1 should give an approximation to pi. The integral can be approximately computed using the Reimann sum formulation of a definite integral. The serial pseudocode for this summation is as follows:
delta_x = 1.0/n
sum = 0.0
x = 0.0
for (i = 0 to n-1)
x = (i+0.5) * delta_x
sum = sum + 4.0/(1.0 + x*x)
end
approx_pi = sum * delta_x
(a) Write a C program that performs this computation and parallelize it using OpenMP.
(5 points)
(b) Time the loop for different values of n and different thread concurrencies. What GFlop/s rate do you achieve? Is it along expectations?
(5 points)
/docProps/thumbnail.jpeg
Reviews
There are no reviews yet.