7 Jeffrey Vetter vetter@llnl.gov
8 Center for Applied Scientific Computing, LLNL
11 hello.c -- simple hello world app
16 static char *rcsid = "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/hello.c,v 1.2 2000/12/04 19:09:46 bronis Exp $";
21 main (int argc, char **argv)
27 MPI_Init (&argc, &argv);
28 MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
29 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
30 printf ("MPI comm size is %d with rank %d executing\n", nprocs, rank);
31 MPI_Barrier (MPI_COMM_WORLD);
32 MPI_Reduce (&rank, &recvbuf, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
35 printf ("Reduce max is %d\n", recvbuf);
37 MPI_Barrier (MPI_COMM_WORLD);
39 printf ("(%d) Finished normally\n", rank);