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 $";
22 main (int argc, char **argv)
28 MPI_Init (&argc, &argv);
29 MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
30 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
31 printf ("MPI comm size is %d with rank %d executing\n", nprocs, rank);
32 MPI_Barrier (MPI_COMM_WORLD);
33 MPI_Reduce (&rank, &recvbuf, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
36 printf ("Reduce max is %d\n", recvbuf);
38 MPI_Barrier (MPI_COMM_WORLD);
40 printf ("(%d) Finished normally\n", rank);