Introduction To Parallel Computing: What Is Parallel Computing? CS 480 - II Parallel and Scientific Computing
Introduction To Parallel Computing: What Is Parallel Computing? CS 480 - II Parallel and Scientific Computing
Introduction To Parallel Computing: What Is Parallel Computing? CS 480 - II Parallel and Scientific Computing
• Pixel Images
• Scientific Computing
X 2[ j ] A *( X 1[ j 1] 2 X 1[ j ] X 1[ j 1]) X 0[ j ]
Amdahl’s Law
• Speedup = 1/(1-P); P is parallel fraction of code
• Speedup = 1/(P/N+S); S is serial fraction of code
• Example
N P = 0.5 P = 0.99
10 1.82 9.17
100 1.98 50.25
1000 1.99 90.99
MPI
• Software: Fortran 90, HPF, c
• Standard
• Simple to use
• Six Commands
1) MPI_Init (Initialize MPI)
2) MPI_Comm_size (Determine the number of processors)
3) MPI_Comm_rank (Which process am I?)
4) MPI_Send (Send a message)
5) MPI_Recv (Receive a message)
6) MPI_Finalize (Sayonara)
Sample Program
• Determine the average of n numbers stored in
array f.
• Assignment 1
(1) Go to websites and look at sample MPI Codes
(2) Convert code to c
(3) Look up trapezoidal rule and write
a parallel algorithm to compute
1 1
4 dx 4 arctan( x ) |0 4 arctan(1)
1
0 1 x2