(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:
Answer rating: 100% (QA)
To parallelize the given matvec function using OpenMP we can introduce parallelism to the outer loop ... View the full 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}...
-
Four equal positive point charges, each of charge 6.4C, are at the corners of a square of side 9.2 cm. What charge should be placed at the center of the square so that all charges are at equilibrium?...
-
In Fig. E26.11, R 1 = 3.00 Ω, R 2 = 6.00 Ω, and R 3 = 5.00 Ω. The battery has negligible internal resistance. The current I 2 through R 2 is 4.00 A. (a) What are...
-
An asset costs 15,000, has a residual value of 1,000 and an estimated useful life of five years. Using the straight-line method of depreciation, what is the assets net book value after one year?
-
The Alfredo Fragrance Company produces only one product, a perfume called Hint of Elegance. Hint of Elegance consists of two secret ingredients blended into an exclusive fragrance, which is marketed...
-
ndividual can be classified by gender as male, female, by hair color as black, blonde, brown, red, unknown, and by eye color as black, b How many different classifications are possible (for example,...
-
Jan Martinelli, a junior in college, has been seeking ways to earn extra spending money. As an active sports enthusiast. Jan plays tennis regularly at the Naples Tennis Club, where her family has a...
-
Q1 What is the present value of $28,000 to be received 14 years from today? Assume a discount rate of 4%? Q2 What is the present value of an annuity of $5,500 received at the beginning of each year...
-
What were the main points of this ? Castells's structural take on cities is intended to correct the idea that urban space was shaped by the knowledge and action of those who live, work, and play in...
-
Ricky and Sharon married at age 22, started a family, and bought a house. At age 30, they began making an annual contribution of $4000 to an RRSP. They contin- ued to make these contributions until...
-
Convert the following numbers from base 2 to base 10. Please show the inter- mediate steps. c. (100101.11)2 d. (1101.110)2
-
COMMUNICATING CULTURES ACROSS Can You Connect with a Global Audience on the Web? Reaching an international audience on the web involves more than simply offering translations of the English language....
-
(1) Series A: $6M APP or converts to 10M shares. (2) Series B: $12M APP or converts to 10M shares. (3) Series C: $10M APP or converts to 10M shares. In addition to these investors, the founders hold...
-
After researching a variety of electronic health record platforms, please compare and contrast the top three. What do they all have in common with regards to effective and efficient...
-
Grace is training to be an airplane pilot and must complete five days of flying training in October with at least one day of rest between trainings. How many ways can Grace schedule her flying...
-
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...
-
According to the survey mentioned in this chapter, what are the most important factors companies consider in establishing transfer prices? What might cause this survey to provide less-than-accurate...
-
Istanbul Company is a manufacturer of computers. Its controller resigned in October 2002. An inexperienced assistant accountant has prepared the following income statement for the month of October...
-
Ever heart Manufacturing Company uses a simple manufacturing accounting sys- tem. At the end ol its fiscal year on August 31, 2002, the adjusted trial balance contains the following accounts....
Study smarter with the SolutionInn App