3. Speedup & PRAMs
Jan 20, 2021
Speedup
- on a uniprocessor:
- with multiple processors:
Speedup
Goal is to achieve linear speedup
is the best known sequential time- when both upper (
) and lower ( ) bound, then we have bound - for example: linear search of an array with
values is is always expressed as optimal time
- when both upper (
Example 1: PRAM find value
Start with
1 2 3 4 5 6 | |
Time:
Speedup:
Important!
- never divide by
Example 2: PRAM find value v. 2
Similar setting but assume CREW PRAM. Use this different algorithm, this time (try to)
use variable to determine found state and index of where the match was found:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
What is the problem?
Simultaneous writes by multiple processors into same memory location → runtime errors
PRAM types
- EREW PRAM = exclusive read, exclusive write: no two processors allowed to read/write to/from same shared memory location
- CREW PRAM = concurrent read, exclusive write
- CRCW PRAM = concurrent read and write
- the most popular model
- there are subcategories of CRCW PRAM:
- Common CRCW PRAM: concurrent writes must write the same value
- Priority CRCW PRAM: processor with higher priority gets to write
- arbitrary CRCW PRAM: concurrent writes resolved arbitrarily