Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update topo
[simgrid.git] / teshsuite / smpi / mpich3-test / topo / graphcr.c
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *
4  *  (C) 2003 by Argonne National Laboratory.
5  *      See COPYRIGHT in top-level directory.
6  */
7 #include "mpi.h"
8 #include <stdio.h>
9 #include "mpitest.h"
10
11 /*
12 static char MTEST_Descrip[] = "Create a communicator with a graph that contains no processes";
13 */
14
15 int main(int argc, char *argv[])
16 {
17     int errs = 0;
18     int *index = 0, *edges = 0;
19     MPI_Comm comm;
20
21     MTest_Init(&argc, &argv);
22
23     /* MPI 2.1, page 246, lines 29-30 make it clear that this is a valid
24      * (not erroneous) call that must return MPI_COMM_NULL */
25     MPI_Graph_create(MPI_COMM_WORLD, 0, index, edges, 0, &comm);
26     if (comm != MPI_COMM_NULL) {
27         errs++;
28         fprintf(stderr, "Expected MPI_COMM_NULL from empty graph create\n");
29     }
30
31     MTest_Finalize(errs);
32     MPI_Finalize();
33     return 0;
34 }