Load Balancing
Perfectly Load-Balanced Program
In a perfectly balanced parallel program no set of processors is idle while other set of processors is doing some computation
Amdahl’s Law
- Assume that code has serial fraction
- Let T(1) be the execution time in one processor
- T(P) is execution time on P processors
- Then speed up on P processors is given by
About Data
- In a shared memory parallel program variables are either “shared” or “private”
“private” Variables
- Visible to one thread only
- Changes made to these variable are not visible to other threads
- Example : Local variables in a function that is executed in parallel
“shared” Variables
- Visible to all threads
- Changes made to these variable by one thread are visible to other threads
- Example : Global data
|