Text-only Table of Contents (frame/ no frame)
(17) Amdahl's Law Previous Top Next

How to Know When and Where to Add OpenMP Directives


1. profile your code
2. determine the sections where the most time is spent and see if it can be parallelized
3. use Amdahl's Law to determine potential speed up
4. put directives in the code and measure run times on serial and parallel runs



Amdahl's Law

Speedup(N) =   1/((1-p)+p/N)

where p= portion of the code that can be made parallel
N=number of processor. For example:

p N Speedup
.5 2 1.3
.5 4 1.6
.5 infinite 2
.9 2 1.81
.9 4 3.07
.9 infinite 10






Previous Top Next


Amdahls_law.src  last modified Mar 23, 2009 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College