1 #include "mpi.h"
2 #include <stdio.h>
3
4 int main( argc, argv )
5 int argc;
6 char **argv;
7 {
8 MPI_Init( &argc, &argv );
9 printf( "Hello world\n" );
10 MPI_Finalize();
11 return 0;
12 }
|
#include "mpi.h"provides basic MPI definitions and types.
MPI_Initstarts MPI.
MPI_Finalizeexits MPI.
printfrun on each process.
mpicc -o hello hello.c mpirun -np 2 hello