1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
4 * (C) 2003 by Argonne National Laboratory.
5 * See COPYRIGHT in top-level directory.
12 static char MTEST_Descrip[] = "Get the group of an intercommunicator";
15 int main(int argc, char *argv[])
18 int rank, size, grank, gsize;
19 int minsize = 2, isleft;
23 MTest_Init(&argc, &argv);
25 /* The following illustrates the use of the routines to
26 * run through a selection of communicators and datatypes.
27 * Use subsets of these for tests that do not involve combinations
28 * of communicators, datatypes, and counts of datatypes */
29 while (MTestGetIntercomm(&comm, &isleft, minsize)) {
30 if (comm == MPI_COMM_NULL)
32 /* Determine the sender and receiver */
33 MPI_Comm_rank(comm, &rank);
34 MPI_Comm_size(comm, &size);
35 MPI_Comm_group(comm, &group);
36 MPI_Group_rank(group, &grank);
37 MPI_Group_size(group, &gsize);
40 fprintf(stderr, "Ranks of groups do not match %d != %d\n", rank, grank);
44 fprintf(stderr, "Sizes of groups do not match %d != %d\n", size, gsize);
46 MPI_Group_free(&group);