Message Passing Programming with MPI?Introduction to MPI?Basic MPI functions?Most of the MPI materials are obtained from William Gropp and Rusty Lusk’s MPI tutorial at /mpi/tutorial/ Message Passing Interface (MPI)?MPI is an industrial standard that specifies library routines needed for writing message passing programs.–munication routines–Also include other features such as topology.? MPI allows the development of scalable portable message passing programs. –It is a standard supported pretty much by everybody in the field.?MPI uses a library approach to support parallel programming.–MPI specifies the API for message passing (communication related routines)–MPI program = C/Fortran program + munication calls.–MPI programs piled with a piler( gcc) and linked with an mpi execution model?Separate (collaborative) processes are running all the time.–‘mpirun –machinefile machines –np 16 ’? The same is executed on 16 machines.–Different from the OpenMP model.?What about the sequential portion of an application?MPI data model?No shared memory. Using munications whenever necessary.?How to solve large problems–Logically partition the large array and logically distribute the large array into processes.?MPI specification is both simple plex.–Almost all MPI programs can be realized with six MPI routines.–MPI has a total of more than 100 functions and a lot of concepts. –We will mainly discuss the simple MPI, but we will also give a glimpse of plex MPI.?MPI is about just the right size.–One has the flexibility when it is required.–One can start using it after learning the six hello world MPI program#include "" #include <> int main( int argc, char *argv[] ){ MPI_Init( &argc, &argv ); printf( "Hello world\n" ); MPI_Finalize(); return 0; } ? contains MPI definitioins and types.?MPI program must start with MPI_init?MPI program must exit with MPI_Finalize?MPI functions are just library routines that can be used
message passing programming with mpi 来自淘豆网www.taodocs.com转载请标明出处.