






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!







file:///E|/parallel_com_arch/lecture15/15_1.htm[6/13/2012 11:27:57 AM]
file:///E|/parallel_com_arch/lecture15/15_2.htm[6/13/2012 11:27:57 AM]
Communication caused by artifacts of extended memory hierarchy Data accesses not satisfied in the cache or local memory cause communication Inherent communication is caused by data transfers determined by the program Artifactual communication is caused by poor allocation of data across distributed memories, unnecessary data in a transfer, unnecessary transfers due to system- dependent transfer granularity, redundant communication of data, finite replication capacity (in cache or memory) Inherent communication assumes infinite capacity and perfect knowledge of what should be transferred
Most probable reason for artifactual communication Due to finite capacity of cache, local memory or remote memory May view a multiprocessor as a three-level memory hierarchy for this purpose: local cache, local memory, remote memory Communication due to cold or compulsory misses and inherent communication are independent of capacity Capacity and conflict misses generate communication resulting from finite capacity Generated traffic may be local or remote depending on the allocation of pages General technique: exploit spatial and temporal locality to use the cache properly
Maximize reuse of data Schedule tasks that access same data in close succession Many linear algebra kernels use blocking of matrices to improve temporal (and spatial) locality Example: Transpose phase in Fast Fourier Transform (FFT); to improve locality, the algorithm carries out blocked transpose i.e. transposes a block of data at a time
file:///E|/parallel_com_arch/lecture15/15_3.htm[6/13/2012 11:27:57 AM]
decomposition (you need only one element, but must transfer the whole cache line): no good solution
file:///E|/parallel_com_arch/lecture15/15_4.htm[6/13/2012 11:27:57 AM]
If the algorithm is designed so poorly that Two processors write to two different words within a cache line at the same time The cache line keeps on moving between two processors The processors are not really accessing or updating the same element, but whatever they are updating happen to fall within a cache line: not a true sharing, but false sharing For shared memory programs false sharing can easily degrade performance by a lot Easy to avoid: just pad up to the end of the cache line before starting the allocation of the data for the next processor (wastes memory, but improves performance)
Given the total volume of communication (in bytes, say) the goal is to reduce the end-to-end latency Simple model:
T = f*(o + L + (n / m) / B + tc ā overlap) where f = frequency of messages o = overhead per message (at receiver and sender) L = network delay per message (really the router delay) n = total volume of communication in bytes m = total number of messages B = node-to-network bandwidth t (^) c = contention-induced average latency per message overlap = how much communication time is overlapped with useful computation
The goal is to reduce T Reduce o by communicating less: restructure algorithm to reduce m i.e. communicate larger messages (easy for message passing, but need extra support in memory controller for shared memory e.g., block transfer) Reduce L = number of average hops*time per hop Number of hops can be reduced by mapping the algorithm on the topology properly e.g., nearest neighbor communication is well-suited for a ring (just left/right) or a mesh (grid solver example); however, L is not very important because today routers are really fast (routing delay is ~10 ns); o and t (^) c are the dominant parts in T Reduce t (^) c by not creating hot-spots in the system: restructure algorithm to make sure a particular node does not get flooded with messages; distribute uniformly
It is very easy to ignore contention effects when designing algorithms Can severely degrade performance by creating hot-spots Location hot-spot: Consider accumulating a global variable; the accumulation takes place on a single node i.e. all nodes access the variable allocated on that particular node whenever it tries to increment it
file:///E|/parallel_com_arch/lecture15/15_5.htm[6/13/2012 11:27:58 AM]
Avoid location hot-spot by either staggering accesses to the same location or by designing the algorithm to exploit a tree structured communication Module hot-spot Normally happens when a particular node saturates handling too many messages (need not be to same memory location) within a short amount of time Normal solution again is to design the algorithm in such a way that these messages are staggered over time Rule of thumb: design communication pattern such that it is not bursty; want to distribute it uniformly over time
Increase overlap between communication and computation Not much to do at algorithm level unless the programming model and/or OS provide some primitives to carry out prefetching, block data transfer, non-blocking receive etc. Normally, these techniques increase bandwidth demand because you end up communicating the same amount of data, but in a shorter amount of time (execution time hopefully goes down if you can exploit overlap)
Comparison of sequential and parallel execution Sequential execution time = busy useful time + local data access time Parallel execution time = busy useful time + busy overhead (extra work) + local data access time + remote data access time + synchronization time Busy useful time in parallel execution is ideally equal to sequential busy useful time / number of processors Local data access time in parallel execution is also less compared to that in sequential execution because ideally each processor accesses less than 1/P th of the local data (some data now become remote) Parallel programs introduce three overhead terms: busy overhead (extra work), remote data access time, and synchronization time Goal of a good parallel program is to minimize these three terms Goal of a good parallel computer architecture is to provide sufficient support to let programmers optimize these three terms (and this is the focus of the rest of the course)
file:///E|/parallel_com_arch/lecture15/ex_1.htm[6/13/2012 11:27:58 AM]
These problems should be tried after module 08 is completed.
file:///E|/parallel_com_arch/lecture15/ex_sol_1.htm[6/13/2012 11:27:58 AM]
Solution: Execution time on P processors, T(P) = sT(1) + (1-s)T(1)/P. Speedup = 1/(s + (1-s)/P). Upper bound is achieved when P approaches infinity. So maximum speedup = 1/s. As expected, the upper bound on achievable speedup is inversely proportional to the sequential fraction.
Solution: The basic problem is to compute the maximum, minimum, and average values of H. The rest is just about substituting the values of the parameters. The maximum value of H is 14 while the minimum is 1. To compute the average, you need to consider all possible messages, compute H for them, and then take the average. Consider S=(x0, y0) and D=(x1, y1). So H = |x0-x1|
file:///E|/parallel_com_arch/lecture15/ex_sol_1.htm[6/13/2012 11:27:58 AM]
A[i][j] - (A[i-1][j] + A[i+1][j] + A[i][j-1] + A[i][j+1])/4. Suppose you assign one matrix element to one processor (i.e. you have n^2 processors). Compute the total amount of data communication between processors.
Solution: Each processor requires the four neighbors i.e. 32 bytes. So total amount of data communicated is 32n^2.
Solution: Let us compute the bandwidth requirement of the processor per second. Instruction cache misses 10^6 times transferring 32 bytes on each miss. Out of 2010^6 loads 10^6 miss in the cache transferring 32 bytes on each miss. Out of 10^7 stores 510^5 miss in the cache transferring 64 bytes on each miss. Thus, total amount of data transferred per second is 96*10^6 bytes. Thus at most two processors can be supported on a 250 MB/s bus.