Question: 2.15. a. Suppose a shared-memory system uses snooping cache coherence and write-back caches. Also suppose that core 0 has the variable x in its cache,

2.15. a. Suppose a shared-memory system uses snooping cache coherence and write-back caches. Also suppose that core 0 has the variable x in its cache, and it executes the assignment x = 5. Finally suppose that core 1 doesn't have x in its cache, and after core O's update to x, core 1 tries to execute y = x. What value will be assigned to y? Why? b. Suppose that the shared-memory system in the previous part uses a directory-based protocol. What value will be assigned to y? Why? c. Can you suggest how any problems you found in the first two parts might be solved? 2.16. a. Suppose the run-time of a serial program is given by Tserial = n, where the units of the run-time are in microseconds. Suppose that a paral- lelization of this program has run-time Tparallel = n/p + log2(). Write a program that finds the speedups and efficiencies of this program for vari- ous values of n and p. Run your program with n= 10,20,40,...,320, and p= 1,2,4,...,128. What happens to the speedups and efficiencies as p is increased and n is held fixed? What happens when p is fixed and n is increased? b. Suppose that Tparallel = Tserial/P + Toverhead. Also suppose that we fix p and increase the problem size. - Show that if Toverhead grows more slowly than Tserial, the parallel efficiency will increase as we increase the problem size. - Show that if, on the other hand, Toverhead grows faster than Tserial, the parallel efficiency will decrease as we increase the problem size. 2.15. a. Suppose a shared-memory system uses snooping cache coherence and write-back caches. Also suppose that core 0 has the variable x in its cache, and it executes the assignment x = 5. Finally suppose that core 1 doesn't have x in its cache, and after core O's update to x, core 1 tries to execute y = x. What value will be assigned to y? Why? b. Suppose that the shared-memory system in the previous part uses a directory-based protocol. What value will be assigned to y? Why? c. Can you suggest how any problems you found in the first two parts might be solved? 2.16. a. Suppose the run-time of a serial program is given by Tserial = n, where the units of the run-time are in microseconds. Suppose that a paral- lelization of this program has run-time Tparallel = n/p + log2(). Write a program that finds the speedups and efficiencies of this program for vari- ous values of n and p. Run your program with n= 10,20,40,...,320, and p= 1,2,4,...,128. What happens to the speedups and efficiencies as p is increased and n is held fixed? What happens when p is fixed and n is increased? b. Suppose that Tparallel = Tserial/P + Toverhead. Also suppose that we fix p and increase the problem size. - Show that if Toverhead grows more slowly than Tserial, the parallel efficiency will increase as we increase the problem size. - Show that if, on the other hand, Toverhead grows faster than Tserial, the parallel efficiency will decrease as we increase the problem size
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
