















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















































ILP limitsreached?
Distributed Memory
Parallel Parallel Parallel Overall Speedup F ) F
( 1 Speedup
= 1024 Speedup Parallel =
F Parallel =
Speedup Overall = 1024 Speedup Parallel =
F Parallel =
Speedup Overall = (^8). 2 CPI = estCost RemoteRequ estRate RemoteRequ CPI CPI Base ×
= (^4). 0 CPI Base =
estRate RemoteRequ = Cycles 1200 ns/Cycle (^33). 0 400ns estCost RemoteRequ = = We need at least 7 processors just to break even! This cost reduced with CMP/multi-core
#define ASIZE 1024 #define NUMPROC 4 shared double array[ASIZE]; shared double allSum=0; shared mutex sumLock; double mySum=0; for(int i=myPIDASIZE/NUMPROC;i<(myPID+1)ASIZE/NUMPROC;i++) mySum+=array[i]; lock(sumLock); allSum+=mySum; unlock(sumLock); if(myPID=0) printf(“Sum: %lf\n”,allSum);** Array is shared Each processor adds its partial sums to the final result “Master” processor prints the result Each processor sums up “its” part of the array
A read R from address X on processor P1 returns thevalue written by the most recent write W to X on P1 if noother processor has written to X between W and R.
If P1 writes to X and P2 reads X after a sufficient time,and there are no other writes to X in between, P2’s readreturns the value written by P1’s write.
Writes to the same location are serialized: two writes tolocation X are seen in the same order by all processors.