mpi programming for newbie

10
MPI Programming for newbie - Wei Mu Wednesday, April 18, 12

Upload: wei-mu

Post on 19-Jun-2015

293 views

Category:

Technology


6 download

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

MPI Programming for newbie

- Wei Mu

Wednesday, April 18, 12

Page 2: MPI Programming for newbie

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

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

Why Choose it ?

Wednesday, April 18, 12

Page 5: MPI Programming for newbie

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

Sample 01: Send & Receive

Wednesday, April 18, 12

Page 7: MPI Programming for newbie

Sample 02: π Calculation

Wednesday, April 18, 12

Page 8: MPI Programming for newbie

Wednesday, April 18, 12

Page 9: MPI Programming for newbie

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

Q & A , Feedback

• What’s your next steps of MPI Programming

• Which gives you more interest on MPI Programming

Wednesday, April 18, 12