article

The Message Passing Interface (MPI) is a computer communications protocol. It is a de facto standard for communication among the nodes running a parallel program on a distributed memory system. MPI implementations consist of a library of routines that can be called from Fortran, C, C++ and Ada programs. The advantage of MPI over older message passing libraries is that it is both portable (because MPI has been implemented for almost every distributed memory architecture) and fast (because each implementation is optimized for the hardware on which it runs).

Example program


Here is "Hello World" in MPI. Actually we send a "hello" message to each processor, manipulate it trivially, send the results back to the main processor, and print the messages out.

/* test of MPI */ #include #include #include int main(int argc, char *argv*) { char idstr*; char buff*; int numprocs; int myid; int i; MPI_Status stat; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); if(myid == 0) { printf("We have %d processors\n", numprocs); for(i=1;i

See also


External links


References


Parallel computing

Message Passing Interface | Interfaz de Paso de Mensajes | Message Passing Interface | Message Passing Interface | Message Passing Interface | MPI | Message Passing Interface | Message Passing Interface

 

This article is licensed under the GNU Free Documentation License. It uses material from the "Message Passing Interface".

Home Pageartsbusinesscomputersgameshealthhospitalshomekids & teensnewsphysiciansrecreationreferenceregionalscienceshoppingsocietysportsworld