You are given the following C++ program that performs naïve matrix multiplication for increasing matrix sizes: // Naive square matrix multiplication: C = A * B (all n x n)void matmul(const std::vector &A, const std::vector &B, std::vector &C) { int n = A.size(); for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) for (int k = 0; k < n; ++k) C[i][j] += A[i][k] * B[k][j];} Assume the main() function measures the runtime for matrix sizes n = 100, 200, 400, 800, 1600. The computational complexity (i.e. the number of floating-point operations) performed by matmul() is proportional to n3 (written as O(n3)). Answer the following: (a) If the time for n = 200 is measured to be 0.25 seconds, estimate the expected runtime for: n = 400 n = 800 Assume ideal cubic scaling (O(n3)) (b) In reality, the measured execution times for large matrices (e.g., n = 1600 ) are often much worse than the ideal cubic prediction. Explain two reasons related to memory hierarchy or cache behavior that cause this slowdown. (c) Explain why matrix multiplication is embarrassingly parallel at the level of output elements, and briefly describe how OpenMP could parallelize the outer loops. Suppose a student parallelizes the i loop with OpenMP and obtains the following runtimes: threads time (s) 1 8.0 4 2.8 8 1.9 Compute for 8 threads: speedup efficiency Then state one likely bottleneck limiting scalability.
Blog
A mid-cap stock is one issued by a company that has a capita…
A mid-cap stock is one issued by a company that has a capitalization of up to $300 million.
The unit price of a 32-ounce carton of orange juice that cos…
The unit price of a 32-ounce carton of orange juice that costs $4.80 is:
Using the information given here, what are the earnings per…
Using the information given here, what are the earnings per share for GHI Company? Note: Round your answer to 2 decimal places. Number of shares outstanding = 160,000 Price per share = $89 Book value per share = $15 Earnings = $704,000
If Jodi owns 200 shares of stock, a 2-for-1 stock split will…
If Jodi owns 200 shares of stock, a 2-for-1 stock split will double the value of her holdings.
It is never too early to start planning for retirement.
It is never too early to start planning for retirement.
What is the approximate market value of a bond that pays $16…
What is the approximate market value of a bond that pays $160 interest each year if comparable interest rates have dropped to 5 percent?
If inflation is expected to be 8.50 percent, how long will i…
If inflation is expected to be 8.50 percent, how long will it take for prices to double?
As of 2020, an individual can give away up to $15,000 per ye…
As of 2020, an individual can give away up to $15,000 per year before paying a gift tax to the IRS.
Using the tax table below, if a person had taxable income of…
Using the tax table below, if a person had taxable income of $15,000 how much would they pay in the 10%Bracket[AnswerA], 12%Bracket[AnswerB], 22%Bracket[AnswerC], MarginalTaxRate[AnswerD]? 10% Up to $9,875 12% $9,876–$40,125 22% $40,126–$85,525 24% $85,526–$163,300 32% $163,301–$207,350 35% $207,351–$518,400 37% Over $518,401