13 Wrapup
13 Wrapup
Parallelism: Concurrency:
Use extra resources to Correctly and efficiently manage
solve a problem faster access to shared resources
work requests
resources resource
Exploiting Parallelism
¢ computer games
§ Graphics, physics, sound, AI etc. can be done separately
§ Furthermore, there is often parallelism within each of these:
§ Each pixel on the screen’s color can be computed independently
§ Non-contacting objects can be updated/simulated independently
§ Artificial intelligence of non-human entities done independently
Instruction-Level Parallelism
add %r2 <- %r3, %r4 Dependences?
or %r2 <- %r2, %r4 RAW – read after write
lw %r6 <- 0(%r4) WAW – write after write
addi %r7 <- %r6, 0x5 WAR – write after read
sub %r8 <- %r8, %r4
When can we reorder instructions?
Data Parallelism
¢ Consider adding together two arrays:
Data Parallelism
¢ Consider adding together two arrays:
+ + ++ Single Instruction,
Multiple Data (SIMD)
#1 #2
IBM Power5
As programmers, do we care?
¢ What happens if we run this program on a multicore?
#1 #2
Serial regions
¢ For example, consider a program that, when executing on one processor, spends 10% of its
time in a non-parallelizable region. How much faster will this program run on a 3-processor
system?
Summary
¢ Multicore: more than one processor on the same chip.
§ Almost all devices now have multicore processors
§ Results from Moore’s law and power constraint