Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
test more extensively error returns for collectives.
[simgrid.git] / teshsuite / smpi / coll-barrier / coll-barrier.c
1 /* Copyright (c) 2009-2019. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <stdio.h>
8 #include <mpi.h>
9
10 int main(int argc, char **argv)
11 {
12   int size;
13   int rank;
14
15   MPI_Init(&argc, &argv);
16   MPI_Comm_size(MPI_COMM_WORLD, &size);
17   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
18
19   int status = MPI_Barrier(MPI_COMM_NULL);
20   if(status!=MPI_ERR_COMM)
21     printf("MPI_Barrier did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
22
23   MPI_Barrier(MPI_COMM_WORLD);
24
25   if (0 == rank) {
26     printf("... Barrier ....\n");
27   }
28
29   MPI_Finalize();
30   return 0;
31 }