Question: a. What is false sharing in a multiprocessor system and how does it affect performance? Explain with one example. [5 Marks] b. Consider the following

a. What is false sharing in a multiprocessor system and how does it affect performance? Explain with one example. [5 Marks] b. Consider the following $\mathrm{C}$ code: double $x, y, z ;$ void first o i $y-x+3 ; $ $z=y / 2.0 ;$ void second $0 ;$ $y=z-3 ;$ In the sequential program first is called before second. (i) What dependencies exist between first and second? Be specific, including line numbers and variable names. [3 Marks] (ii) Using examples from this code, explain what false dependencies are and how they can be eliminated. What are the disadvantages of removing these false dependencies? [3 Marks] c. With the help of any simple program or pseudo-code you wrote in your programming modules and answer the following questions. (i) What (if any) part of this program are inherently serial? [3 Marks] (ii) Does the inherently serial part of the work done by the program decrease as the problem size increases? Or does it remain roughly the same? [4 Marks] d. Give any two (2) reasons why a parallel version running on 2 or more processors of a sequential code might run slower than the sequential version? [2 marks] CS.VS.E1361
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
