Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reactivate an umpire test, once disabled in 56fefe1bf81ca.
[simgrid.git] / teshsuite / smpi / isp / umpire / hello.c
1 /* -*- C -*-
2
3    @PROLOGUE@
4
5    -----
6
7    Jeffrey Vetter vetter@llnl.gov
8    Center for Applied Scientific Computing, LLNL
9    31 Oct 2000
10
11    hello.c -- simple hello world app
12
13  */
14 #include <stdio.h>
15 #ifndef lint
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 $";
17 #endif
18
19 #include "mpi.h"
20
21 int
22 main (int argc, char **argv)
23 {
24   int nprocs = -1;
25   int rank = -1;
26   int recvbuf = 0;
27
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);
34   if (rank == 0)
35     {
36       printf ("Reduce max is %d\n", recvbuf);
37     }
38   MPI_Barrier (MPI_COMM_WORLD);
39   MPI_Finalize ();
40   printf ("(%d) Finished normally\n", rank);
41 }
42
43
44 /* eof */