CSCIUA0480051 Parallel Computing

Parallel Computing
Homework Assignment 3
[Total 40 points]
1.
[2] No, higher efficiency does not imply higher speedup.
[3] Efficiency is an indication of how well you do with extra resources. E=Sp/P so with lower P we tend to have higher efficiency but lower speedup. Remember that one core only will have a efficiency of 1.
2. a.
MIPS = #instructions in millions / total time in seconds total time in seconds = total # of cycles * cycle time = total number of cycles /
frequency
[3] Implementation 1:
#instructions in million = 1 total time in sec = (5*105*10 + 5*105*1)/(2*109 ) = 2.75*10 -3 MIPS = 1/(2.75*10-3 )= 363.3
[3] Implementation 2:
#instructions in million = 2
total time in sec = 2*10 6 /2*10 9 =10 -3
MIPS = 2/(10 -3 ) = 2000 MIPS
b.
CPI = total number of cycles / total number of instructions
[3] Implementation 1: CPI = (5*10 5 *10 + 5*10 5 *1)/1000000 = 5.5
[3] Implementation 2: CPI = (2*10 6 )/2000000 = 1
c.
ET = IC*CPI*CT = #cycles/frequency
[3] Implementation 1: ET = (5*10 5 *10 + 5*10 5 *1)/(2*10 9 ) = 2.75*10 -3 seconds
[3] Implementation 2: ET = (2*10 6 )/ (2*10 9 ) = 10 -3 seconds
3.
[1] Simply ensure that no two threads on different cores will be updating elements
of the same cache block.
[1] Since each cache block is 32 bytes = 8 integers, then any two threads must be
working on elements that are 8 elements away in the array from each other.
[1] This can be easily done by giving each thread 256/4 = 64 elements to work on.
It is the same answer for a, b, and c . Because the answer has nothing to do with the
cache size of associativity

你可能感兴趣的:(学习方法)