1#include <stdio.h>
2#include <stdlib.h>
3#include <mpi.h>
4
5int
6main (int argc, char *argv[])
7{
8 int rank, size, length;
9 char name[BUFSIZ];
10
11 MPI_Init (&argc, &argv);
12 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
13 MPI_Comm_size (MPI_COMM_WORLD, &size);
14 MPI_Get_processor_name (name, &length);
15
16 printf ("%s: hello world from process %d of %d\n", name, rank, size);
17
18 MPI_Finalize ();
19
20 return EXIT_SUCCESS;
21}