1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2003 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
9 /* USE_STRICT_MPI may be defined in mpitestconf.h */
10 #include "mpitestconf.h"
12 int main(int argc, char **argv)
15 MPI_Group full_group, half_group;
17 MPI_Comm __attribute__((unused)) comm;
20 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
21 MPI_Comm_size(MPI_COMM_WORLD, &size);
23 MPI_Comm_group(MPI_COMM_WORLD, &full_group);
25 range[0][1] = size / 2;
27 MPI_Group_range_incl(full_group, 1, range, &half_group);
29 #if !defined(USE_STRICT_MPI) && defined(MPICH)
30 if (rank <= size / 2) {
31 MPI_Comm_create_group(MPI_COMM_WORLD, half_group, 0, &comm);
35 #endif /* USE_STRICT_MPI */
37 MPI_Group_free(&half_group);
38 MPI_Group_free(&full_group);
41 printf(" No Errors\n");