Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Massive mv to use cmake as the default compilation infrastructure.
[simgrid.git] / examples / smpi / barrier.c
1 #include <stdio.h>
2 #include <mpi.h>
3
4
5 int main (int argc, char **argv) {
6           int size, rank;
7           int root=0;
8           int value;
9           double start_timer;
10
11           MPI_Init(&argc, &argv);
12           MPI_Comm_size(MPI_COMM_WORLD, &size);
13           MPI_Comm_rank(MPI_COMM_WORLD, &rank);
14
15   start_timer = MPI_Wtime();
16
17   MPI_Barrier( MPI_COMM_WORLD );
18
19   MPI_Barrier( MPI_COMM_WORLD );
20   if (0 == rank) {
21           printf("... Barrier ....\n");
22           printf("Elapsed=%lf s\n", MPI_Wtime() - start_timer);
23   }
24
25   MPI_Finalize();
26   return 0;
27 }
28