(d) A C function for the matrix-vector multiply using Compressed Row Storage is shown below: 1...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(d) A C function for the matrix-vector multiply using Compressed Row Storage is shown below: 1 int mat_vec(float *v, struct CRS_mat M, float *u){ 2 int i,j; 3 4 5 6 for(i=0;i<M.nrow;i++){ for(j=M.row_start[i]; j<M.row_start[i+1]; j++){ v[i]+= M.val[j] * u[ M.col[j] ]; } 7 } 8 return 0; 9} How would you parallelise this function using OpenMP? Annotate the changes needed to the code (providing line numbers). (6 marks) (d) A C function for the matrix-vector multiply using Compressed Row Storage is shown below: 1 int mat_vec(float *v, struct CRS_mat M, float *u){ 2 int i,j; 3 4 5 6 for(i=0;i<M.nrow;i++){ for(j=M.row_start[i]; j<M.row_start[i+1]; j++){ v[i]+= M.val[j] * u[ M.col[j] ]; } 7 } 8 return 0; 9} How would you parallelise this function using OpenMP? Annotate the changes needed to the code (providing line numbers). (6 marks)
Expert Answer:
Related Book For
An Introduction To Statistical Methods And Data Analysis
ISBN: 9781305465527
7th Edition
Authors: R. Lyman Ott, Micheal T. Longnecker
Posted Date:
Students also viewed these programming questions
-
Evaluate each expression using the given table of values: a. (g(-1)) b. g((0)) c. ((-1)) d. g(g(2)) e. g((-2)) f. (g(1)) X f(x) g(x) -2 1 1 2 0 1 0 -2 0 1 1 - 1 2 2 0
-
Progesterone is secreted by: a. Endometrium during the last 2 weeks of the menstrual cycle b. Corpus luteum during the first 2 weeks of the menstrual cycle c. Corpus luteum during the last 2 weeks of...
-
In Exercises write an integral that represents the area of the shaded region of the figure. Do not evaluate the integral. r = 4 sin 0 RIN 2 O + 1 2 3 0
-
Which of the following domains are closed and which are bounded? (a) {(x, y) R: x + y 1} (b) {(x, y) = R: x + y <1} (c) {(x, y) = R: x 0} (d) {(x, y) R: x > 0, y > 0} (e) {(x, y) = R: 1 x 4,5 y 10}...
-
Two small charged spheres are 6.52 cm apart. They are moved, and the force each exerts on the other is found to have tripled. How far apart are they now?
-
Suppose that X1, . . . , Xn form a random sample from an unknown probability distribution P on the real line. Let A be a given subset of the real line, and let = P(A). Construct an unbiased...
-
House Handy Products manufactures plastic products and utensils for use in several situations. The company produces and sells a vast range of products that can be used in the home (plastic cooking...
-
What conditions suggest that a ratio variable should be transformed (recoded) into a dichotomous (two group) variable?
-
Using the template proposed below, write a Matlab function fwkinrpp that implements the forward kinematics for the RPP manipulator pictured in Figure 3. function T fwkinrpp (q) end % q is a 3x1...
-
The following is information taken from the June 30, 2023, balance sheet of Tippleton Company: Part 1 During July, Tippleton Company recorded total sales of $904,000, all on credit. There were...
-
Hyde Company is considering two capital investments. Both investments have an initial cost of $6,000,000 and total net cash inflows of $14,000,000 over 10 years. Hyde requires a 20% rate of return on...
-
Elvira is a self-employed taxpayer who turns 42 years old at the end of the year (2019). In 2019, her net Schedule C income was $130,000. This was her only source of income. This year, Elvira is...
-
Ian retired in June 2018 at the age of 69 (he turned 70 in August 2018). Ians retirement account was valued at $490,000 at the end of 2017 and $500,000 at the end of 2018. He has had all of his...
-
Alex is 31 years old and has lived in Los Alamos, New Mexico, for the last four years where he works at the Los Alamos National Laboratory (LANL). LANL provides employees with a 401(k) plan and for...
-
If your company has used metrics and tools to monitor sustainable performance, were the results ever reported to shareholders or external stakeholders?
-
Gerry (age 56) and Elaine (age 54) have been married for 12 years and file a joint tax return. The couple lives in an apartment in downtown Manhattan. Gerrys father, Mortey, recently retired from Del...
-
What is meant by Open Source Software (OSS)? Explain some popular Open Source operating systems.
-
If a and b are positive numbers, find the maximum value of f ( x ) = x a (9 x ) b on the interval 0 x 9.
-
Refer to Exercise 15.41. Based on a residuals analysis, do the necessary conditions for conducting the test of hypotheses appear to be valid?
-
The test for screening donated blood for the presence of the AIDS virus was developed in the 1980s. It is designed to detect antibodies, substances produced in the body of donors carrying the virus;...
-
A horticulturist is designing a study to investigate the effectiveness of five methods for the irrigation of blueberry shrubs. The methods are surface, trickle, center pivot, lateral move, and...
-
The preferred stock of the Luxemburg Mining Corporation pays a $3.25 dividend. What is the value of the stock if your required rate of return is 8 percent?
-
What is the value of Brunei Petroleum Companys preferred stock when the dividend rate is 18 percent on a $100 par value? The appropriate discount rate for a stock of this risk level is 14 percent.
-
What is the value of Queens Park PLCs preferred stock when the dividend rate is 10 percent on a $100 par value? The appropriate discount rate for a stock of this risk level is 16 percent.
Study smarter with the SolutionInn App