mpi programming for newbie
DESCRIPTION
Message Passing Interface (MPI) is a standardized and portable message-passing system designed by a group of researchers from academia and industry to function on a wide variety of parallel computers. The standard defines the syntax and semantics of a core of library routines useful to a wide range of users writing portable message-passing programs in Fortran or the C programming language. There are several well-tested and efficient implementations of MPI, including some that are free or in the public domain. These fostered the development of a parallel software industry, and there encouraged development of portable and scalable large-scale parallel applications.TRANSCRIPT
![Page 1: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/1.jpg)
MPI Programming for newbie
- Wei Mu
Wednesday, April 18, 12
![Page 2: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/2.jpg)
Agenda
• What’s MPI
• Why Choose it
• MPI Basic Subroutine
• Sample 01: Send & Receive
• Sample 02: π Calculation
Wednesday, April 18, 12
![Page 3: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/3.jpg)
What's MPI?
• A LIBRARY , NOT a programming language
• Standard
• Message Passing Interface
• Work with FORTRAN & C
Wednesday, April 18, 12
![Page 4: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/4.jpg)
Why Choose it ?
Wednesday, April 18, 12
![Page 5: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/5.jpg)
MPI Basic Subroutine# include “mpi.h”int main(int argc, char *argv[]){......
MPI_Init();......
MPI_Comm_rank(MPI_COMM, int *rank);MPI_Comm_size(MPI_COMM, int *size);
.....MPI_Finalize();
}
Wednesday, April 18, 12
![Page 6: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/6.jpg)
Sample 01: Send & Receive
Wednesday, April 18, 12
![Page 7: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/7.jpg)
Sample 02: π Calculation
Wednesday, April 18, 12
![Page 8: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/8.jpg)
Wednesday, April 18, 12
![Page 9: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/9.jpg)
Reference: SubroutinesMPI_Send(buf, count, datatype, dest, tag, comm, ierror)
MPI_Recv(buf, count, datatype, source, tag, comm, status, ierror)
MPI_BCAST(buffer,count,datatype,root,comm)
MPI_BARRIER(comm)
MPI_REDUCE(sendbuf,recvbuf,count,datatype,op,root,comm)
...... ......
Wednesday, April 18, 12
![Page 10: MPI Programming for newbie](https://reader035.vdocuments.site/reader035/viewer/2022073017/558447c2d8b42adf748b4628/html5/thumbnails/10.jpg)
Q & A , Feedback
• What’s your next steps of MPI Programming
• Which gives you more interest on MPI Programming
Wednesday, April 18, 12