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 #include "mpitestconf.h"
11 int main(int argc, char **argv)
14 MPI_Group full_group, half_group;
19 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
20 MPI_Comm_size(MPI_COMM_WORLD, &size);
22 MPI_Comm_group(MPI_COMM_WORLD, &full_group);
24 range[0][1] = size / 2;
26 MPI_Group_range_incl(full_group, 1, range, &half_group);
28 if (rank <= size / 2) {
29 MPI_Comm_create_group(MPI_COMM_WORLD, half_group, 0, &comm);
34 MPI_Group_free(&half_group);
35 MPI_Group_free(&full_group);
38 printf(" No Errors\n");