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.
11 int main(int argc, char *argv[])
16 MPI_Group group, outgroup;
19 MTest_Init(&argc, &argv);
20 /* To improve reporting of problems about operations, we
21 * change the error handler to errors return */
22 MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
24 while (MTestGetComm(&comm, 1)) {
25 if (comm == MPI_COMM_NULL)
28 MPI_Comm_group(comm, &group);
29 rc = MPI_Group_incl(group, 0, 0, &outgroup);
33 printf("Error in creating an empty group with (0,0)\n");
35 /* Some MPI implementations may reject a null "ranks" pointer */
36 rc = MPI_Group_incl(group, 0, ranks, &outgroup);
40 printf("Error in creating an empty group with (0,ranks)\n");
44 if (outgroup != MPI_GROUP_EMPTY) {
45 /* Is the group equivalent to group empty? */
46 rc = MPI_Group_compare(outgroup, MPI_GROUP_EMPTY, &result);
47 if (result != MPI_IDENT) {
50 printf("Did not create a group equivalent to an empty group\n");
53 rc = MPI_Group_free(&group);
58 if (outgroup != MPI_GROUP_NULL) {
59 rc = MPI_Group_free(&outgroup);